From 0ec457af5ab157d19e28ce935abf5e0d2208f3e0 Mon Sep 17 00:00:00 2001 From: ChUrl Date: Tue, 21 Mar 2023 17:22:09 +0100 Subject: [PATCH] Add a simple example program --- binaries/add_and_jump.cpu8_v1 | 17 +++++++++++++++++ programs/add_and_jump.lasm8_v1 | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 binaries/add_and_jump.cpu8_v1 create mode 100644 programs/add_and_jump.lasm8_v1 diff --git a/binaries/add_and_jump.cpu8_v1 b/binaries/add_and_jump.cpu8_v1 new file mode 100644 index 0000000..16ffe73 --- /dev/null +++ b/binaries/add_and_jump.cpu8_v1 @@ -0,0 +1,17 @@ +v3.0 hex words addressed +00: 05 81 0a 82 44 99 0f 82 45 00 80 c1 00 00 00 00 +10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ No newline at end of file diff --git a/programs/add_and_jump.lasm8_v1 b/programs/add_and_jump.lasm8_v1 new file mode 100644 index 0000000..83b93c9 --- /dev/null +++ b/programs/add_and_jump.lasm8_v1 @@ -0,0 +1,13 @@ +# Add 5 + 10 +MOV 5, reg1 +MOV 10, reg2 +ADD + +# Subtract result - 15 +MOV reg3, reg1 +MOV 15, reg2 +SUB + +# Jump to 0 if result == 15 +MOV 0, reg0 +JEQ \ No newline at end of file