optimized hellorld

This commit is contained in:
Luxferre
2025-04-23 10:12:08 +03:00
parent 29c84356f9
commit 5577146162
3 changed files with 10 additions and 19 deletions
+1 -9
View File
@@ -8,12 +8,4 @@
8 5 100 0 8
9 5 33 0 9
10 5 10 0 10
11 5 1 0 50
12 5 1 0 10
13 5 10 0 11
14 5 12 0 12
15 6 2 10 12
16 3 12 12 1
17 8 11 50 11
18 7 50 50 10
19 1 1 11 14
11 3 1 10 1
+1 -9
View File
@@ -8,12 +8,4 @@ set 108 0 7
set 100 0 8
set 33 0 9
set 10 0 10 ; end the string with an LF character for newline
set 1 0 50 ; set the constant 1 to memory loc 50
set 1 0 10 ; set the first address to 1 at loc 10
set 10 0 11 ; set the counter variable to 10 at loc 11
:lp set 12 0 12 ; prepare the loc 12 with its own address
cpy 2 10 12 ; load the contents of the current address at loc 10 into loc 12
out 12 12 1 ; output the character at the current address to port 1
sub 11 50 11 ; decrement the counter at loc 11
fma 50 50 10 ; increment the current address at loc 10
jmp 1 11 :lp ; jump to the loop start if the counter is over zero
out 1 10 1 ; output the range as ASCII to port 1