[A89] Re: moveq #0,dx
[Prev][Next][Index][Thread]
[A89] Re: moveq #0,dx
Doesn't the moveq move a value between -128 and 127 into a register and
sign extends it to a long value? I know that I have used moveq #0,dx
plenty of times and it works fine.
Addqs on the other hand are limited from 0 to 8. So maybe tigcc is using
this limit also for the moveqs. It would seem a stupid bug though.
-Samuel
Quoting Scott Noveck <noveck@pluto.njcc.com>:
>
> I recall that a while ago we had a little discussion where we
> learned that
> "moveq #0,dx" is not a valid 68k opcode. Since you should use clr
> instead
> of moveq to store zero in a register, moveq actually has the range
> 1 through
> 8, not zero through seven; if the 68k chip sees the opcode that
> _would_ be
> "moveq #0,dx" it actually stores 8 in that register, not zero.
>
> However, TIGCC had that little bug where it would actually accept
> and
> compile "moveq #0,dx" mistakenly storing 8 in dx, while it would
> not allow
> "moveq #8,dx" which it should. Was this bug ever fixed?
>
> -Scott
>
>
>
References: