From e62b66dd08ca445d1f7e5b802a503ad3ec83b2df Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Fri, 8 Aug 2025 23:57:26 +1000 Subject: added branching to compiler and comment generation --- ROMs/hello_c.asm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ROMs/hello_c.asm') 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 -- cgit v1.3.1