View Single Post
Old 05 May 2020, 06:12   #1
Registered User

Join Date: May 2019
Location: Norway
Posts: 14
Newbie question: what is the difference between #-1 and #$ff?


In the "Compute's Machine Language Programming" book it says:

moveq #$ff,d7 ; Move the value $FFFFFFFF (the sign-extended version of $FF) into data register D7.

This sounds like a smart way (and fast!) to set all the bits of a register.

But if I write this instruction in AsmOne I get an error message 'Out of range 8-bit'.

Now, if I instead write 'moveq #-1,d7' it works fine.

What is the difference between #$ff and #-1? And why does not moveq #ff,d7 work at all?
pushead is offline  
Page generated in 0.04390 seconds with 11 queries