Path: utzoo!utgpu!watmath!clyde!bellcore!rutgers!cbmvax!ditto From: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Newsgroups: comp.sys.m68k Subject: Re: Why does addq.w #n,sp work? Summary: Address register operations are automatically done in 32 bits Keywords: C asm addq Message-ID: <5460@cbmvax.UUCP> Date: 8 Dec 88 22:15:49 GMT References: <5005@bsu-cs.UUCP> Reply-To: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Distribution: na Organization: Commodore Technology, West Chester, PA Lines: 19 In article <5005@bsu-cs.UUCP> jbwaters@bsu-cs.UUCP (J. Brian Waters) writes: > What I do not understand is why it is not a addq.l #8,sp as I thought >the sp was a 32 bit counter. Why does it use the addq.w form rather then >the addq.l? Under "addq" in the 68020 manual: "When adding to address registers, the entire destination address register is used, regardless of the operation size." (It should be the same for any 68000-family CPU.) This is typical of address register operations on the 680x0 ... even a move.w to an address register is sign-extended to 32-bits and modifies the whole 32 bits of the destination. -- -=] Ford [=- "The number of Unix installations (In Real Life: Mike Ditto) has grown to 10, with more expected." ford@kenobi.cts.com - The Unix Programmer's Manual, ...!sdcsvax!crash!elgar!ford 2nd Edition, June, 1972. ditto@cbmvax.commodore.com