diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-08 23:57:26 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-08 23:57:26 +1000 |
| commit | e62b66dd08ca445d1f7e5b802a503ad3ec83b2df (patch) | |
| tree | 8cdb4ee09d1eefe096f51d6c9150dc361d08ccb9 /ROMs | |
| parent | 33e1c5fc6e37549b4eba833ae7e534f9da250b10 (diff) | |
added branching to compiler and comment generation
Diffstat (limited to 'ROMs')
| -rw-r--r-- | ROMs/hello_c.asm | 12 | ||||
| -rw-r--r-- | ROMs/hello_c.c | 4 | ||||
| -rw-r--r-- | ROMs/hello_c.q1 | bin | 22 -> 56 bytes |
3 files changed, 10 insertions, 6 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 diff --git a/ROMs/hello_c.c b/ROMs/hello_c.c index 1f79a53..d0abdd5 100644 --- a/ROMs/hello_c.c +++ b/ROMs/hello_c.c @@ -1,4 +1,6 @@ int main() { - return 0 | 1; + //comment + int a = 5; + return a += 5; }
\ No newline at end of file diff --git a/ROMs/hello_c.q1 b/ROMs/hello_c.q1 Binary files differindex 5e4d71e..0ca60e8 100644 --- a/ROMs/hello_c.q1 +++ b/ROMs/hello_c.q1 |
