Remove dollar sign ($) from front of number tokens

Number tokens with a dollar sign are kind of cumbersome and don't really
serve a purpose, so I'm removing them.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-03-10 15:59:36 -04:00
parent 7c9d4fe908
commit 28edfb6933
9 changed files with 133 additions and 126 deletions

View File

@@ -1,72 +1,72 @@
.section data $0x0 {
flags: .u8 $0b1001
.section data 0x0 {
flags: .u8 0b1001
main:
; Test bit and
mov %status, $1
mov %r0, $0b1000
mov %status, 1
mov %r0, 0b1000
and %r0, (flags)u8
cmpeq %r0, $0b1000
cmpeq %r0, 0b1000
jz end
; Test shift right
mov %status, $2
shr %r0, $2
cmpeq %r0, $0b0010
mov %status, 2
shr %r0, 2
cmpeq %r0, 0b0010
jz end
; Test bit and
mov %status, $3
mov %status, 3
and %r0, (flags)u8
cmpeq %r0, $0
cmpeq %r0, 0
jz end
; Test bit or
mov %status, $4
mov %status, 4
or %r0, (flags)u8
cmpeq %r0, (flags)u8
jz end
; Test bit or
mov %status, $5
or %r0, $0b10
cmpeq %r0, $0b1011
mov %status, 5
or %r0, 0b10
cmpeq %r0, 0b1011
jz end
; Test shift left
mov %status, $6
shl %r0, $1
cmpeq %r0, $0b10110
mov %status, 6
shl %r0, 1
cmpeq %r0, 0b10110
jz end
; Test xor
mov %status, $7
mov %status, 7
xor %r0, %r0
cmpeq %r0, $0
cmpeq %r0, 0
jz end
; Test xor
mov %status, $8
mov %r0, $0b1000
mov %status, 8
mov %r0, 0b1000
xor %r0, (flags)u8
cmpeq %r0, $1
cmpeq %r0, 1
jz end
; Test inv
mov %status, $9
mov %status, 9
; TODO : destination size - the line below inverts all 64 bits instead of the source 8 bits
; inv %r0, (flags)u8
inv (flags)u8, (flags)u8
cmpeq (flags)u8, $0b11110110
cmpeq (flags)u8, 0b11110110
jz end
; Test inv again (reset flags to their previous value)
mov %status, $10
mov %status, 10
inv (flags)u8, (flags)u8
cmpeq (flags)u8, $0b00001001
cmpeq (flags)u8, 0b00001001
jz end
mov %status, $0
mov %status, 0
end:
halt