summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2012-03-15 15:03:49 +0100
committerJoakim Sindholt <opensource@zhasha.com>2012-03-15 15:03:49 +0100
commit84029e6a0cc1fa7b418bc9e8158d1f02c62d23ce (patch)
treeb4a0b5af45ad0e5a85783680346e7884f9491dfb
parentc378850e9e277ebbe16f2ce2afe543b4c4a63a78 (diff)
assembler: fix argument order on branches
-rw-r--r--Assembler.hs4
-rw-r--r--test.s2
2 files changed, 3 insertions, 3 deletions
diff --git a/Assembler.hs b/Assembler.hs
index 62649e4..71fbb1b 100644
--- a/Assembler.hs
+++ b/Assembler.hs
@@ -177,8 +177,8 @@ asm (LD dr sa) = mkWord 0x10 (argToWord dr) (argToWord sa) 0
asm (ST sa sb) = mkWord 0x20 0 (argToWord sa) (argToWord sb)
asm (LDI dr sb) = mkWord 0x4C (argToWord dr) 0 (argToWord sb)
asm (ADI dr sa sb) = mkWord 0x42 (argToWord dr) (argToWord sa) (argToWord sb)
-asm (BRZ dr sa) = mkWordSE 0x60 (argToWord dr) (argToWord sa)
-asm (BRN dr sa) = mkWordSE 0x61 (argToWord dr) (argToWord sa)
+asm (BRZ sa dr) = mkWordSE 0x60 (argToWord dr) (argToWord sa)
+asm (BRN sa dr) = mkWordSE 0x61 (argToWord dr) (argToWord sa)
asm (JMP sa) = mkWord 0x70 0 (argToWord sa) 0
asm (LRI dr sa) = mkWord 0x11 (argToWord dr) (argToWord sa) 0
asm (SRM dr sa sb) = mkWord 0x0D (argToWord dr) (argToWord sa) (argToWord sb)
diff --git a/test.s b/test.s
index 5c10b42..89c92ec 100644
--- a/test.s
+++ b/test.s
@@ -2,7 +2,7 @@
; jump over a few byte decls
ldi R0, 0x0 ; R0 <- 0 -> 9800
-brz R0, immdecl ; if R0 == 0 then goto immdecl -> c018
+brz R0, immdecl ; if R0 == 0 then goto immdecl -> c003
; byte decls
db 248 ; address of 7 seg MMIO reg -> 00f8