Implement more of Z80.

This commit is contained in:
Jeff Tranter 2015-07-01 23:15:22 -04:00
parent b1503028d2
commit 5cd1028fd9

76
z80.py
View File

@ -42,7 +42,9 @@ addressModeTable = {
"a,d" : "a,d",
"a,e" : "a,e",
"a,h" : "a,h",
"a,i" : "a,i",
"a,l" : "a,l",
"a,r" : "a,r",
"b,a" : "b,a",
"b,b" : "b,b",
"b,c" : "b,c",
@ -78,6 +80,7 @@ addressModeTable = {
"h,e" : "h,e",
"h,h" : "h,h",
"h,l" : "h,l",
"i,a" : "i,a",
"l,b" : "l,b",
"l,a" : "l,a",
"l,c" : "l,c",
@ -85,6 +88,7 @@ addressModeTable = {
"l,e" : "l,e",
"l,h" : "l,h",
"l,l" : "l,l",
"r,a" : "r,a",
"af,af" : "af,af",
"hl,bc" : "hl,bc",
"hl,de" : "hl,bc",
@ -96,6 +100,9 @@ addressModeTable = {
"iy,bc" : "iy,bc",
"bc,nn" : "bc,${1:02X}{0:02X}",
"de,nn" : "de,${1:02X}{0:02X}",
"bc,indaa" : "bc,(${1:02X}{0:02X})",
"de,indaa" : "de,(${1:02X}{0:02X})",
"sp,indaa" : "sp,(${1:02X}{0:02X})",
"hl,nn" : "hl,${1:02X}{0:02X}",
"sp,nn" : "sp,${1:02X}{0:02X}",
"c,nn" : "c,${1:02X}{0:02X}",
@ -104,9 +111,12 @@ addressModeTable = {
"indn,a" : "(${0:02X}),a",
"indhl,n" : "(hl),(${0:02X})",
"a,indnn" : "a,(${1:02X}{0:02X})",
"a,indc" : "a,(c)",
"a,indn" : "a,(${0:02X})",
"indnn,a" : "(${1:02X}{0:02X}),a",
"indaa,bc" : "(${1:02X}{0:02X}),bc",
"indaa,de" : "(${1:02X}{0:02X}),de",
"indaa,sp" : "(${1:02X}{0:02X}),sp",
"hl,indnn" : "hl,(${1:02X}{0:02X})",
"indbc,a" : "(bc),a",
"indde,a" : "(de),a",
@ -128,6 +138,11 @@ addressModeTable = {
"e,indhl" : "e,(hl)",
"h,indhl" : "h,(hl)",
"l,indhl" : "l,(hl)",
"l,indc" : "l,(c)",
"c,indc" : "c,(c)",
"d,indc" : "d,(c)",
"e,indc" : "e,(c)",
"h,indc" : "h,(c)",
"n" : "${0:02X}",
"a,n" : "a,${0:02X}",
"b,n" : "b,${0:02X}",
@ -148,7 +163,16 @@ addressModeTable = {
"c,n" : "c,${0:04X}",
"nn" : "${1:02X}{0:02X}",
"b,indc" : "b,(c)",
"indc,a" : "(c),a",
"indc,b" : "(c),b",
"indc,c" : "(c),c",
"indc,d" : "(c),d",
"indc,e" : "(c),e",
"indc,h" : "(c),h",
"indc,l" : "(c),l",
"0" : "0",
"1" : "1",
"2" : "2",
"00" : "$00",
"08" : "$08",
"10" : "$10",
@ -782,8 +806,56 @@ opcodeTable = {
0xed42 : [ 2, "sbc", "hl,bc" ],
0xed43 : [ 4, "ld", "indaa,bc" ],
0xed44 : [ 2, "neg", "implied" ],
0xed45 : [ 2, "retn", "implied" ],
#...
0xed45 : [ 2, "retn", "implied" ],
0xed46 : [ 2, "im", "0" ],
0xed47 : [ 2, "ld", "i,a" ],
0xed48 : [ 2, "in", "c,indc" ],
0xed49 : [ 2, "out", "indc,c" ],
0xed4a : [ 2, "adc", "hl,bc" ],
0xed4b : [ 4, "ld", "bc,indaa" ],
0xed4d : [ 2, "reti", "implied" ],
0xed4f : [ 2, "ld", "r,a" ],
0xed50 : [ 2, "in", "d,indc" ],
0xed51 : [ 2, "out", "indc,d" ],
0xed52 : [ 2, "sbc", "hl,de" ],
0xed53 : [ 4, "ld", "indaa,de" ],
0xed56 : [ 2, "im", "1" ],
0xed57 : [ 2, "ld", "a,i" ],
0xed58 : [ 2, "in", "e,indc" ],
0xed59 : [ 2, "out", "indc,e" ],
0xed5a : [ 2, "adc", "hl,de" ],
0xed5b : [ 4, "ld", "de,indaa" ],
0xed5e : [ 2, "im", "2" ],
0xed5f : [ 2, "ld", "a,r" ],
0xed60 : [ 2, "in", "h,indc" ],
0xed61 : [ 2, "out", "indc,h" ],
0xed62 : [ 2, "sbc", "hl,hl" ],
0xed67 : [ 2, "rrd", "implied" ],
0xed68 : [ 2, "in", "l,indc" ],
0xed69 : [ 2, "out", "indc,l" ],
0xed6a : [ 2, "adc", "hl,hl" ],
0xed6f : [ 2, "rld", "implied" ],
0xed72 : [ 2, "sbc", "hl,sp" ],
0xed73 : [ 4, "ld", "indaa,sp" ],
0xed76 : [ 2, "in", "a,indc" ],
0xed79 : [ 2, "out", "indc,a" ],
0xed7a : [ 2, "adc", "hl,sp" ],
0xed7b : [ 4, "ld", "sp,indaa" ],
0xeda0 : [ 2, "ldi", "implied" ],
0xeda1 : [ 2, "cpi", "implied" ],
0xeda2 : [ 2, "ini", "implied" ],
0xeda3 : [ 2, "outi", "implied" ],
0xeda8 : [ 2, "ldd", "implied" ],
0xeda9 : [ 2, "cpd", "implied" ],
0xedaa : [ 2, "ind", "implied" ],
0xedab : [ 2, "outd", "implied" ],
0xedb0 : [ 2, "ldir", "implied" ],
0xedb1 : [ 2, "cpir", "implied" ],
0xedb2 : [ 2, "inir", "implied" ],
0xedb3 : [ 2, "otir", "implied" ],
0xedb8 : [ 2, "lddr", "implied" ],
0xedb9 : [ 2, "cpdr", "implied" ],
0xedba : [ 2, "indr", "implied" ],
0xedbb : [ 2, "otdr", "implied" ],
0xfd09 : [ 2, "add", "iy,bc" ],