From 8a89c6bf704d1b145312e3d2ba9f7736fad55967 Mon Sep 17 00:00:00 2001 From: Elias Bennour Date: Mon, 4 Dec 2023 01:21:36 +0100 Subject: [PATCH] add prog1 and prog2, asm and bin files --- prog1.asm | 31 +++++++++++++++++++++++++++++++ prog1.bin | Bin 0 -> 92 bytes prog2.asm | 33 +++++++++++++++++++++++++++++++++ prog2.bin | Bin 0 -> 100 bytes 4 files changed, 64 insertions(+) create mode 100644 prog1.asm create mode 100644 prog1.bin create mode 100644 prog2.asm create mode 100644 prog2.bin diff --git a/prog1.asm b/prog1.asm new file mode 100644 index 0000000..470fd7a --- /dev/null +++ b/prog1.asm @@ -0,0 +1,31 @@ +// +// prog1.asm -- an assembler example with global variables +// + +// global Integer x; +// global Integer y; +// x = 2; +// y = x + 3; +// x = 7 * y + x; +// writeInteger(x + -33); +// writeCharacter('\n'); + + pushc 2 + popg 0 + pushg 0 + pushc 3 + add + popg 1 + pushc 7 + pushg 1 + mul + pushg 0 + add + popg 0 + pushg 0 + pushc -33 + add + wrint + pushc '\n' + wrchr + halt diff --git a/prog1.bin b/prog1.bin new file mode 100644 index 0000000000000000000000000000000000000000..9aa0fba9cad411ca1a368b2b35fa040eda3bd8e5 GIT binary patch literal 92 zcmebCa&lv0U||Njrt R1LAXVLG%DA20kEW008E11lIrn literal 0 HcmV?d00001