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

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

Hi,

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.05178 seconds with 11 queries