1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 12:18:07 +11:00

avra: add TST

This commit is contained in:
Virgil Dupras 2019-12-22 19:17:40 -05:00
parent 6e1e8e0e59
commit b955a67daa
4 changed files with 13 additions and 4 deletions

View File

@ -191,4 +191,10 @@ the instruction after the "foo" label would be "rjmp foo+1". In zasm, it's
"rjmp foo+2". If your expression results in an odd number, the low bit of your "rjmp foo+2". If your expression results in an odd number, the low bit of your
number will be ignored. number will be ignored.
Limitations:
* `CALL` and `JMP` only support 16-bit numbers, not 22-bit ones.
* `BRLO` and `BRSH` are not there. Use `BRCS` and `BRCC` instead.
* No `high()` and `low()`. Use `&0xff` and `}8`.
[libz80]: https://github.com/ggambetta/libz80 [libz80]: https://github.com/ggambetta/libz80

View File

@ -94,9 +94,10 @@ instrNames:
.db "SLEEP", 0 .db "SLEEP", 0
.db "SUB", 0 .db "SUB", 0
.db "SWAP", 0 .db "SWAP", 0
.db "TST", 0
.db "WDR", 0 .db "WDR", 0
.db "XCH", 0 .db "XCH", 0
.equ I_ANDI 81 .equ I_ANDI 82
.db "ANDI", 0 .db "ANDI", 0
.db "CBR", 0 .db "CBR", 0
.db "CPI", 0 .db "CPI", 0
@ -105,10 +106,10 @@ instrNames:
.db "SBCI", 0 .db "SBCI", 0
.db "SBR", 0 .db "SBR", 0
.db "SUBI", 0 .db "SUBI", 0
.equ I_RCALL 89 .equ I_RCALL 90
.db "RCALL", 0 .db "RCALL", 0
.db "RJMP", 0 .db "RJMP", 0
.equ I_CBI 91 .equ I_CBI 92
.db "CBI", 0 .db "CBI", 0
.db "SBI", 0 .db "SBI", 0
.db "SBIC", 0 .db "SBIC", 0
@ -117,7 +118,7 @@ instrNames:
; ZASM limitation: CALL and JMP constants are 22-bit. In ZASM, we limit ; ZASM limitation: CALL and JMP constants are 22-bit. In ZASM, we limit
; ourselves to 16-bit. Supporting 22-bit would incur a prohibitive complexity ; ourselves to 16-bit. Supporting 22-bit would incur a prohibitive complexity
; cost. As they say, 64K words ought to be enough for anybody. ; cost. As they say, 64K words ought to be enough for anybody.
.equ I_CALL 95 .equ I_CALL 96
.db "CALL", 0 .db "CALL", 0
.db "JMP", 0 .db "JMP", 0
.db 0xff .db 0xff
@ -209,6 +210,7 @@ instrTbl:
.db 0x00, 0b10010101, 0b10001000 ; SLEEP .db 0x00, 0b10010101, 0b10001000 ; SLEEP
.db 0x02, 0b00011000, 0x00 ; SUB Rd, Rr .db 0x02, 0b00011000, 0x00 ; SUB Rd, Rr
.db 0x01, 0b10010100, 0b00000010 ; SWAP Rd .db 0x01, 0b10010100, 0b00000010 ; SWAP Rd
.db 0x41, 0b00100000, 0x00 ; TST Rd (Bit 6)
.db 0x00, 0b10010101, 0b10101000 ; WDR .db 0x00, 0b10010101, 0b10101000 ; WDR
.db 0x01, 0b10010010, 0b00000100 ; XCH Rd .db 0x01, 0b10010010, 0b00000100 ; XCH Rd
; Rd(4) + K(8): XXXXKKKK ddddKKKK ; Rd(4) + K(8): XXXXKKKK ddddKKKK

View File

@ -23,3 +23,4 @@ call foo
jmp bar jmp bar
mov r6, r30 mov r6, r30
lsl r3 lsl r3
tst r12

Binary file not shown.