summaryrefslogtreecommitdiff
path: root/ROMs/hello_c.asm
diff options
context:
space:
mode:
authorMelodi <62381002+Melodi17@users.noreply.github.com>2025-08-08 23:57:26 +1000
committerMelodi <62381002+Melodi17@users.noreply.github.com>2025-08-08 23:57:26 +1000
commite62b66dd08ca445d1f7e5b802a503ad3ec83b2df (patch)
tree8cdb4ee09d1eefe096f51d6c9150dc361d08ccb9 /ROMs/hello_c.asm
parent33e1c5fc6e37549b4eba833ae7e534f9da250b10 (diff)
added branching to compiler and comment generation
Diffstat (limited to 'ROMs/hello_c.asm')
-rw-r--r--ROMs/hello_c.asm12
1 files changed, 7 insertions, 5 deletions
diff --git a/ROMs/hello_c.asm b/ROMs/hello_c.asm
index 8cdf58b..6eba849 100644
--- a/ROMs/hello_c.asm
+++ b/ROMs/hello_c.asm
@@ -1,8 +1,10 @@
_main:
- push 0
- mov 1, V1
- pop V0
- or V0, V1
- mov DX, V0
+ ; comment
+ mov 5, [$51FF] ; int a = 5
+ add [$51FF], 5 ; compute addition
+ mov AX, [$51FF] ; store back into left param
+ mov [$51FF], V0 ; return value
+ ret
+ mov 0, V0 ; fallback return 0
ret