Add Stack, Boolean, and Math functions. With unit tests.#3
Add Stack, Boolean, and Math functions. With unit tests.#3NeilFraser wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a small set of stack-based comparison helpers to the Apps/Blockly.agc runtime so Blockly-generated programs can implement ==, !=, <, >, <=, >= via simple chained TCR calls.
Changes:
- Added
OP-EQplus suffix helpers (OP-LTE,OP-GTE,OP-NEG) to implement all six comparison operators. - Introduced
DROPas a companion toPOPfor stack manipulation. - Renamed the T4 interrupt wakeup label to
T4WAKEUPand tightened a couple of inline comments inSLEEP.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Also tighten up the code by using dead space in the jump table.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # SU subtracts a number from the 'A' register, must be in EraseableMem(0ct 0-1777) | ||
| # SU subtracts a number from the 'A' register, | ||
| # must be in Eraseable Memory (OCT 0-1777) |
There was a problem hiding this comment.
Spelling: 'Eraseable' should be 'Erasable' (one 'e'). Consider also keeping the phrasing consistent with other docs/comments (e.g., 'Erasable memory (OCT 0–1777)').
| # must be in Eraseable Memory (OCT 0-1777) | |
| # must be in Erasable memory (OCT 0-1777) |
|
|
||
| # T5 (interrupt #2) | ||
| XCH ARUPT | ||
| CA 100MS # Reschedule T5 soon. |
There was a problem hiding this comment.
In the T5 interrupt handler, other apps in this repo reschedule the timer with CAF 100MS (e.g. Apps/Minimal.agc, Apps/Print.agc). Using CA 100MS here may be incorrect or at least inconsistent with that established interrupt pattern. Consider switching this reschedule load back to CAF to match the convention and avoid any bank/addressing surprises in interrupt context.
| CA 100MS # Reschedule T5 soon. | |
| CAF 100MS # Reschedule T5 soon. |
An interesting and flexible way to do ==, !=, <, >, <=, and >= comparison operators.
Fully tested.