Added push and calls
authorLukas Krickl <lukas@krickl.dev>
Fri, 24 Nov 2023 19:26:08 +0000 (20:26 +0100)
committerLukas Krickl <lukas@krickl.dev>
Fri, 24 Nov 2023 19:26:08 +0000 (20:26 +0100)
src/ulas.c
test/t0.s

index 45775026061188beddb9584a656d13d30c874557..7b731853af3c8801f7ebbaa6bcc1b3cff319f673 100644 (file)
@@ -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
index 49865eaf5947cf88747d0569240034066ee57bad..c3c580b24b26620e79ee9842aab94665785f6406 100644 (file)
--- a/test/t0.s
+++ b/test/t0.s
@@ -46,3 +46,7 @@
   jp nz, 2
 
   jp 3
+
+  call nc, 2
+
+  push af