Add DEFINE preprocessor directive

This commit is contained in:
2020-05-30 12:21:50 +02:00
parent 3bb2cc17e9
commit 0286f25e8d
5 changed files with 174 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
#DECLARE MEMORY_SIZE $4096;
#DEFINE
addi $10 $-5 %A;
subi %A $2 %B;
@@ -22,16 +22,17 @@ seti %A %B;
lti %A $10;
jmp count_loop;
#DEFINE PRINT_CHAR $0
# Hello world
seti %A $72; # H
int $0;
int PRINT_CHAR;
seti %A $101; # e
int $0;
int PRINT_CHAR;
seti %A $108; # l
int $0;
int $0;
int PRINT_CHAR;
int PRINT_CHAR;
seti %A $111; # o
int $0;
int PRINT_CHAR;
seti %A $32; # space
int $0;