Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!rbrown From: rbrown@svax.cs.cornell.edu (Russell Brown) Newsgroups: comp.sys.m68k Subject: Re: Why does addq.w #n,sp work? Keywords: C asm addq Message-ID: <23233@cornell.UUCP> Date: 8 Dec 88 18:59:30 GMT References: <5005@bsu-cs.UUCP> Sender: nobody@cornell.UUCP Reply-To: rbrown@svax.cs.cornell.edu (Russell Brown) Distribution: na Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 13 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? According to the entry on ADDQ in the M68000 Programmer's reference manual, "When adding to address registers, the entire destination address register is used, regardless of the operation size." As to why the C compiler you're using chooses the .w form, I can't say. It might be a feature, or it might be that doing it that way made doing something else easier. Russell G. Brown Cornell Computer Science