From 5fa20c396389105516d63fe26e25fcfef972e33c Mon Sep 17 00:00:00 2001 From: n loewen Date: Thu, 3 Aug 2023 15:53:59 +0100 Subject: [PATCH] Assembler: always add an END at the end of the output --- assembler.js | 4 ++++ readme.md | 4 +++- test-programs/constants.asm | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/assembler.js b/assembler.js index bccf98d..35895b6 100644 --- a/assembler.js +++ b/assembler.js @@ -181,6 +181,10 @@ function decodeInstructions(str) { } } + // Add an END at the end + machineCode.push('0'); + machineCode.push('0'); + return new Uint8Array(machineCode); } diff --git a/readme.md b/readme.md index bc286bd..eb9ee32 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,9 @@ ### Features -- [ ] Assembler: pad to 256 bytes, OR, to start, always add an END +- [ ] Assembler: + - [x] Always add an END at the end + - [ ] Pad up to 256 bytes - [x] Add constants to assembler - [ ] Keypad - [ ] Add single-stepping diff --git a/test-programs/constants.asm b/test-programs/constants.asm index ddc5ed6..c6c501e 100644 --- a/test-programs/constants.asm +++ b/test-programs/constants.asm @@ -3,5 +3,4 @@ =bar $02 ADD =foo STO =bar -STO (=bar) -END \ No newline at end of file +STO (=bar) \ No newline at end of file