From 80274a917d343834368c067dd55ba8d2860cb332 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 24 Nov 2023 20:26:08 +0100 Subject: [PATCH] Added push and calls --- src/ulas.c | 10 ++++++++++ test/t0.s | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/ulas.c b/src/ulas.c index 4577502..7b73185 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -1538,6 +1538,10 @@ const struct ulas_instr ULASINSTRS[] = { ULAS_INSTR_R16E16("jp", 0xD2, ULAS_REG_NOT_CARRY), {"jp", {ULAS_E16, 0}, {0xC3, ULAS_E16, 0x00}}, + // call + ULAS_INSTR_R16E16("call", 0xC4, ULAS_REG_NOT_ZERO), + ULAS_INSTR_R16E16("call", 0xD4, ULAS_REG_NOT_CARRY), + // inc/dec ULAS_INSTR_REG("inc", 0x03, ULAS_REG_BC), ULAS_INSTR_REG("inc", 0x13, ULAS_REG_DE), @@ -1591,6 +1595,12 @@ const struct ulas_instr ULASINSTRS[] = { ULAS_INSTR_REG("pop", 0xE1, ULAS_REG_HL), ULAS_INSTR_REG("pop", 0xF1, ULAS_REG_AF), + // push + ULAS_INSTR_REG("push", 0xC5, ULAS_REG_BC), + ULAS_INSTR_REG("push", 0xD5, ULAS_REG_DE), + ULAS_INSTR_REG("push", 0xE5, ULAS_REG_HL), + ULAS_INSTR_REG("push", 0xF5, ULAS_REG_AF), + {NULL}}; // assembles an instruction, writes bytes into dst diff --git a/test/t0.s b/test/t0.s index 49865ea..c3c580b 100644 --- a/test/t0.s +++ b/test/t0.s @@ -46,3 +46,7 @@ jp nz, 2 jp 3 + + call nc, 2 + + push af -- 2.30.2