From 183b1a1084a340461f074995c3c0ef35b2bc0e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=20K=C3=B6rbes?= Date: Mon, 27 Apr 2020 03:09:39 +0200 Subject: [PATCH] allow binary format for immediate addressing mode --- assembler.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assembler.js b/assembler.js index 13a642c..875b46b 100644 --- a/assembler.js +++ b/assembler.js @@ -2015,6 +2015,13 @@ function SimulatorWidget(node) { pushByte(value); return true; } + if (param.match(/^#\%[0-1]{1,8}$/i)) { + pushByte(opcode); + value = parseInt(param.replace(/^#\%/, ""), 2); + if (value < 0 || value > 255) { return false; } + pushByte(value); + return true; + } if (param.match(/^#[0-9]{1,3}$/i)) { pushByte(opcode); value = parseInt(param.replace(/^#/, ""), 10);