Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!elroy.jpl.nasa.gov!ncar!gatech!prism!ccastdf From: ccastdf@prism.gatech.EDU (Dave) Newsgroups: comp.lang.c Subject: Re: Just a little something that has been bothering me. Message-ID: <18539@hydra.gatech.EDU> Date: 12 Dec 90 17:38:38 GMT References: <1990Nov30.180913.20890@clear.com> <1990Dec08.222943.1581@cs.widener.edu> <14694@smoke.brl.mil> <202@nazgul.UUCP> Organization: Georgia Institute of Technology Lines: 39 bright@nazgul.UUCP (Walter Bright) writes: >In article <1990Dec08.222943.1581@cs.widener.edu> sven@cs.widener.edu (Sven Heinicke) writes: >-What is quicker? >- int a = 0,i = 0; >-or >- int a,i; >- i = a = 0; >-and why? Well, int a=0,i=0 generates the following lines of assembly: _main: jmp .L22 .L21: movl $0,-4(%ebp) movl $0,-8(%ebp) and int a,i; i=a=0; generates these lines: _main: jmp .L22 .L21: movl $0,-4(%ebp) movl $0,%eax movl %eax,-8(%ebp) Therefore, on a 386 Sequent with no optimization, the first is more effieient. Dave -- David Frascone Georgia Institute of Technology, Atlanta Georgia, 30332 Office of Computing Services--User Assistant