MARIE-js / MARIE.js

MARIE.js is a simple, yet intuitive MARIE simulator built in JavaScript :pencil: and is used for teaching computing architecture and assembly language
https://marie.js.org
MIT License
144 stars 45 forks source link

Minor bug fixes: insufficient memory and whitespace in labels #305

Closed jiaminglimjm closed 3 years ago

jiaminglimjm commented 3 years ago

This pull request fixes two small bugs. The first bug is an off-by-one error, here is a program which should assemble because it is short enough to fit into memory: insufficient_memory_demo.mas. It is noted however, that instructions stored in the last cell cannot actually be executed as the PC will overflow, which is why I left the other lines of code using 4095 alone: https://github.com/MARIE-js/MARIE.js/blob/12687bdb5a6c8394a1aeb33c2f8a10914590690b/src/js/interface.js#L1103

And the second bug is that labels containing whitespace are accepted but unaddressable. This program whitespace_label.mas should not be able to compile.