Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!rutgers!ub.d.umn.edu!cs.umn.edu!sec From: sec@cs.umn.edu (Stephen E. Collins) Newsgroups: comp.sys.mac.programmer Subject: Re: Pascal deficiency? Message-ID: <1990Dec17.172613.7941@cs.umn.edu> Date: 17 Dec 90 17:26:13 GMT References: <1990Dec17.160242.5095@phri.nyu.edu> Organization: University of Minnesota, Minneapolis, CSci dept. Lines: 23 In <1990Dec17.160242.5095@phri.nyu.edu> roy@phri.nyu.edu (Roy Smith) writes: > I've never written a single line of pascal in my life, but in C, >x++ and x = x + 1 are absolutely and completely identical (as is x += 1). >Any decent compiler should generate exactly the same code for all three. Decent is the key word here. If your compiler does not optimize, you're likely to get different code for these, and with the number of shoddy software products on the market these days, you might want to investigate. To wit, most CPUs have some sort of increment instruction in the hardware, so a shoddy compiler may generate something like the following code: x := x+1: LOAD X ADD 1 STORE X -or- x++: INC X Stephen E. Collins University of Minnesota Microcomputer & Workstation Networks Center sec@boombox.micro.umn.edu | sec@umnacvx.bitnet | FAX: (612)625-6817