Difference between revisions of "68000 ASM-to-Hex Code Reference"
From Sonic Retro
Line 1: | Line 1: | ||
{{segaretro}} | {{segaretro}} | ||
− | ''(Document originally by [[Ambil]])'' | + | ''(Document originally by [[User:Ambil|Ambil]])'' |
Welcome to my Motorola 68000 programming reference. It consists a table containing useful examples of the 68k instructions, and it can be a very nice tool for everyone who is hacking MegaDrive / Genesis games in a hex editor. For your help and confort, the parameters in the ASM commands have been coloured along with their respective places in the 16-bit instruction codes. | Welcome to my Motorola 68000 programming reference. It consists a table containing useful examples of the 68k instructions, and it can be a very nice tool for everyone who is hacking MegaDrive / Genesis games in a hex editor. For your help and confort, the parameters in the ASM commands have been coloured along with their respective places in the 16-bit instruction codes. |
Revision as of 13:57, 11 April 2018
It has been suggested that this page be moved over to Sega Retro as to be in accordance with both sites' policies. Please see the talk page for relevant discussion and export procedure. |
(Document originally by Ambil)
Welcome to my Motorola 68000 programming reference. It consists a table containing useful examples of the 68k instructions, and it can be a very nice tool for everyone who is hacking MegaDrive / Genesis games in a hex editor. For your help and confort, the parameters in the ASM commands have been coloured along with their respective places in the 16-bit instruction codes.
ASM | Binary instruction | Hex code |
---|---|---|
adda.w (a0), a1 | 1101 0010 1101 0000 | D2D0 |
adda.w ($FFFFF100).w, a1 | 1101 0010 1111 1000 | D2F8 F100 |
adda.l ($FFFFF100).l, a1 | 1101 0011 1111 1001 | D3F9 F100 |
adda.w #$1337, a1 | 1101 0010 1111 1100 | D2FC 1337 |
addi.b #$20, d1 | 0000 0110 0000 0001 | 0601 0020 |
addi.w #$1337, ($FFFFF100).w | 0000 0110 0111 1000 | 0678 1337 F100 |
addi.l #$19650917, ($FFFFF100).l | 0000 0110 1011 1001 | 06F9 1965 0917 F100 |
addq.b #1, ($FFFFF100).w | 0101 0010 0011 1000 | 5238 F100 |
addq.b #2, ($FFFFF100).w | 0101 0100 0011 1000 | 5438 F100 |
addq.b #8, ($FFFFF100).w | 0101 0000 0011 1000 | 5038 F100 |
andi.b #$36, d1 | 0000 0010 0000 0001 | 0201 0036 |
andi.w #$2005, ($FFFFF100).w | 0000 0010 0111 1000 | 0238 2005 F100 |
andi #$FFFE,sr | 0000 0010 0111 1100 | 027C FFFE |
bra.s #$24 | 0110 0000 0010 0100 | 6024 |
bra.w #$4E1A | 0110 0000 0000 0000 | 6000 4E1A |
bsr.s #$10 | 0110 0001 0001 0000 | 6110 |
bhi.s #$10 | 0110 0010 0001 0000 | 6210 |
bls.s #$10 | 0110 0011 0001 0000 | 6310 |
bcc.s #$10 | 0110 0100 0001 0000 | 6410 |
bcs.s #$10 | 0110 0101 0001 0000 | 6510 |
bne.s #$10 | 0110 0110 0001 0000 | 6610 |
beq.s #$10 | 0110 0111 0001 0000 | 6710 |
bvc.s #$10 | 0110 1000 0001 0000 | 6810 |
bvs.s #$10 | 0110 1001 0001 0000 | 6910 |
bpl.s #$10 | 0110 1010 0001 0000 | 6A10 |
bmi.s #$10 | 0110 1011 0001 0000 | 6B10 |
bge.s #$10 | 0110 1100 0001 0000 | 6C10 |
blt.s #$10 | 0110 1101 0001 0000 | 6D10 |
bgt.s #$10 | 0110 1110 0001 0000 | 6E10 |
ble.s #$10 | 0110 1111 0001 0000 | 6F10 |
clr.l d0 | 0100 0010 1000 0000 | 4280 |
clr.w ($FFFF8500).w | 0100 0010 0111 1000 | 4278 8500 |
cmpi.b #$26, ($FFFFFFE4).w | 0000 1100 0011 1000 | 0C38 0026 FFE4 |
cmpi.w #$4170, ($FFFFFFB0).w | 0000 1100 0111 1000 | 0C78 4170 FFB0 |
cmpi.l #$0, d2 | 0000 1100 1000 0010 | 0C82 0000 0000 |
dbf d0, $556A | 0101 0001 1100 0000 | 51C0 556A |
divs.w #$A, d0 | 1000 0001 1111 1100 | 81FC 000A |
divu.w ($FFFFF314).w, d1 | 1000 0010 1111 1000 | 82F8 F314 |
eori.b #$80, ($FFFFF00E).w | 0000 1010 0011 1000 | 0A38 0080 F00E |
eori.w #$3119, ($FFFFF010).w | 0000 1010 0111 1000 | 0A78 3119 F010 |
eori.l #$FFFF, (a0) | 0000 1010 1001 0000 | 0A90 FFFF |
eori #$0001,sr | 0000 1010 0111 1100 | 0A7C 0001 |
exg d1, d2 | 1100 0011 0100 0010 | C342 |
exg a3, a4 | 1100 0111 0100 1100 | C74C |
exg d5, a6 | 1100 1011 1000 1110 | CB8E |
ext.w d0 | 0100 1000 1000 0000 | 4880 |
ext.l d1 | 0100 1000 1100 0001 | 48C1 |
illegal | 0100 1010 1111 1100 | 4AFC |
jmp (a1) | 0100 1110 1100 0001 | 4EA1 |
jmp $65A70 | 0100 1110 1111 1001 | 4EF9 0006 5A70 |
jsr $4B98C | 0100 1110 1011 1001 | 4EB9 0004 B98C |
lea ($FFFFFFF4).w, a0 | 0100 0001 1111 1000 | 41F8 FFF4 |
link a4, #$1087 | 0100 1110 0101 0100 | 4E54 1087 |
lsl.b #1, d0 | 1110 0011 0000 1001 | E309 |
lsr.w d2, d1 | 1110 0100 0110 1010 | E54A |
move.b #$64, ($FFFFFFE0).w | 0001 0001 1111 1100 | 11FC 0064 FFE0 |
move.w #$03E8, ($FFFFFFE0).w | 0011 0001 1111 1100 | 31FC 03E8 FFE0 |
move.l #$05F5E100, ($FFFFFFE0).l | 0010 0001 1111 1100 | 21FC 05F5 E100 FFE0 |
move.b #$20, d1 | 0001 0010 0011 1100 | 123C 0020 |
move.w ($FFFF01A5).w, ($FFFFFFE0).w | 0011 0011 1111 1001 | 33F9 01A5 FFE0 |
move.l d1, ($FFFFFFE0).w | 0010 0011 1100 0001 | 23C1 FFE0 |
movea.w #$6000, a4 | 0011 1000 0111 1100 | 387C 6000 |
moveq #$80, d1 | 0111 0010 1000 0000 | 7280 |
muls.w #$19, d1 | 1100 0011 1111 1100 | E3FC 0019 |
mulu.w #$19, d2 | 1100 0100 1111 1100 | E4FC 0019 |
neg.w ($FFFFFE26).w | 0100 0100 0111 1000 | 4478 FE26 |
neg.l d0 | 0100 0100 1000 0000 | 4480 |
nop | 0100 1110 0111 0001 | 4E71 |
not.w ($FFFFFE26).w | 0100 0110 0111 1000 | 4678 FE26 |
not.l d0 | 0100 0110 1000 0000 | 4680 |
ori.b #$36, d1 | 0000 0000 0000 0001 | 0001 0036 |
ori.w #$2005, ($FFFFF100).w | 0000 0000 0111 1000 | 0074 2005 F100 |
ori #$0001,sr | 0000 0000 0111 1100 | 007C 0001 |
pea ($FFFFE53C).w | 0100 1000 0111 1000 | 4878 E53C |
rol.w d0, d1 | 1110 0001 0111 1001 | E1E9 |
ror.l #1, d3 | 1110 0010 1001 1011 | E6EA |
rol.w ($FFFFFFE0).w | 1110 0111 1111 1000 | E7F8 FFE0 |
rte | 0100 1110 0111 0011 | 4E73 |
rtr | 0100 1110 0111 0111 | 4E77 |
rts | 0100 1110 0111 0101 | 4E75 |
st ($FFFFF000).w | 0101 0000 1111 1000 | 50F0 F000 |
sf ($FFFFF000).w | 0101 0001 1111 1000 | 51F0 F000 |
shi ($FFFFF000).w | 0101 0010 1111 1000 | 52F0 F000 |
sls ($FFFFF000).w | 0101 0011 1111 1000 | 53F0 F000 |
scc ($FFFFF000).w | 0101 0100 1111 1000 | 54F0 F000 |
scs ($FFFFF000).w | 0101 0101 1111 1000 | 55F0 F000 |
sne ($FFFFF000).w | 0101 0110 1111 1000 | 56F0 F000 |
seq ($FFFFF000).w | 0101 0111 1111 1000 | 57F0 F000 |
svc ($FFFFF000).w | 0101 1000 1111 1000 | 58F0 F000 |
svs ($FFFFF000).w | 0101 1001 1111 1000 | 59F0 F000 |
spl ($FFFFF000).w | 0101 1010 1111 1000 | 5AF0 F000 |
smi ($FFFFF000).w | 0101 1011 1111 1000 | 5BF0 F000 |
sge ($FFFFF000).w | 0101 1100 1111 1000 | 5CF0 F000 |
slt ($FFFFF000).w | 0101 1101 1111 1000 | 5DF0 F000 |
sgt ($FFFFF000).w | 0101 1110 1111 1000 | 5EF0 F000 |
sle ($FFFFF000).w | 0101 1111 1111 1000 | 5FF0 F000 |
stop #$2500 | 0100 1110 0111 0010 | 4E72 2500 |
suba.w (a0), a1 | 1101 0010 1101 0001 | D2D1 |
suba.w ($FFFFF100).w, a2 | 1101 0100 1111 1000 | D2F8 F100 |
suba.l ($FFFFF100).l, a3 | 1001 1011 1111 1001 | D3F9 F100 |
suba.w #$1337, a4 | 1001 1100 1111 1100 | D2FC 1337 |
subi.b #$20, d1 | 0000 0100 0000 0001 | 0601 0020 |
subi.w #$1337, ($FFFFF100).w | 0000 0100 0111 1000 | 0678 1337 F100 |
subi.l #$19650917, ($FFFFF100).l | 0000 0100 1111 1001 | 06F9 1965 0917 F100 |
subq.b #1, ($FFFFF100).w | 0101 0011 0011 1000 | 5338 F100 |
subq.b #2, ($FFFFF100).w | 0101 0101 0011 1000 | 5538 F100 |
subq.b #8, ($FFFFF100).w | 0101 0001 0011 1000 | 5138 F100 |
swap d0 | 0100 1000 0100 0000 | 4840 |
tas.b ($FFFFFE00).w | 0100 1010 1111 1000 | 4AF8 FE00 |
trap #1 | 0100 1110 0100 0001 | 4E41 |
trapv | 0100 1110 0111 0110 | 4E76 |
tst.ld1 | 0100 1010 1000 0001 | 4A81 |
tst.w ($FFFFAA80).w | 0100 1010 0111 1000 | 4A78 AA80 |
tst.b ($FFFFAA80).w | 0100 1010 0011 1000 | 4A38 AA80 |
unlk a0 | 0100 1110 0101 1000 | 4E58 |