Refine opcode 8080 table

This commit is contained in:
Nero 2019-10-25 13:14:15 +00:00
parent ad8a347d7d
commit 757a811988

View File

@ -9,18 +9,38 @@
; 0x00 none
; 0x1n reg8, opcode |= (reg8 << n)
; 0x2n reg16, opcode |= (reg8 << n)
; 0x3n 3-bit number, opcode |= (num << n)
; 0x3n reg16b, opcode |= (reg8 << n)
; 0x7n 3-bit number, opcode |= (num << n)
; 0x80 imm8, encoded as extra byte
; 0x81 imm16, encoded as extra word
reg8:
db "B",0,"C",0,"D",0,"E",0,"H",0,"L",0,"M",0
reg16:
db "BC", "DE", "HL", "SP"
registers:
.reg8:
db "B", 0
db "C", 0
db "D", 0
db "E", 0
db "H", 0
db "L", 0
db "M", 0
db 0
.reg16:
db "BC", 0
db "DE", 0
db "HL", 0
db "SP", 0
db 0
.reg16b:
db "BC", 0
db "DE", 0
db "HL", 0
db "AF", 0
db 0
.end:
db 0
opcodes:
; Data movement
; Data movement
db 3, "MOV", 0b01000000, 0x13, 0x10
db 3, "MVI", 0b00000110, 0x13, 0x80
db 3, "LXI", 0b00000001, 0x24, 0x81
@ -32,7 +52,7 @@ opcodes:
db 4, "STAX", 0b00000010, 0x24, 0x00
db 4, "XCHG", 0b11101011, 0x00, 0x00
; Addition / Subtraction
; Addition / Subtraction
db 3, "ADD", 0b10000000, 0x10, 0x00
db 3, "ADI", 0b11000110, 0x80, 0x00
db 3, "ADC", 0b10001000, 0x10, 0x00
@ -47,10 +67,10 @@ opcodes:
db 3, "DCX", 0b00001011, 0x24, 0x00
db 3, "DAD", 0b00001001, 0x24, 0x00
; BCD
; BCD
db 3, "DAA", 0b00100111, 0x00, 0x00
; Bitwise operations
; Bitwise operations
db 3, "ANA", 0b10100000, 0x10, 0x00
db 3, "ANI", 0b11100110, 0x80, 0x00
db 3, "ORA", 0b10110000, 0x10, 0x00
@ -60,18 +80,18 @@ opcodes:
db 3, "CMP", 0b10111000, 0x10, 0x00
db 3, "CPI", 0b11111110, 0x80, 0x00
; Rotate
; Rotate
db 3, "RLC", 0b00000111, 0x00, 0x00
db 3, "RRC", 0b00001111, 0x00, 0x00
db 3, "RAL", 0b00010111, 0x00, 0x00
db 3, "RAR", 0b00011111, 0x00, 0x00
; Complement
; Complement
db 3, "CMA", 0b00101111, 0x00, 0x00
db 3, "CMC", 0b00111111, 0x00, 0x00
db 3, "STC", 0b00110111, 0x00, 0x00
; Jump
; Jump
db 3, "JMP", 0b11000011, 0x81, 0x00
db 3, "JNZ", 0b11000010, 0x81, 0x00
db 2, "JZ", 0b11001010, 0x81, 0x00
@ -82,7 +102,7 @@ opcodes:
db 2, "JP", 0b11110010, 0x81, 0x00
db 2, "JM", 0b11111010, 0x81, 0x00
; Call
; Call
db 4, "CALL", 0b11001101, 0x81, 0x00
db 3, "CNZ", 0b11000100, 0x81, 0x00
db 2, "CZ", 0b11001100, 0x81, 0x00
@ -93,7 +113,7 @@ opcodes:
db 2, "CP", 0b11110100, 0x81, 0x00
db 2, "CM", 0b11111100, 0x81, 0x00
; Return
; Return
db 3, "RET", 0b11001001, 0x00, 0x00
db 3, "RNZ", 0b11000000, 0x00, 0x00
db 2, "RZ", 0b11001000, 0x00, 0x00
@ -104,10 +124,10 @@ opcodes:
db 2, "RP", 0b11110000, 0x00, 0x00
db 2, "RM", 0b11111000, 0x00, 0x00
db 3, "RST", 0b11000111, 0x33, 0x00
db 3, "RST", 0b11000111, 0x73, 0x00
db 4, "PCHL", 0b11101001, 0x00, 0x00
db 4, "PUSH", 0b11000101, 0x24, 0x00
db 3, "POP", 0b11000001, 0x24, 0x00
db 4, "PUSH", 0b11000101, 0x34, 0x00
db 3, "POP", 0b11000001, 0x34, 0x00
db 4, "XTHL", 0b11100011, 0x00, 0x00
db 4, "SPHL", 0b11111001, 0x00, 0x00