Fixed swap instructions
authorLukas Krickl <lukas@krickl.dev>
Tue, 12 Dec 2023 13:10:40 +0000 (14:10 +0100)
committerLukas Krickl <lukas@krickl.dev>
Tue, 12 Dec 2023 13:10:40 +0000 (14:10 +0100)
src/ulas.c
tests/t0.bin
tests/t0.s

index d544753e2902f75c6fcf39161b663bdb0d5378d4..eb0ab31d1d487489dd1827cf3670fe5452be78d2 100644 (file)
@@ -2037,13 +2037,13 @@ const struct ulas_instr ULASINSTRS[] = {
     ULAS_INSTR_REG("push", 0xF5, ULAS_REG_AF),
 
     // prefixed
+    ULAS_INSTR_PRER8D("swap", 0x30),
     ULAS_INSTR_PRER8D("rlc", 0x00),
     ULAS_INSTR_PRER8D("rrc", 0x08),
     ULAS_INSTR_PRER8D("rl", 0x10),
     ULAS_INSTR_PRER8D("rr", 0x18),
     ULAS_INSTR_PRER8D("sla", 0x10),
     ULAS_INSTR_PRER8D("sra", 0x18),
-    ULAS_INSTR_PRER8D("swap", 0x30),
     ULAS_INSTR_PRER8D("srl", 0x38),
 
     ULAS_INSTR_PREBITR8D("bit", 0x40, '0'),
index 94bb56ddcb4e8d68f3bcc21cb7fcf63c7dd79f66..8c9962573f343d89969dc1133ea498ef0f6f34a1 100644 (file)
Binary files a/tests/t0.bin and b/tests/t0.bin differ
index d0124dbee7c7ec59d1c37df914be0fc37453804e..f30707bdb55d3f3d3ebd12a2da8231a93c44823f 100644 (file)
@@ -109,3 +109,5 @@ l3: .db 1
 ; local label forward declaration 
   call @fl0
 @fl0:
+  swap a
+  ld [1], a