Add print string from memory interrupt

This commit is contained in:
2019-11-24 11:03:37 +01:00
parent 1148682324
commit 25b65bab19
4 changed files with 31 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ addi $1 %A %A;
# Print the current value
int $1;
seti %B %A;
seti %A $10; # new line
seti %A $32; # space
int $0;
seti %A %B;
@@ -68,3 +68,19 @@ int $0;
seti %A [$1024];
int $1;
# Push the string "hell" into register A
seti %A $108;
shli %A $8 %A;
addi %A $108 %A;
shli %A $8 %A;
addi %A $101 %A;
shli %A $8 %A;
addi %A $104 %A;
# Store A at 900
seti [$900] %A;
# Setup to print a string from position 900
seti %A $900;
seti %B $4;
int $2;