Added code to detect assembler directives and did some minor code clean up.

This commit is contained in:
2022-02-01 22:07:00 -06:00
parent ebc1d30c1c
commit 7a88d6e34d
5 changed files with 17 additions and 127 deletions
+4 -3
View File
@@ -1,12 +1,13 @@
; comments are ignored
; This is a very simple test file for an assemblier.
.db msg "Hello, world!"
.org 0x100
.db msg "Hello, world!", 0
copy r1, msg
copy r2, 0
.loop:
loop:
cmp r1, 0
jz .loop
jz loop
add r1, 1
mov r1, 5 ; move the immediate value 5 into r1
add r1,5 ; add 5 into r1