1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-30 20:38:05 +11:00
collapseos/blk/399
Virgil Dupras ed2b91411a Limit ourselves to 8-bit branching
I'm planning on going back to 8-bit branching. 16-bit br cells incur
a non-negligible penalty and, while at first 64 words (128 bytes
forward or backward) seemed a bit limiting, I now don't see why one
would ever construct such a big branch. It would be un-forthy.

Also, I looked at using BC instead of IY to hold IP and the transition
would be a lot easier with 8-bit branching.

In this commit, all I do is add overflow checks in IF. The mechanic
below doesn't change. I'll give myself some time to think it over so
that I avoid yet another back and forth.
2020-05-24 10:16:25 -04:00

10 lines
276 B
Plaintext

: BEGIN H@ ; IMMEDIATE
: AGAIN COMPILE (br) H@ - _bchk , ; IMMEDIATE
: UNTIL COMPILE (?br) H@ - _bchk , ; IMMEDIATE
: [ INTERPRET ; IMMEDIATE
: ] R> DROP ;
: LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE
: LITA 36 , , ;
: COMPILE ' LITA ['] , , ; IMMEDIATE
: [COMPILE] ' , ; IMMEDIATE