Quote
Sonic 65: Sorry to sound annoying, but it doesn't have all of the commands, like ADD or BEQ (now that's useful)...
You've just asked for it.
Flags:
N: Negative. Set to 1 if result negative.
Z: Zero. Set to 1 if result is 0 (false).
V: Overflow. Set to 1 if overflow (Pos + Pos = Neg or Neg + Neg = Pos)
C: Carry.
X: Like C, Carry.
Assembly <-> Hexadecimal
MOVE.B <->
11 FC 12 34 AB CD (Store byte 34 at RAM $ABCD)
MOVE.L <->
21 FC 12 34 56 78 AB CD (Store long 12345678 at RAM $ABCD)
MOVE.W <->
31 FC 12 34 AB CD (Store word 1234 at RAM $ABCD)
CMPI.B <->
0C 38 12 34 AB CD (compare byte 34 at data from RAM $ABCD)
CMPI.W <->
0C 78 12 34 AB CD (compare word 1234 at data from RAM $ABCD)
CMPI.L <->
0C B8 12 34 56 78 AB CD (compare long 12345678 at data from RAM $ABCD)
BRA.S <->
60 11 (Branch always, jump 11 bytes)
BSR.S <->
61 11 (Branch under sub-routine)
BHI.S <->
62 11 (Branch if C=0 and Z=0)
BLS.S <->
63 11 (Branch if C=1 or Z=1)
BCC.S <->
64 11 (Branch if Carry clear, C=0)
BCS.S <->
65 11 (Branch if Carry set, C=1)
BNE.S <->
66 11 (Branch if non equal, Z=0 (false))
BEQ.S <->
67 11 (Branch if equal, Z=1 (true))
BVC.S <->
68 11 (Branch if Overflow clear, V=0)
BVS.S <->
69 11 (Branch if Overflow set, V=1)
BPL.S <->
6A 11 (Branch if result plus, N=0)
BMI.S <->
6B 11 (Branch if result minus, N=1)
BGE.S <->
6C 11 (Branch if greater or equal to, N=V)
BLT.S <->
6D 11 (Branch if lower than, N is not the same as V)
BGT.S <->
6E 11 (Branch if greater than, N=V and Z=0)
BLE.S <->
6F 11 (Branch if lower or equal to, N is not the same as V or Z=1)
ADD <->
52 38 AB CD (Add 1 at value in RAM $ABCD)
ADD <->
54 38 AB CD (Add 2 at value in RAM $ABCD)
JMP <->
4E F9 11 11 11 11 (Jump at ROM $11111111)
JSR <->
4E B9 11 11 11 11 (Jump at sub-routine at ROM $11111111)
NOP <->
4E 71 (Non operation, do nothing and continue)
RTS <->
4E 75 (Return to sub-routine)
EDIT: Examples:
RAM $FE10: Level loaded.
RAM $ FE 11: Act loaded.
RAM $ EE 00: Camera X position.
RAM $ EE 04: Camera Y position.
RAM $ F64A: Water Y height.
0C 78 04 01 FE 10 67 10
If Metropolis zone 2 (level 04 01) is loaded, jump 10 bytes.
0C 78 0E 00 EE 00 6F 08
If Camera X position is lower or equal to 0E 00, jump 08 bytes.
0C 78 15 00 EE 00 6F 10 31 FC 02 00 F6 4A
If Camera X position is greater than 15 00, set water Y height to 02 00.
Else, jump 10 bytes.
Helpful? There might be some errors, I haven't a 68K disassembly program for Mac, then I found this myself.
This post has been edited by Sonic Hachelle-Bee: 28 October 2004 - 01:10 AM