Browse Source

zasm: add support for RL r and RR r

Also, make zasm assemble zasm/util.asm again!
pull/10/head
Virgil Dupras 5 years ago
parent
commit
84090dcd14
4 changed files with 20 additions and 12 deletions
  1. +15
    -9
      apps/zasm/instr.asm
  2. +2
    -2
      apps/zasm/util.asm
  3. +2
    -0
      tools/tests/zasm/test1.asm
  4. +1
    -1
      tools/tests/zasm/test7.asm

+ 15
- 9
apps/zasm/instr.asm View File

@@ -2,7 +2,7 @@
; Number of rows in the argspec table
ARGSPEC_TBL_CNT .equ 31
; Number of rows in the primary instructions table
INSTR_TBL_CNT .equ 146
INSTR_TBL_CNT .equ 148
; size in bytes of each row in the primary instructions table
INSTR_TBL_ROWSIZE .equ 6
; Instruction IDs They correspond to the index of the table in instrNames
@@ -51,14 +51,16 @@ I_PUSH .equ 0x29
I_RET .equ 0x2a
I_RETI .equ 0x2b
I_RETN .equ 0x2c
I_RLA .equ 0x2d
I_RLCA .equ 0x2e
I_RRA .equ 0x2f
I_RRCA .equ 0x30
I_SBC .equ 0x31
I_SCF .equ 0x32
I_SUB .equ 0x33
I_XOR .equ 0x34
I_RL .equ 0x2d
I_RLA .equ 0x2e
I_RLCA .equ 0x2f
I_RR .equ 0x30
I_RRA .equ 0x31
I_RRCA .equ 0x32
I_SBC .equ 0x33
I_SCF .equ 0x34
I_SUB .equ 0x35
I_XOR .equ 0x36

; Checks whether A is 'N' or 'M'
checkNOrM:
@@ -941,8 +943,10 @@ instrNames:
.db "RET", 0
.db "RETI"
.db "RETN"
.db "RL", 0, 0
.db "RLA", 0
.db "RLCA"
.db "RR", 0, 0
.db "RRA", 0
.db "RRCA"
.db "SBC", 0
@@ -1108,8 +1112,10 @@ instrTBl:
.db I_RET, 0xa, 0, 3, 0b11000000 , 0 ; RET cc
.db I_RETI,0, 0, 0, 0xed, 0x4d ; RETI
.db I_RETN,0, 0, 0, 0xed, 0x45 ; RETN
.db I_RL, 0xb, 0,0x40, 0xcb, 0b00010000 ; RL r
.db I_RLA, 0, 0, 0, 0x17 , 0 ; RLA
.db I_RLCA,0, 0, 0, 0x07 , 0 ; RLCA
.db I_RR, 0xb, 0,0x40, 0xcb, 0b00011000 ; RR r
.db I_RRA, 0, 0, 0, 0x1f , 0 ; RRA
.db I_RRCA,0, 0, 0, 0x0f , 0 ; RRCA
.db I_SBC, 'A', 'l', 0, 0x9e , 0 ; SBC A, (HL)


+ 2
- 2
apps/zasm/util.asm View File

@@ -223,8 +223,8 @@ multDEBC:
jr nc, .noinc
add hl, bc
jr nc, .noinc
inc de
inc de
.noinc:
dec a
jr nz, .loop
jr nz, .loop
ret

+ 2
- 0
tools/tests/zasm/test1.asm View File

@@ -21,3 +21,5 @@ label2: .dw 0x42
ld hl, 0x100
.equ baz 0x20
ld b, baz-3
rl d
rr e

+ 1
- 1
tools/tests/zasm/test7.asm View File

@@ -14,7 +14,7 @@
.equ FS_HANDLE_COUNT 0
#include "fs.asm"

;#include "zasm/util.asm"
#include "zasm/util.asm"
;.equ IO_RAMSTART ZASM_RAMEND
;#include "zasm/io.asm"



Loading…
Cancel
Save