Skip to content

Commit 6f877d4

Browse files
committed
Add a shorthand rst n,n opcode for e-Reader API calls.
1 parent 2654565 commit 6f877d4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Archs/Z80/Z80Opcodes.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// - SP_IMM and MEMIX_MEMIY
66
// - MEMIMMEDIATE
77
// - IMMEDIATE
8+
// - NONE
89
const tZ80Opcode Z80Opcodes[] = {
910
// Name Len Encode Left param Right param LShift RShift Flags
1011
{ L"nop", 1, 0x00, Z80_PARAM_NONE, Z80_PARAM_NONE, -1, -1, Z80_COMPAT(1, 1, 1) },
@@ -149,6 +150,7 @@ const tZ80Opcode Z80Opcodes[] = {
149150
{ L"ret", 1, 0xC9, Z80_PARAM_NONE, Z80_PARAM_NONE, -1, -1, Z80_COMPAT(1, 1, 1) },
150151
{ L"reti", 1, 0xD9, Z80_PARAM_NONE, Z80_PARAM_NONE, -1, -1, Z80_COMPAT(0, 1, 0) },
151152
{ L"reti", 2, 0x4D, Z80_PARAM_NONE, Z80_PARAM_NONE, -1, -1, Z80_COMPAT(1, 0, 0) | Z80_PREFIX_ED },
153+
{ L"rst", 2, 0xC7, Z80_PARAM_IMMEDIATE, Z80_PARAM_IMMEDIATE, 0, -1, Z80_COMPAT(0, 0, 1) | Z80_RST | Z80_IMMEDIATE2_U8 },
152154
{ L"rst", 1, 0xC7, Z80_PARAM_IMMEDIATE, Z80_PARAM_NONE, 0, -1, Z80_COMPAT(1, 1, 1) | Z80_RST },
153155
{ L"ex", 1, 0x08, Z80_PARAM_AF, Z80_PARAM_AF_SHADOW, -1, -1, Z80_COMPAT(1, 0, 0) },
154156
{ L"ex", 1, 0xE3, Z80_PARAM_MEMSP, Z80_PARAM_HL, -1, -1, Z80_COMPAT(1, 0, 1) },

Tests/Z80/ER Opcodes/ER Opcodes.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@
199199
call nz, 0x1234
200200
push bc
201201
add a, 0x55
202-
rst 0x0
202+
rst 0x0, 0x55
203203
ret z
204204
ret
205205
jp z, 0x1234
206206
call z, 0x1234
207207
call 0x1234
208208
adc a, 0x55
209-
rst 0x8
209+
rst 0x8, 0x55
210210
ret nc
211211
pop de
212212
jp nc, 0x1234

Tests/Z80/ER Opcodes/expected.bin

2 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)