From 5f6b303e75e6c4ad7e65777fc8b4e028f1f75535 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 10 Nov 2019 22:03:18 -0500 Subject: [PATCH] zasm: add IX/IY support to SRL, RR and RL --- apps/zasm/instr.asm | 11 +- tools/tests/zasm/allinstrs.asm | 663 +++++++++++++----------- tools/tests/zasm/allinstrs.asm.expected | Bin 5404 -> 5626 bytes tools/tests/zasm/geninstrs.py | 18 +- 4 files changed, 382 insertions(+), 310 deletions(-) diff --git a/apps/zasm/instr.asm b/apps/zasm/instr.asm index 9c0f9f2..416bcc9 100644 --- a/apps/zasm/instr.asm +++ b/apps/zasm/instr.asm @@ -2,7 +2,7 @@ ; Number of rows in the argspec table .equ ARGSPEC_TBL_CNT 33 ; Number of rows in the primary instructions table -.equ INSTR_TBL_CNT 144 +.equ INSTR_TBL_CNT 147 ; size in bytes of each row in the primary instructions table .equ INSTR_TBL_ROWSIZE 6 ; Instruction IDs They correspond to the index of the table in instrNames @@ -1081,7 +1081,7 @@ instrTBl: .db I_AND, 0xb, 0, 0, 0b10100000 , 0 ; AND r .db I_AND, 'n', 0, 0, 0xe6 , 0 ; AND n .db I_BIT, 0xc, 'l', 0x53, 0xcb, 0b01000110 ; BIT b, (HL) + (IX/Y) - .db I_BIT, 'n', 0xb, 0x20 \ .dw handleBITR ; BIT b, r + .db I_BIT, 0xc, 0xb, 0x20 \ .dw handleBITR ; BIT b, r .db I_CALL,0xa, 'N', 3, 0b11000100 , 0 ; CALL cc, NN .db I_CALL,'N', 0, 0, 0xcd , 0 ; CALL NN .db I_CCF, 0, 0, 0, 0x3f , 0 ; CCF @@ -1184,16 +1184,18 @@ instrTBl: .db I_PUSH,'Y', 0, 0, 0xfd, 0xe5 ; PUSH IY .db I_PUSH,0x1, 0, 4, 0b11000101 , 0 ; PUSH qq .db I_RES, 0xc, 'l', 0x53, 0xcb, 0b10000110 ; RES b, (HL) + (IX/Y) - .db I_RES, 'n', 0xb, 0x20 \ .dw handleRESR ; RES b, r + .db I_RES, 0xc, 0xb, 0x20 \ .dw handleRESR ; RES b, r .db I_RET, 0, 0, 0, 0xc9 , 0 ; RET .db I_RET, 0xa, 0, 3, 0b11000000 , 0 ; RET cc .db I_RETI,0, 0, 0, 0xed, 0x4d ; RETI .db I_RETN,0, 0, 0, 0xed, 0x45 ; RETN .db I_RL, 0xb, 0,0x40, 0xcb, 0b00010000 ; RL r + .db I_RL, 'l', 0,0x10, 0xcb, 0b00010110 ; RL (HL) + (IX/Y) .db I_RLA, 0, 0, 0, 0x17 , 0 ; RLA .db I_RLC, 0xb, 0,0x40, 0xcb, 0b00000000 ; RLC r .db I_RLCA,0, 0, 0, 0x07 , 0 ; RLCA .db I_RR, 0xb, 0,0x40, 0xcb, 0b00011000 ; RR r + .db I_RR, 'l', 0,0x10, 0xcb, 0b00011110 ; RR (HL) + (IX/Y) .db I_RRA, 0, 0, 0, 0x1f , 0 ; RRA .db I_RRC, 0xb, 0,0x40, 0xcb, 0b00001000 ; RRC r .db I_RRCA,0, 0, 0, 0x0f , 0 ; RRCA @@ -1202,9 +1204,10 @@ instrTBl: .db I_SBC,'h',0x3,0x44, 0xed, 0b01000010 ; SBC HL, ss .db I_SCF, 0, 0, 0, 0x37 , 0 ; SCF .db I_SET, 0xc, 'l', 0x53, 0xcb, 0b11000110 ; SET b, (HL) + (IX/Y) - .db I_SET, 'n', 0xb, 0x20 \ .dw handleSETR ; SET b, r + .db I_SET, 0xc, 0xb, 0x20 \ .dw handleSETR ; SET b, r .db I_SLA, 0xb, 0,0x40, 0xcb, 0b00100000 ; SLA r .db I_SRL, 0xb, 0,0x40, 0xcb, 0b00111000 ; SRL r + .db I_SRL, 'l', 0,0x10, 0xcb, 0b00111110 ; SRL (HL) + (IX/Y) .db I_SUB, 'l', 0, 0, 0x96 , 0 ; SUB (HL) .db I_SUB, 0xb, 0, 0, 0b10010000 , 0 ; SUB r .db I_SUB, 'n', 0, 0, 0xd6 , 0 ; SUB n diff --git a/tools/tests/zasm/allinstrs.asm b/tools/tests/zasm/allinstrs.asm index de3e592..ffb880b 100644 --- a/tools/tests/zasm/allinstrs.asm +++ b/tools/tests/zasm/allinstrs.asm @@ -19,6 +19,24 @@ ADC HL, DE ADC HL, HL ADC HL, SP ADD A, (HL) +ADD A, (IX) +ADD A, (IX+1) +ADD A, (IX-1) +ADD A, (IX+10) +ADD A, (IX-10) +ADD A, (IX+100) +ADD A, (IX-100) +ADD A, (IX+127) +ADD A, (IX-127) +ADD A, (IY) +ADD A, (IY+1) +ADD A, (IY-1) +ADD A, (IY+10) +ADD A, (IY-10) +ADD A, (IY+100) +ADD A, (IY-100) +ADD A, (IY+127) +ADD A, (IY-127) ADD A, B ADD A, C ADD A, D @@ -46,40 +64,7 @@ ADD IY, BC ADD IY, DE ADD IY, IY ADD IY, SP -ADD A, (IX) -ADD A, (IX+1) -ADD A, (IX-1) -ADD A, (IX+10) -ADD A, (IX-10) -ADD A, (IX+100) -ADD A, (IX-100) -ADD A, (IX+127) -ADD A, (IX-127) -ADD A, (IY) -ADD A, (IY+1) -ADD A, (IY-1) -ADD A, (IY+10) -ADD A, (IY-10) -ADD A, (IY+100) -ADD A, (IY-100) -ADD A, (IY+127) -ADD A, (IY-127) AND (HL) -AND B -AND C -AND D -AND E -AND H -AND L -AND A -AND 1 -AND 2 -AND 4 -AND 8 -AND 16 -AND 32 -AND 64 -AND 128 AND (IX+1) AND (IX-1) AND (IX+10) @@ -96,84 +81,99 @@ AND (IY+100) AND (IY-100) AND (IY+127) AND (IY-127) -BIT 1, (HL) -BIT 2, (HL) -BIT 4, (HL) -BIT 1, (IX) -BIT 1, (IX+1) -BIT 1, (IX-1) -BIT 1, (IX+10) -BIT 1, (IX-10) -BIT 1, (IX+100) -BIT 1, (IX-100) -BIT 1, (IX+127) -BIT 1, (IX-127) -BIT 2, (IX) -BIT 2, (IX+1) -BIT 2, (IX-1) -BIT 2, (IX+10) -BIT 2, (IX-10) -BIT 2, (IX+100) -BIT 2, (IX-100) -BIT 2, (IX+127) -BIT 2, (IX-127) -BIT 4, (IX) -BIT 4, (IX+1) -BIT 4, (IX-1) -BIT 4, (IX+10) -BIT 4, (IX-10) -BIT 4, (IX+100) -BIT 4, (IX-100) -BIT 4, (IX+127) -BIT 4, (IX-127) -BIT 1, (IY) -BIT 1, (IY+1) -BIT 1, (IY-1) -BIT 1, (IY+10) -BIT 1, (IY-10) -BIT 1, (IY+100) -BIT 1, (IY-100) -BIT 1, (IY+127) -BIT 1, (IY-127) -BIT 2, (IY) -BIT 2, (IY+1) -BIT 2, (IY-1) -BIT 2, (IY+10) -BIT 2, (IY-10) -BIT 2, (IY+100) -BIT 2, (IY-100) -BIT 2, (IY+127) -BIT 2, (IY-127) -BIT 4, (IY) -BIT 4, (IY+1) -BIT 4, (IY-1) -BIT 4, (IY+10) -BIT 4, (IY-10) -BIT 4, (IY+100) -BIT 4, (IY-100) -BIT 4, (IY+127) -BIT 4, (IY-127) -BIT 1, B -BIT 1, C -BIT 1, D -BIT 1, E -BIT 1, H -BIT 1, L -BIT 1, A -BIT 2, B -BIT 2, C -BIT 2, D -BIT 2, E -BIT 2, H -BIT 2, L -BIT 2, A -BIT 4, B -BIT 4, C -BIT 4, D -BIT 4, E -BIT 4, H -BIT 4, L -BIT 4, A +AND B +AND C +AND D +AND E +AND H +AND L +AND A +AND 1 +AND 2 +AND 4 +AND 8 +AND 16 +AND 32 +AND 64 +AND 128 +BIT 0, (HL) +BIT 0, (IX) +BIT 0, (IX+1) +BIT 0, (IX-1) +BIT 0, (IX+10) +BIT 0, (IX-10) +BIT 0, (IX+100) +BIT 0, (IX-100) +BIT 0, (IX+127) +BIT 0, (IX-127) +BIT 0, (IY) +BIT 0, (IY+1) +BIT 0, (IY-1) +BIT 0, (IY+10) +BIT 0, (IY-10) +BIT 0, (IY+100) +BIT 0, (IY-100) +BIT 0, (IY+127) +BIT 0, (IY-127) +BIT 3, (HL) +BIT 3, (IX) +BIT 3, (IX+1) +BIT 3, (IX-1) +BIT 3, (IX+10) +BIT 3, (IX-10) +BIT 3, (IX+100) +BIT 3, (IX-100) +BIT 3, (IX+127) +BIT 3, (IX-127) +BIT 3, (IY) +BIT 3, (IY+1) +BIT 3, (IY-1) +BIT 3, (IY+10) +BIT 3, (IY-10) +BIT 3, (IY+100) +BIT 3, (IY-100) +BIT 3, (IY+127) +BIT 3, (IY-127) +BIT 7, (HL) +BIT 7, (IX) +BIT 7, (IX+1) +BIT 7, (IX-1) +BIT 7, (IX+10) +BIT 7, (IX-10) +BIT 7, (IX+100) +BIT 7, (IX-100) +BIT 7, (IX+127) +BIT 7, (IX-127) +BIT 7, (IY) +BIT 7, (IY+1) +BIT 7, (IY-1) +BIT 7, (IY+10) +BIT 7, (IY-10) +BIT 7, (IY+100) +BIT 7, (IY-100) +BIT 7, (IY+127) +BIT 7, (IY-127) +BIT 0, B +BIT 0, C +BIT 0, D +BIT 0, E +BIT 0, H +BIT 0, L +BIT 0, A +BIT 3, B +BIT 3, C +BIT 3, D +BIT 3, E +BIT 3, H +BIT 3, L +BIT 3, A +BIT 7, B +BIT 7, C +BIT 7, D +BIT 7, E +BIT 7, H +BIT 7, L +BIT 7, A CALL Z, 1 CALL Z, 2 CALL Z, 4 @@ -320,21 +320,6 @@ CALL 16384 CALL 32768 CCF CP (HL) -CP B -CP C -CP D -CP E -CP H -CP L -CP A -CP 1 -CP 2 -CP 4 -CP 8 -CP 16 -CP 32 -CP 64 -CP 128 CP (IX) CP (IX+1) CP (IX-1) @@ -353,6 +338,21 @@ CP (IY+100) CP (IY-100) CP (IY+127) CP (IY-127) +CP B +CP C +CP D +CP E +CP H +CP L +CP A +CP 1 +CP 2 +CP 4 +CP 8 +CP 16 +CP 32 +CP 64 +CP 128 CPD CPDR CPI @@ -360,7 +360,6 @@ CPIR CPL DAA DEC (HL) -DEC IX DEC (IX) DEC (IX+1) DEC (IX-1) @@ -370,7 +369,6 @@ DEC (IX+100) DEC (IX-100) DEC (IX+127) DEC (IX-127) -DEC IY DEC (IY) DEC (IY+1) DEC (IY-1) @@ -380,6 +378,8 @@ DEC (IY+100) DEC (IY-100) DEC (IY+127) DEC (IY-127) +DEC IX +DEC IY DEC B DEC C DEC D @@ -433,7 +433,6 @@ IN H, (C) IN L, (C) IN A, (C) INC (HL) -INC IX INC (IX) INC (IX+1) INC (IX-1) @@ -443,7 +442,6 @@ INC (IX+100) INC (IX-100) INC (IX+127) INC (IX-127) -INC IY INC (IY) INC (IY+1) INC (IY-1) @@ -453,6 +451,8 @@ INC (IY+100) INC (IY-100) INC (IY+127) INC (IY-127) +INC IX +INC IY INC B INC C INC D @@ -468,6 +468,8 @@ IND INDR INI INIR +JP (IX) +JP (IY) JP (HL) JP Z, 1 JP Z, 2 @@ -613,8 +615,6 @@ JP 4096 JP 8192 JP 16384 JP 32768 -JP (IX) -JP (IY) JR $+1 JR $+2 JR $+4 @@ -1576,21 +1576,6 @@ LDIR NEG NOP OR (HL) -OR B -OR C -OR D -OR E -OR H -OR L -OR A -OR 1 -OR 2 -OR 4 -OR 8 -OR 16 -OR 32 -OR 64 -OR 128 OR (IX) OR (IX+1) OR (IX-1) @@ -1609,6 +1594,21 @@ OR (IY+100) OR (IY-100) OR (IY+127) OR (IY-127) +OR B +OR C +OR D +OR E +OR H +OR L +OR A +OR 1 +OR 2 +OR 4 +OR 8 +OR 16 +OR 32 +OR 64 +OR 128 OTDR OTIR OUT (1), A @@ -1638,84 +1638,84 @@ PUSH BC PUSH DE PUSH HL PUSH AF -RES 1, (HL) -RES 2, (HL) -RES 4, (HL) -RES 1, (IX) -RES 1, (IX+1) -RES 1, (IX-1) -RES 1, (IX+10) -RES 1, (IX-10) -RES 1, (IX+100) -RES 1, (IX-100) -RES 1, (IX+127) -RES 1, (IX-127) -RES 2, (IX) -RES 2, (IX+1) -RES 2, (IX-1) -RES 2, (IX+10) -RES 2, (IX-10) -RES 2, (IX+100) -RES 2, (IX-100) -RES 2, (IX+127) -RES 2, (IX-127) -RES 4, (IX) -RES 4, (IX+1) -RES 4, (IX-1) -RES 4, (IX+10) -RES 4, (IX-10) -RES 4, (IX+100) -RES 4, (IX-100) -RES 4, (IX+127) -RES 4, (IX-127) -RES 1, (IY) -RES 1, (IY+1) -RES 1, (IY-1) -RES 1, (IY+10) -RES 1, (IY-10) -RES 1, (IY+100) -RES 1, (IY-100) -RES 1, (IY+127) -RES 1, (IY-127) -RES 2, (IY) -RES 2, (IY+1) -RES 2, (IY-1) -RES 2, (IY+10) -RES 2, (IY-10) -RES 2, (IY+100) -RES 2, (IY-100) -RES 2, (IY+127) -RES 2, (IY-127) -RES 4, (IY) -RES 4, (IY+1) -RES 4, (IY-1) -RES 4, (IY+10) -RES 4, (IY-10) -RES 4, (IY+100) -RES 4, (IY-100) -RES 4, (IY+127) -RES 4, (IY-127) -RES 1, B -RES 1, C -RES 1, D -RES 1, E -RES 1, H -RES 1, L -RES 1, A -RES 2, B -RES 2, C -RES 2, D -RES 2, E -RES 2, H -RES 2, L -RES 2, A -RES 4, B -RES 4, C -RES 4, D -RES 4, E -RES 4, H -RES 4, L -RES 4, A +RES 0, (HL) +RES 0, (IX) +RES 0, (IX+1) +RES 0, (IX-1) +RES 0, (IX+10) +RES 0, (IX-10) +RES 0, (IX+100) +RES 0, (IX-100) +RES 0, (IX+127) +RES 0, (IX-127) +RES 0, (IY) +RES 0, (IY+1) +RES 0, (IY-1) +RES 0, (IY+10) +RES 0, (IY-10) +RES 0, (IY+100) +RES 0, (IY-100) +RES 0, (IY+127) +RES 0, (IY-127) +RES 3, (HL) +RES 3, (IX) +RES 3, (IX+1) +RES 3, (IX-1) +RES 3, (IX+10) +RES 3, (IX-10) +RES 3, (IX+100) +RES 3, (IX-100) +RES 3, (IX+127) +RES 3, (IX-127) +RES 3, (IY) +RES 3, (IY+1) +RES 3, (IY-1) +RES 3, (IY+10) +RES 3, (IY-10) +RES 3, (IY+100) +RES 3, (IY-100) +RES 3, (IY+127) +RES 3, (IY-127) +RES 7, (HL) +RES 7, (IX) +RES 7, (IX+1) +RES 7, (IX-1) +RES 7, (IX+10) +RES 7, (IX-10) +RES 7, (IX+100) +RES 7, (IX-100) +RES 7, (IX+127) +RES 7, (IX-127) +RES 7, (IY) +RES 7, (IY+1) +RES 7, (IY-1) +RES 7, (IY+10) +RES 7, (IY-10) +RES 7, (IY+100) +RES 7, (IY-100) +RES 7, (IY+127) +RES 7, (IY-127) +RES 0, B +RES 0, C +RES 0, D +RES 0, E +RES 0, H +RES 0, L +RES 0, A +RES 3, B +RES 3, C +RES 3, D +RES 3, E +RES 3, H +RES 3, L +RES 3, A +RES 7, B +RES 7, C +RES 7, D +RES 7, E +RES 7, H +RES 7, L +RES 7, A RET RET Z RET NZ @@ -1734,6 +1734,25 @@ RL E RL H RL L RL A +RL (HL) +RL (IX) +RL (IX+1) +RL (IX-1) +RL (IX+10) +RL (IX-10) +RL (IX+100) +RL (IX-100) +RL (IX+127) +RL (IX-127) +RL (IY) +RL (IY+1) +RL (IY-1) +RL (IY+10) +RL (IY-10) +RL (IY+100) +RL (IY-100) +RL (IY+127) +RL (IY-127) RLA RLC B RLC C @@ -1750,6 +1769,25 @@ RR E RR H RR L RR A +RR (HL) +RR (IX) +RR (IX+1) +RR (IX-1) +RR (IX+10) +RR (IX-10) +RR (IX+100) +RR (IX-100) +RR (IX+127) +RR (IX-127) +RR (IY) +RR (IY+1) +RR (IY-1) +RR (IY+10) +RR (IY-10) +RR (IY+100) +RR (IY-100) +RR (IY+127) +RR (IY-127) RRA RRC B RRC C @@ -1772,84 +1810,84 @@ SBC HL, DE SBC HL, HL SBC HL, SP SCF -SET 1, (HL) -SET 2, (HL) -SET 4, (HL) -SET 1, (IX) -SET 1, (IX+1) -SET 1, (IX-1) -SET 1, (IX+10) -SET 1, (IX-10) -SET 1, (IX+100) -SET 1, (IX-100) -SET 1, (IX+127) -SET 1, (IX-127) -SET 2, (IX) -SET 2, (IX+1) -SET 2, (IX-1) -SET 2, (IX+10) -SET 2, (IX-10) -SET 2, (IX+100) -SET 2, (IX-100) -SET 2, (IX+127) -SET 2, (IX-127) -SET 4, (IX) -SET 4, (IX+1) -SET 4, (IX-1) -SET 4, (IX+10) -SET 4, (IX-10) -SET 4, (IX+100) -SET 4, (IX-100) -SET 4, (IX+127) -SET 4, (IX-127) -SET 1, (IY) -SET 1, (IY+1) -SET 1, (IY-1) -SET 1, (IY+10) -SET 1, (IY-10) -SET 1, (IY+100) -SET 1, (IY-100) -SET 1, (IY+127) -SET 1, (IY-127) -SET 2, (IY) -SET 2, (IY+1) -SET 2, (IY-1) -SET 2, (IY+10) -SET 2, (IY-10) -SET 2, (IY+100) -SET 2, (IY-100) -SET 2, (IY+127) -SET 2, (IY-127) -SET 4, (IY) -SET 4, (IY+1) -SET 4, (IY-1) -SET 4, (IY+10) -SET 4, (IY-10) -SET 4, (IY+100) -SET 4, (IY-100) -SET 4, (IY+127) -SET 4, (IY-127) -SET 1, B -SET 1, C -SET 1, D -SET 1, E -SET 1, H -SET 1, L -SET 1, A -SET 2, B -SET 2, C -SET 2, D -SET 2, E -SET 2, H -SET 2, L -SET 2, A -SET 4, B -SET 4, C -SET 4, D -SET 4, E -SET 4, H -SET 4, L -SET 4, A +SET 0, (HL) +SET 0, (IX) +SET 0, (IX+1) +SET 0, (IX-1) +SET 0, (IX+10) +SET 0, (IX-10) +SET 0, (IX+100) +SET 0, (IX-100) +SET 0, (IX+127) +SET 0, (IX-127) +SET 0, (IY) +SET 0, (IY+1) +SET 0, (IY-1) +SET 0, (IY+10) +SET 0, (IY-10) +SET 0, (IY+100) +SET 0, (IY-100) +SET 0, (IY+127) +SET 0, (IY-127) +SET 3, (HL) +SET 3, (IX) +SET 3, (IX+1) +SET 3, (IX-1) +SET 3, (IX+10) +SET 3, (IX-10) +SET 3, (IX+100) +SET 3, (IX-100) +SET 3, (IX+127) +SET 3, (IX-127) +SET 3, (IY) +SET 3, (IY+1) +SET 3, (IY-1) +SET 3, (IY+10) +SET 3, (IY-10) +SET 3, (IY+100) +SET 3, (IY-100) +SET 3, (IY+127) +SET 3, (IY-127) +SET 7, (HL) +SET 7, (IX) +SET 7, (IX+1) +SET 7, (IX-1) +SET 7, (IX+10) +SET 7, (IX-10) +SET 7, (IX+100) +SET 7, (IX-100) +SET 7, (IX+127) +SET 7, (IX-127) +SET 7, (IY) +SET 7, (IY+1) +SET 7, (IY-1) +SET 7, (IY+10) +SET 7, (IY-10) +SET 7, (IY+100) +SET 7, (IY-100) +SET 7, (IY+127) +SET 7, (IY-127) +SET 0, B +SET 0, C +SET 0, D +SET 0, E +SET 0, H +SET 0, L +SET 0, A +SET 3, B +SET 3, C +SET 3, D +SET 3, E +SET 3, H +SET 3, L +SET 3, A +SET 7, B +SET 7, C +SET 7, D +SET 7, E +SET 7, H +SET 7, L +SET 7, A SLA B SLA C SLA D @@ -1864,6 +1902,25 @@ SRL E SRL H SRL L SRL A +SRL (HL) +SRL (IX) +SRL (IX+1) +SRL (IX-1) +SRL (IX+10) +SRL (IX-10) +SRL (IX+100) +SRL (IX-100) +SRL (IX+127) +SRL (IX-127) +SRL (IY) +SRL (IY+1) +SRL (IY-1) +SRL (IY+10) +SRL (IY-10) +SRL (IY+100) +SRL (IY-100) +SRL (IY+127) +SRL (IY-127) SUB (HL) SUB B SUB C diff --git a/tools/tests/zasm/allinstrs.asm.expected b/tools/tests/zasm/allinstrs.asm.expected index bc7fdbf8bf2822e425ee9f4b639a54b22d6f5a13..9fe2b1cc964c8c4f3d2ff0a6991862d0777cca58 100644 GIT binary patch delta 1223 zcmWm9%}-rL0EY1noESQ~ph7Sygg|LxB26S|Wn~C{VM6=^YHe{dYwfbF$}p{BT$o7C zMqxz34`NpZY%H_|TU%Vbo5ofBxYylHns~PpZ8>Lry7(oN%$sL2@wtbipA9d(F}^T7 zYQA4s9P?kVtbX(DcWW)v>Sz_Mu2y$zs5RM|(^NwTV31*v;1J;vrYbfSn~F`vreagE zsn}F(DmI#-1cMBV1cx}|NpT1>q+pO?k>C*F5oRAWuJJ-x3FU?996xexYy0|*o4d8C zJL;nDs=Mo_kM+5}(4v+U^`*YjHErqO zwyx`jZfduDr>B2feY^~V42uMZ2#?Um%P`2WNN|Yo2z})zJ%iI4BnN{Giv))Vk1$9M z1{oF!4iO$#3U*rNu642uMZ2#>I*CM6hTSR^<^c!VY;7-ZO{ zC&j@b!Xq?QlY&8pMS??wN2p1`Aj2ZTA;Kfn`dPPhTfgXz?&??F*YEm6f9fwa^tb-i se>(V3kF+lu<-Oj4X-)7l3^FVd93niz1TVuN!y>^U!Xr$S|MZUi54}tY?f?J) delta 1075 zcmWmAOKes}7{>8)+7H1|69lvfAKFp~2{nO)a~cJVEX50om%fV`~Ei;wx1lCJ~TExGQNKP z%`SaPTN5$RNWY!Xm)I zqhMBv41)-Z00%#r=t^`Yx{{+TQI;r6lqJd%WrQXOA;TcTBEZ3;U|5L^g9wWN2S2H2 zv|rEaIX$lz^rBwULA|V3^r~LdAsx}{MsMg%Ssm4}g+AipKhW>= zSM^u-hx_~bCz|&L#~|O26_Ac+(Rxgh=zYli1W2r7uU8Xvx+N3(B+NL_B+NIhz z4|fiiqs{S7cgJX|id2=U%BeD`im9@x3aN6b@}2wFb+ys6gga#NboJZGNb%*Zf^un2JQC}zkY!yv*Uz`>(n zR*4LQ2#Wv*KhKq?xH2-F;fb&acR%1!%n(9`L4-wsgGa%z5*Y>&76A@^UhnGzeW;K0 zu|CnKI;m-$QlrmwTA%BTW_9nJ&gz`b>q7I^+KrD6sZgl_4XUFRTDel|^@uiTqq^Fp z$C^FsHoHYFsb$ec7Da|ZghhaZN3lc(83qv+0S+Dovr1$bL|6nk_?A5v*%KMg@I+XI zyC3iW046O-bMBd;Opv^^Hy_&hKXh`VasU7T diff --git a/tools/tests/zasm/geninstrs.py b/tools/tests/zasm/geninstrs.py index fd929e3..8629fd1 100755 --- a/tools/tests/zasm/geninstrs.py +++ b/tools/tests/zasm/geninstrs.py @@ -56,6 +56,12 @@ argGrpTbl = { chr(0x0b): "BCDEHLA", } +# whenever we encounter the "(HL)" version of these instructions, spit IX/IY +# too. +instrsWithIXY = { + 'ADD', 'AND', 'BIT', 'CP', 'DEC', 'INC', 'OR', 'RES', 'RL', 'RR', 'SET', + 'SRL'} + def cleanupLine(line): line = line.strip() idx = line.rfind(';') @@ -107,6 +113,8 @@ def genargs(argspec): return result if argspec in argspecTbl: return [argspecTbl[argspec]] + if argspec == chr(0xc): # special BIT "b" group + return ['0', '3', '7'] grp = argGrpTbl[argspec] return [argspecTbl[a] for a in grp] @@ -131,13 +139,14 @@ def main(): a2 = eval(row[2]) args1 = genargs(a1) # special case handling + if n in instrsWithIXY and a1 == 'l': + args1 += genargs('x') + args1 += genargs('y') + if n == 'JP' and isinstance(a1, str) and a1 in 'xy': # we don't test the displacements for IX/IY because there can't be # any. args1 = args1[:1] - if n in {'BIT', 'SET', 'RES'}: - # we only want to keep 1, 2, 4 - args1 = args1[:3] if n in {'JR', 'DJNZ'} and a1 == 'n': args1 = eargs(args1) if n == 'IM': @@ -145,6 +154,9 @@ def main(): if args1: for arg1 in args1: args2 = genargs(a2) + if n in instrsWithIXY and a2 == 'l': + args2 += genargs('x') + args2 += genargs('y') if args2: if n in {'JR', 'DJNZ'} and a2 == 'n': args2 = eargs(args2)