From 33e1c5fc6e37549b4eba833ae7e534f9da250b10 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Thu, 7 Aug 2025 00:02:00 +1000 Subject: added binary, logical and bitwise operators to compiler --- ROMs/hello_c.asm | 11 ++++++----- ROMs/hello_c.c | 2 +- ROMs/hello_c.q1 | Bin 22 -> 22 bytes 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'ROMs') diff --git a/ROMs/hello_c.asm b/ROMs/hello_c.asm index 292b99a..8cdf58b 100644 --- a/ROMs/hello_c.asm +++ b/ROMs/hello_c.asm @@ -1,7 +1,8 @@ _main: -ADD 1, 2 -SUB 4, 1 -MUL AX, AX -MOV AX, V0 -RET + push 0 + mov 1, V1 + pop V0 + or V0, V1 + mov DX, V0 + ret diff --git a/ROMs/hello_c.c b/ROMs/hello_c.c index 46eab8d..1f79a53 100644 --- a/ROMs/hello_c.c +++ b/ROMs/hello_c.c @@ -1,4 +1,4 @@ int main() { - return (1 + 2) * (4 - 1); + return 0 | 1; } \ No newline at end of file diff --git a/ROMs/hello_c.q1 b/ROMs/hello_c.q1 index deffc80..5e4d71e 100644 Binary files a/ROMs/hello_c.q1 and b/ROMs/hello_c.q1 differ -- cgit v1.3.1