Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!shelby!neon!kaufman From: kaufman@Neon.Stanford.EDU (Marc T. Kaufman) Newsgroups: comp.sys.mac.programmer Subject: Re: Increment (Was Re: Pascal deficiency)? Message-ID: <1990Dec18.001753.3756@Neon.Stanford.EDU> Date: 18 Dec 90 00:17:53 GMT References: <1990Dec17.160242.5095@phri.nyu.edu> <1990Dec17.172613.7941@cs.umn.edu> Organization: Computer Science Department, Stanford University Lines: 30 In article ewright@convex.com (Edward V. Wright) writes: >In <1990Dec17.172613.7941@cs.umn.edu> sec@cs.umn.edu (Stephen E. Collins) writes: >Actually, this would have to be ->x++: LOAD X -> INC X -> STORE X >Unless you have an instruction to increment variables in memory! Well, since we ARE in a Mac group, lets just look at the code MPW C generates for just such constructs: i = i+1; MOVE.L i,D2 ADDQ.L #$1,D2 MOVE.L D2,i i++; MOVE.L i,D2 ADDQ.L #$1,i ++i; ADDQ.L #$1,i Behold. The 68K does, indeed, have an instruction to increment variables in memory. Marc Kaufman (kaufman@Neon.stanford.edu)