Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
allow binary format for immediate addressing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vkorbes committed Apr 27, 2020
1 parent c039b63 commit 183b1a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 183b1a1

Please sign in to comment.