From: Lukas Krickl Date: Fri, 24 Nov 2023 19:26:08 +0000 (+0100) Subject: Added push and calls X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=80274a917d343834368c067dd55ba8d2860cb332;p=ulas%2F.git Added push and calls --- 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