Quote:
Originally Posted by DanielAllsopp
Thanks Dan, that's the sort of little tip I'm missing. I think I need to invest in a decent reference for basic ASM instructions.
|
Quote:
Originally Posted by mcgeezer
The set instructions are all useful too.
|
Yep, quite often you might (want to) do something like this to set a flag if d1 >= 100
Code:
moveq #0,d0
cmp.w #100,d1
blt.s .LessThan
moveq #1,d0
.LessThan
but you can do this:
Code:
cmp.w #100,d1
sge d0
which will set d0.b to 0 or -1
You have all these "set" instructions:
SCC set on carry clear
SCS set on carry set
SEQ set on equal
SGE set on greater than or equal
SGT set on greater than
SHI set on higher than
SLE set on less than or equal
SLS set on lower than or same
SLT set on less than
SMI set on minus (i.e., negative)
SNE set on not equal
SPL set on plus (i.e., positive)
SVC set on overflow clear
SVS set on overflow set
SF set on false (i.e., set never)
ST set on true (i.e., set always)
But yeah, get yourself a good reference guide for 68000
There's a few online.. this one is fine for most purposes:
http://wpage.unina.it/rcanonic/didat...docs/68000.pdf