diff --git a/blk/001 b/blk/001 index 159ec9f..76590ba 100644 --- a/blk/001 +++ b/blk/001 @@ -13,3 +13,4 @@ MASTER INDEX + diff --git a/blk/004 b/blk/004 index b50a1e8..ec04f05 100644 --- a/blk/004 +++ b/blk/004 @@ -1,2 +1,16 @@ 21 How blocks are organized 22 Addressed devices 23 Branching + + + + + + + + + + + + + + diff --git a/blk/005 b/blk/005 index 4be0766..e360d40 100644 --- a/blk/005 +++ b/blk/005 @@ -10,3 +10,7 @@ binary (example "0b1010"), char literals are single characters surrounded by ' (example 'X'). Char literals can't be used for whitespaces. + + + + diff --git a/blk/006 b/blk/006 index b56c956..941d954 100644 --- a/blk/006 +++ b/blk/006 @@ -12,3 +12,5 @@ writes that number as a literal, followed by a reference to Example: ": foo [COMPILE] bar;" is the equivalent of ": foo bar ;" if bar is not an immediate. However, ": foo COMPILE bar ;" is the equivalent of ": foo ['] bar , ;". Got it? + + diff --git a/blk/009 b/blk/009 index a4b2d82..c75ca59 100644 --- a/blk/009 +++ b/blk/009 @@ -4,3 +4,13 @@ prompt control to a RS-232 device instead of the keyboard. Interpreter output is unbuffered and only has EMIT. This word can also be overriden, mostly as a companion to the raison d'etre of your KEY override. + + + + + + + + + + diff --git a/blk/020 b/blk/020 index 07197dc..6b8190f 100644 --- a/blk/020 +++ b/blk/020 @@ -6,3 +6,11 @@ Although the usage of absolute LOAD calls are minimally used (relative LOADs are preferred), they are sometimes unavoidable. When you span Collapse OS over multiple disks, don't forget to adjust those absolute LOADs. + + + + + + + + diff --git a/blk/021 b/blk/021 index 460d38f..f35b54f 100644 --- a/blk/021 +++ b/blk/021 @@ -11,3 +11,6 @@ try to strive towards a few goals: 4. B200-B500 are for bootstrapping 5. The rest is for recipes. 6. I'm not sure yet how I'll organize multiple arches. + + + diff --git a/blk/022 b/blk/022 index 11984ed..6d8f074 100644 --- a/blk/022 +++ b/blk/022 @@ -4,3 +4,13 @@ A@ and A! are the indirect versions of C@ and C!. Their target word is controlled through A@* and A!* and by default point to C@ and C*. There is also a AMOVE word that is the same as MOVE but using A@ and A!. + + + + + + + + + + diff --git a/blk/023 b/blk/023 index de7059b..e4e3691 100644 --- a/blk/023 +++ b/blk/023 @@ -9,3 +9,8 @@ The reasoning behind this intentional limit is that huge branches are generally a indicator that a logic ought to be simplified. So here's one more constraint for you to help you towards simplicity. + + + + + diff --git a/blk/032 b/blk/032 index 37cea63..544b71e 100644 --- a/blk/032 +++ b/blk/032 @@ -13,3 +13,4 @@ to be used directly, but as part of another word. + diff --git a/blk/044 b/blk/044 index ae2cdc6..2fa10e4 100644 --- a/blk/044 +++ b/blk/044 @@ -3,3 +3,14 @@ INTERPRET -- Get a line from stdin, compile it in tmp memory, then execute the compiled contents. LEAVE -- In a DO..LOOP, exit at the next LOOP call. QUIT -- Return to interpreter prompt immediately + + + + + + + + + + + diff --git a/blk/047 b/blk/047 index 704b33e..a280cff 100644 --- a/blk/047 +++ b/blk/047 @@ -6,3 +6,11 @@ ROLL Rotate PSP over n items. "1 ROLL" = SWAP, "2 ROLL" = ROT. 0 is noop. + + + + + + + + diff --git a/blk/051 b/blk/051 index 28fbc0e..1fd4e81 100644 --- a/blk/051 +++ b/blk/051 @@ -8,3 +8,9 @@ MOVE a1 a2 u -- Copy u bytes from a1 to a2, starting MOVE- a1 a2 u -- Copy u bytes from a1 to a2, starting with a1+u, going down. MOVE, a u -- Copy u bytes from a to HERE. + + + + + + diff --git a/blk/058 b/blk/058 index a323f57..61d9a0e 100644 --- a/blk/058 +++ b/blk/058 @@ -10,3 +10,7 @@ S= a1 a2 -- f Returns whether string a1 == a2. + + + + diff --git a/blk/076 b/blk/076 index a662b31..c8778b0 100644 --- a/blk/076 +++ b/blk/076 @@ -4,3 +4,13 @@ prohibitive in terms of costs), PS_ADDR should be set to at least 6 bytes before its actual limit. 6 bytes because we seldom have words requiring more than 3 items from the stack. Then, at each "exit" call we check for stack underflow. + + + + + + + + + + diff --git a/blk/084 b/blk/084 index e3e575e..a285d08 100644 --- a/blk/084 +++ b/blk/084 @@ -13,3 +13,4 @@ FUTURE USES section is unused for now. DRIVERS section is reserved for recipe-specific drivers. + diff --git a/blk/090 b/blk/090 index 156d5a5..95c8d13 100644 --- a/blk/090 +++ b/blk/090 @@ -8,3 +8,9 @@ In RAM-only environment, we will typically have a "CURRENT @ HERE !" line during init to have HERE begin at the end of the binary instead of RAMEND. + + + + + + diff --git a/blk/102 b/blk/102 index e2622bc..e48b026 100644 --- a/blk/102 +++ b/blk/102 @@ -1,2 +1,16 @@ X ( n -- ): Delete X chars after cursor and place in IBUF. E: Run X with n = length of FBUF. + + + + + + + + + + + + + + diff --git a/blk/105 b/blk/105 index 66a36ac..1423ff9 100644 --- a/blk/105 +++ b/blk/105 @@ -12,3 +12,5 @@ ENDCASE AGAIN ; + + diff --git a/blk/107 b/blk/107 index a64046c..8d4917f 100644 --- a/blk/107 +++ b/blk/107 @@ -11,3 +11,6 @@ CREATE FBUF 64 ALLOT0 EMIT LOOP ( lno ) 1+ . ; : _zbuf 64 0 FILL ; ( buf -- ) + + + diff --git a/blk/108 b/blk/108 index 176a01b..97c6917 100644 --- a/blk/108 +++ b/blk/108 @@ -10,3 +10,7 @@ : _mvln- ( ln -- move ln 1 line up ) DUP 14 > IF DROP 15 _lpos _zbuf ELSE 1+ _lpos DUP 64 - 64 MOVE THEN ; + + + + diff --git a/blk/109 b/blk/109 index 9b2d09e..53c2a60 100644 --- a/blk/109 +++ b/blk/109 @@ -3,3 +3,14 @@ 14 I - _mvln+ LOOP ; : U _U P ; + + + + + + + + + + + diff --git a/blk/110 b/blk/110 index cb7aade..2fb7e42 100644 --- a/blk/110 +++ b/blk/110 @@ -8,3 +8,9 @@ UNTIL ( a1 a2 ) DUP BLK) < IF BLK( - FBUF + -^ EDPOS ! ELSE DROP THEN ; : F FBUF _type _F EDPOS @ 64 / _pln ; + + + + + + diff --git a/blk/111 b/blk/111 index f296f5b..02c6b15 100644 --- a/blk/111 +++ b/blk/111 @@ -11,3 +11,6 @@ ELSE DROP 1+ ( ilen becomes rbuffsize+1 ) THEN DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen ) EDPOS +! BLK!! ; : I IBUF _type _I EDPOS @ 64 / _pln ; + + + diff --git a/blk/112 b/blk/112 index 80b279b..8239cde 100644 --- a/blk/112 +++ b/blk/112 @@ -9,3 +9,8 @@ EDPOS @ 64 / _pln ; : E FBUF _blen X ; : Y FBUF _blen icpy ; + + + + + diff --git a/blk/121 b/blk/121 index cd5c4d7..142b85d 100644 --- a/blk/121 +++ b/blk/121 @@ -11,6 +11,6 @@ effect. block. Any change made to the previously selected block is saved beforehand. -'[' and ']' advances the selected block by "modifier". - +'[' and ']' advances the selected block by "modifier". 't' opens +the previously opened block. (cont.) diff --git a/blk/123 b/blk/123 index a4897dd..5b67e23 100644 --- a/blk/123 +++ b/blk/123 @@ -8,3 +8,9 @@ be sure, then press 'E'. 'R' goes into replace mode at current cursor position. Following keystrokes replace current character and advance cursor. Press return to return to normal mode. + + + + + + diff --git a/blk/125 b/blk/125 index fdddc02..aa7f3f4 100644 --- a/blk/125 +++ b/blk/125 @@ -1,3 +1,16 @@ '? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 ) -20 LOAD+ ( B105, block editor ) 1 6 LOADR+ + + + + + + + + + + + + + diff --git a/blk/126 b/blk/126 index abb80a6..8f6de0d 100644 --- a/blk/126 +++ b/blk/126 @@ -1,5 +1,5 @@ CREATE CMD 2 C, '$' C, 0 C, -VARIABLE PREVPOS +CREATE PREVPOS 0 , CREATE PREVBLK 0 , : acc@ ACC @ 1 MAX ; : num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ; : nspcs ( n -- , spit n space ) 0 DO SPC LOOP ; @@ -9,5 +9,8 @@ VARIABLE PREVPOS : status 0 aty ." BLK" SPC BLK> ? SPC ACC ? SPC EDPOS @ 64 /MOD . ',' EMIT . 10 nspcs ; : contents 3 aty BLK> @ LIST 3 16 gutter ; -: selblk BLK@ contents ; +: selblk BLK> @ PREVBLK ! BLK@ contents ; : mode! ( c -- ) 63 0 AT-XY ; + + + diff --git a/blk/127 b/blk/127 index 96f7d72..1b3a916 100644 --- a/blk/127 +++ b/blk/127 @@ -8,3 +8,9 @@ ( buf ln c ) 63 nspcs SWAP 4 SWAP AT-XY ( buf c ) SWAP DUP _zbuf C!+ DUP 63 + SWAP DO C< DUP 0x0d = IF LEAVE THEN i C! LOOP ; + + + + + + diff --git a/blk/128 b/blk/128 index cf85c90..e11d7de 100644 --- a/blk/128 +++ b/blk/128 @@ -1,6 +1,7 @@ : $g ACC @ selblk ; : $[ BLK> @ acc@ - selblk ; : $] BLK> @ acc@ + selblk ; +: $t PREVBLK @ selblk ; : $I mode! 'I' EMIT IBUF 1 buftype _I contents mode! SPC ; : $F mode! 'F' EMIT FBUF 2 buftype _F setpos mode! SPC ; : $Y Y ; @@ -10,3 +11,6 @@ : $H EDPOS @ 0x3c0 AND pos! ; : $L EDPOS @ 0x3f OR pos! ; + + + diff --git a/blk/129 b/blk/129 index 8536a4b..3f479d3 100644 --- a/blk/129 +++ b/blk/129 @@ -10,3 +10,7 @@ : $B EDPOS @ BLK( + acc@ 0 DO BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP 1+ BLK( - pos! ; + + + + diff --git a/blk/130 b/blk/130 index ca52391..5908983 100644 --- a/blk/130 +++ b/blk/130 @@ -13,3 +13,4 @@ : $D $H 64 icpy acc@ 0 DO 16 EDPOS @ 64 / DO i _mvln- LOOP LOOP BLK!! contents ; + diff --git a/blk/131 b/blk/131 index be5f941..76f0470 100644 --- a/blk/131 +++ b/blk/131 @@ -12,3 +12,5 @@ clrscr 0 ACC ! 0 PREVPOS ! contents BEGIN status bufs setpos KEY handle UNTIL 0 0x08 RAM+ ! 19 aty ; + + diff --git a/blk/150 b/blk/150 index 91dc1a7..853c748 100644 --- a/blk/150 +++ b/blk/150 @@ -13,3 +13,4 @@ Some programs need them, so they will automatically LOAD them. Because more than one program can use the same extra words, conditional loaders are recommended. If you want to load all words do "152 LOAD" which conditionally loads all extra words. + diff --git a/blk/152 b/blk/152 index 0a47e8b..7af33ba 100644 --- a/blk/152 +++ b/blk/152 @@ -2,3 +2,15 @@ '? FILL NOT [IF] 3 LOAD+ [THEN] DROP '? EMPTY NOT [IF] 4 LOAD+ [THEN] DROP '? WIPE NOT [IF] 5 LOAD+ [THEN] DROP + + + + + + + + + + + + diff --git a/blk/153 b/blk/153 index 30ead81..7056bcb 100644 --- a/blk/153 +++ b/blk/153 @@ -9,3 +9,8 @@ : ENDOF [COMPILE] ELSE ; IMMEDIATE + + + + + diff --git a/blk/154 b/blk/154 index 22b42b9..d35f20e 100644 --- a/blk/154 +++ b/blk/154 @@ -9,3 +9,8 @@ ; IMMEDIATE + + + + + diff --git a/blk/155 b/blk/155 index ee3369e..a10dd94 100644 --- a/blk/155 +++ b/blk/155 @@ -3,3 +3,14 @@ DUP I C! LOOP DROP ; : ALLOT0 ( n -- ) H@ OVER 0 FILL ALLOT ; + + + + + + + + + + + diff --git a/blk/156 b/blk/156 index da74eab..5b68b28 100644 --- a/blk/156 +++ b/blk/156 @@ -2,3 +2,15 @@ LIT< _sys FIND NOT IF ABORT THEN DUP HERE ! CURRENT ! ; + + + + + + + + + + + + diff --git a/blk/157 b/blk/157 index b581795..f4c6b9f 100644 --- a/blk/157 +++ b/blk/157 @@ -3,3 +3,14 @@ ( src dst -- ) : COPY SWAP BLK@ BLK> ! BLK! ; + + + + + + + + + + + diff --git a/blk/158 b/blk/158 index 921d50a..c342866 100644 --- a/blk/158 +++ b/blk/158 @@ -1,2 +1,16 @@ : LOWER DUP 'A' 'Z' =><= IF 32 + THEN ; : UPPER DUP 'a' 'z' =><= IF 32 - THEN ; + + + + + + + + + + + + + + diff --git a/blk/200 b/blk/200 index 9eda24a..0fc274a 100644 --- a/blk/200 +++ b/blk/200 @@ -11,3 +11,6 @@ Z80 Assembler 238 OP3ddnn 240 OP3nn 242 Specials 246 Flow 249 Macros + + + diff --git a/blk/206 b/blk/206 index 7cb441a..a469d1f 100644 --- a/blk/206 +++ b/blk/206 @@ -1,3 +1,16 @@ On top of that, you have the very nice BREAK, instruction, which must also be preceeded by a JRxx, and will jump to the PC following the next AGAIN, + + + + + + + + + + + + + diff --git a/blk/209 b/blk/209 index a25a953..005c8f4 100644 --- a/blk/209 +++ b/blk/209 @@ -9,3 +9,8 @@ JR [, Z, NZ, C, NC] DI EI EXDEHL EXX HALT NOP RET RETI RETN SCF + + + + + diff --git a/blk/212 b/blk/212 index 09d3733..1344102 100644 --- a/blk/212 +++ b/blk/212 @@ -1 +1,16 @@ 1 37 LOADR+ + + + + + + + + + + + + + + + diff --git a/blk/213 b/blk/213 index 944d475..1a367e7 100644 --- a/blk/213 +++ b/blk/213 @@ -6,3 +6,11 @@ VARIABLE L1 VARIABLE L2 VARIABLE L3 VARIABLE L4 : BC 0 ; : DE 1 ; : HL 2 ; : AF 3 ; : SP AF ; : CNZ 0 ; : CZ 1 ; : CNC 2 ; : CC 3 ; : CPO 4 ; : CPE 5 ; : CP 6 ; : CM 7 ; + + + + + + + + diff --git a/blk/216 b/blk/216 index 4af05d9..2197800 100644 --- a/blk/216 +++ b/blk/216 @@ -10,3 +10,7 @@ 0x1f OP1 RRA, 0x0f OP1 RRCA, 0x37 OP1 SCF, + + + + diff --git a/blk/217 b/blk/217 index ed257c7..1c1275e 100644 --- a/blk/217 +++ b/blk/217 @@ -9,3 +9,8 @@ 0x28 OP1 JRZ, 0x20 OP1 JRNZ, + + + + + diff --git a/blk/218 b/blk/218 index 1acc685..9a81989 100644 --- a/blk/218 +++ b/blk/218 @@ -10,3 +10,7 @@ 0x04 OP1r INCr, 0x05 OP1r DECr, : INC(IXY+), INCr, A, ; : DEC(IXY+), DECr, A, ; + + + + diff --git a/blk/219 b/blk/219 index 6121510..d2b8932 100644 --- a/blk/219 +++ b/blk/219 @@ -12,3 +12,5 @@ 0xb0 OP1r0 ORr, 0x90 OP1r0 SUBr, 0x98 OP1r0 SBCr, 0xa8 OP1r0 XORr, : CP(IXY+), CPr, A, ; + + diff --git a/blk/220 b/blk/220 index c03d646..6b660b0 100644 --- a/blk/220 +++ b/blk/220 @@ -13,3 +13,4 @@ : ADDIXss, 0xdd A, ADDHLss, ; : ADDIXIX, HL ADDIXss, ; : ADDIYss, 0xfd A, ADDHLss, ; : ADDIYIY, HL ADDIYss, ; + diff --git a/blk/222 b/blk/222 index 216b23b..d86f17b 100644 --- a/blk/222 +++ b/blk/222 @@ -12,3 +12,5 @@ _1rr ; 0x40 OP1rr LDrr, + + diff --git a/blk/223 b/blk/223 index 946aa69..833f797 100644 --- a/blk/223 +++ b/blk/223 @@ -11,3 +11,6 @@ SWAP ( ixy+- rd HL ) LDIXYr, ; + + + diff --git a/blk/224 b/blk/224 index b67e602..da01387 100644 --- a/blk/224 +++ b/blk/224 @@ -7,3 +7,10 @@ 0xeda8 OP2 LDD, 0xedb8 OP2 LDDR, 0xed44 OP2 NEG, 0xed4d OP2 RETI, 0xed45 OP2 RETN, + + + + + + + diff --git a/blk/226 b/blk/226 index aa9468c..e2d98ff 100644 --- a/blk/226 +++ b/blk/226 @@ -13,3 +13,4 @@ 0xee OP2n XORn, 0xfe OP2n CPn, + diff --git a/blk/228 b/blk/228 index 31be551..5c43d9a 100644 --- a/blk/228 +++ b/blk/228 @@ -9,3 +9,8 @@ ; 0x06 OP2rn LDrn, + + + + + diff --git a/blk/230 b/blk/230 index 325a917..4b2c4e8 100644 --- a/blk/230 +++ b/blk/230 @@ -12,3 +12,5 @@ 0x80 OP2br RESbr, 0x40 OP2br BITbr, + + diff --git a/blk/234 b/blk/234 index d9a9904..b2748de 100644 --- a/blk/234 +++ b/blk/234 @@ -12,3 +12,5 @@ 0xed41 OP2r OUT(C)r, 0xed40 OP2r INr(C), + + diff --git a/blk/236 b/blk/236 index 9db76cb..1be52d7 100644 --- a/blk/236 +++ b/blk/236 @@ -10,3 +10,7 @@ 0x4a OP2ss ADCHLss, 0x42 OP2ss SBCHLss, + + + + diff --git a/blk/238 b/blk/238 index 75625a7..2ef96d5 100644 --- a/blk/238 +++ b/blk/238 @@ -9,3 +9,8 @@ A,, ; 0x01 OP3ddnn LDddnn, + + + + + diff --git a/blk/240 b/blk/240 index 80c55fb..f198e7a 100644 --- a/blk/240 +++ b/blk/240 @@ -9,3 +9,8 @@ 0xc3 OP3nn JPnn, 0x22 OP3nn LD(nn)HL, 0x2a OP3nn LDHL(nn), + + + + + diff --git a/blk/242 b/blk/242 index 3248715..70a9d2f 100644 --- a/blk/242 +++ b/blk/242 @@ -12,3 +12,5 @@ : JP(IX), IX DROP JP(HL), ; : JP(IY), IY DROP JP(HL), ; + + diff --git a/blk/243 b/blk/243 index ed6ab3f..beb5ac2 100644 --- a/blk/243 +++ b/blk/243 @@ -13,3 +13,4 @@ ; : ;CODE JPNEXT, ; + diff --git a/blk/247 b/blk/247 index e0d77cc..a17cb86 100644 --- a/blk/247 +++ b/blk/247 @@ -6,3 +6,11 @@ THEN ; : AGAIN, BREAK?, PC - 1- A, ; : BWR @ AGAIN, ; + + + + + + + + diff --git a/blk/249 b/blk/249 index 5adff56..f9be094 100644 --- a/blk/249 +++ b/blk/249 @@ -10,3 +10,7 @@ : LDDE(HL), E (HL) LDrr, HL INCss, D (HL) LDrr, ; : OUTHL, DUP A H LDrr, OUTnA, A L LDrr, OUTnA, ; : OUTDE, DUP A D LDrr, OUTnA, A E LDrr, OUTnA, ; + + + + diff --git a/blk/261 b/blk/261 index e84e1be..23cc33e 100644 --- a/blk/261 +++ b/blk/261 @@ -7,3 +7,10 @@ See example in /emul/xcomp.fs Why limit ourselves to icore? Oh, I've tried cross-compiling the whole shebang. I tried. And failed. Too dynamic. + + + + + + + diff --git a/blk/262 b/blk/262 index 570d9e6..a4b3cb2 100644 --- a/blk/262 +++ b/blk/262 @@ -1 +1,16 @@ 1 LOAD+ 3 LOAD+ 6 LOAD+ + + + + + + + + + + + + + + + diff --git a/blk/263 b/blk/263 index e7ed5c9..068a880 100644 --- a/blk/263 +++ b/blk/263 @@ -13,3 +13,4 @@ VARIABLE XCURRENT XCON ' _xapply LITA LIT< , FIND DROP _xapply , XCOFF ; : X[COMPILE] XCON ' _xapply , XCOFF ; + diff --git a/blk/264 b/blk/264 index db5ee2d..2144f13 100644 --- a/blk/264 +++ b/blk/264 @@ -12,3 +12,5 @@ never supposed to encounter an immediate at this point. If not found, we try the same word on system dict (RAM+02). If found and is immediate, execute. If founf and not immediate, error. If not found, try number. + + diff --git a/blk/265 b/blk/265 index d29d8b5..0fc8380 100644 --- a/blk/265 +++ b/blk/265 @@ -12,3 +12,5 @@ THEN AGAIN ; + + diff --git a/blk/270 b/blk/270 index 69ac51a..e82a041 100644 --- a/blk/270 +++ b/blk/270 @@ -9,3 +9,8 @@ CURRENT @ XCURRENT ! + + + + + diff --git a/blk/281 b/blk/281 index 93a47bb..5143fe7 100644 --- a/blk/281 +++ b/blk/281 @@ -10,3 +10,7 @@ up until 0x67, the (?br) wordref, pretty much everything has to stay put. To assemble, run "282 LOAD". + + + + diff --git a/blk/282 b/blk/282 index 52d7676..adc13e8 100644 --- a/blk/282 +++ b/blk/282 @@ -1 +1,16 @@ 1 53 LOADR+ + + + + + + + + + + + + + + + diff --git a/blk/283 b/blk/283 index 4f0446c..5dc07d8 100644 --- a/blk/283 +++ b/blk/283 @@ -13,3 +13,4 @@ NOP, NOP, ( 24, addrWord ) NOP, NOP, ( 26, unused ) 0 JPnn, ( RST 30 ) 0 JPnn, ( 33, execute ) NOP, NOP, ( unused ) 0 JPnn, ( RST 38 ) + diff --git a/blk/285 b/blk/285 index 79de6c2..2d79766 100644 --- a/blk/285 +++ b/blk/285 @@ -13,3 +13,4 @@ CODE (loop) ( 0x77 ) A 1 IX+ LDrIXY, 1 IX- CP(IXY+), JRNZ, L2 BWR ( branch ) ( don't branch ) IX DECss, IX DECss, IX DECss, IX DECss, JR, L1 BWR + diff --git a/blk/287 b/blk/287 index 9bd42f8..4702033 100644 --- a/blk/287 +++ b/blk/287 @@ -12,3 +12,5 @@ PC ORG @ 0x24 + ! ( addrWord ) IY INCss, DE PUSHqq, JPNEXT, + + diff --git a/blk/288 b/blk/288 index 9891b95..6fd4086 100644 --- a/blk/288 +++ b/blk/288 @@ -8,3 +8,9 @@ PC ORG @ 0x22 + ! ( litWord, 0xf7, tight on the 0x100 limit ) DE ADDIYss, HL PUSHqq, JPNEXT, + + + + + + diff --git a/blk/289 b/blk/289 index 771ae6b..6682eb9 100644 --- a/blk/289 +++ b/blk/289 @@ -13,3 +13,4 @@ PC ORG @ 1 + ! ( main ) Forth. ) BIN( @ 0x08 + LDHL(nn), RAMSTART 0x02 + LD(nn)HL, ( RAM+02 == CURRENT cont. ) + diff --git a/blk/290 b/blk/290 index c1c8f53..8f73fef 100644 --- a/blk/290 +++ b/blk/290 @@ -2,3 +2,15 @@ HL L1 @ LDddnn, 0x03 BCALL, ( 03 == find ) 0x33 BJP, ( 33 == execute ) + + + + + + + + + + + + diff --git a/blk/291 b/blk/291 index 33e6ecc..d5c30d3 100644 --- a/blk/291 +++ b/blk/291 @@ -13,3 +13,4 @@ PC ORG @ 4 + ! ( find ) C A LDrr, B 0 LDrn, ( C holds our length ) BC ADDHLss, HL INCss, ( HL points to after-last-char ) ( cont . ) + diff --git a/blk/292 b/blk/292 index a86812e..063f193 100644 --- a/blk/292 +++ b/blk/292 @@ -6,3 +6,11 @@ LDA(DE), 0x7f ANDn, ( remove IMMEDIATE flag ) C CPr, ( cont. ) + + + + + + + + diff --git a/blk/293 b/blk/293 index fa542eb..5cee229 100644 --- a/blk/293 +++ b/blk/293 @@ -13,3 +13,4 @@ DJNZ, AGAIN, THEN, ( cont. ) + diff --git a/blk/296 b/blk/296 index da781c2..bffbb96 100644 --- a/blk/296 +++ b/blk/296 @@ -4,3 +4,13 @@ L2 FSET ( end ) HL POPqq, RET, + + + + + + + + + + diff --git a/blk/297 b/blk/297 index 79ff1b1..fe22480 100644 --- a/blk/297 +++ b/blk/297 @@ -11,3 +11,6 @@ PC ORG @ 0x15 + ! ( popRS ) IX DECss, IX DECss, RET, + + + diff --git a/blk/298 b/blk/298 index 79401ea..8c4493d 100644 --- a/blk/298 +++ b/blk/298 @@ -5,3 +5,12 @@ L2 BSET ( abortUnderflow ) 0x03 BCALL, ( find ) 0x33 BJP, ( 33 == execute ) + + + + + + + + + diff --git a/blk/299 b/blk/299 index 7563212..92fc981 100644 --- a/blk/299 +++ b/blk/299 @@ -11,3 +11,6 @@ PC ORG @ 0x1e + ! ( chkPS ) CNC RETcc, ( PS_ADDR >= SP? good ) JR, L2 BWR ( abortUnderflow-B298 ) + + + diff --git a/blk/301 b/blk/301 index f93f6c1..f2e1935 100644 --- a/blk/301 +++ b/blk/301 @@ -13,3 +13,4 @@ L3 BSET PC ORG @ 0x34 + ! ( execute ) ( DE points to PFA ) JP(HL), + diff --git a/blk/302 b/blk/302 index 56881c2..e4e90ef 100644 --- a/blk/302 +++ b/blk/302 @@ -10,3 +10,7 @@ L1 BSET PC ORG @ 0x0f + ! ( compiledWord ) HL INCss, HL PUSHqq, IY POPqq, ( --> IP ) JR, L3 BWR ( execute-B301 ) + + + + diff --git a/blk/303 b/blk/303 index 9ec293e..3dbd4ca 100644 --- a/blk/303 +++ b/blk/303 @@ -3,3 +3,14 @@ PC ORG @ 0x0c + ! ( cellWord ) DE PUSHqq, JPNEXT, + + + + + + + + + + + diff --git a/blk/305 b/blk/305 index 49be451..a3d756d 100644 --- a/blk/305 +++ b/blk/305 @@ -7,3 +7,10 @@ CODE EXECUTE DE POPqq, chkPS, JR, L3 BWR ( execute-B301 ) + + + + + + + diff --git a/blk/306 b/blk/306 index 25ba6e4..942a8b9 100644 --- a/blk/306 +++ b/blk/306 @@ -9,3 +9,8 @@ CODE ROT BC PUSHqq, ( A ) ;CODE + + + + + diff --git a/blk/308 b/blk/308 index 67dd0ce..1a03e39 100644 --- a/blk/308 +++ b/blk/308 @@ -8,3 +8,9 @@ CODE SWAP ;CODE + + + + + + diff --git a/blk/309 b/blk/309 index 84754f4..26de74e 100644 --- a/blk/309 +++ b/blk/309 @@ -9,3 +9,8 @@ CODE OVER ;CODE + + + + + diff --git a/blk/310 b/blk/310 index 49003c9..d169433 100644 --- a/blk/310 +++ b/blk/310 @@ -13,3 +13,4 @@ CODE PICK CC L2 @ JPccnn, ( abortUnderflow-B298 ) BC PUSHqq, ;CODE + diff --git a/blk/311 b/blk/311 index 73125da..f9882bf 100644 --- a/blk/311 +++ b/blk/311 @@ -13,3 +13,4 @@ CODE (roll) HL DECss, LDDR, ;CODE + diff --git a/blk/312 b/blk/312 index d5d4528..a694b23 100644 --- a/blk/312 +++ b/blk/312 @@ -12,3 +12,5 @@ CODE 2DUP DE PUSHqq, HL PUSHqq, ;CODE + + diff --git a/blk/313 b/blk/313 index ed592ac..e9b6c22 100644 --- a/blk/313 +++ b/blk/313 @@ -9,3 +9,8 @@ CODE 'S HL PUSHqq, ;CODE + + + + + diff --git a/blk/314 b/blk/314 index 0f42c34..fe608bd 100644 --- a/blk/314 +++ b/blk/314 @@ -12,3 +12,5 @@ CODE AND ;CODE + + diff --git a/blk/315 b/blk/315 index e78e6ce..1962365 100644 --- a/blk/315 +++ b/blk/315 @@ -10,3 +10,7 @@ CODE OR H A LDrr, HL PUSHqq, ;CODE + + + + diff --git a/blk/316 b/blk/316 index c5695ea..98f9b4e 100644 --- a/blk/316 +++ b/blk/316 @@ -10,3 +10,7 @@ CODE XOR H A LDrr, HL PUSHqq, ;CODE + + + + diff --git a/blk/317 b/blk/317 index 975c34b..f186436 100644 --- a/blk/317 +++ b/blk/317 @@ -5,3 +5,12 @@ CODE NOT PUSHZ, ;CODE + + + + + + + + + diff --git a/blk/318 b/blk/318 index a84b8b6..6de995c 100644 --- a/blk/318 +++ b/blk/318 @@ -13,3 +13,4 @@ CODE - DE SUBHLss, HL PUSHqq, ;CODE + diff --git a/blk/321 b/blk/321 index 521b9ab..1b49b4f 100644 --- a/blk/321 +++ b/blk/321 @@ -13,3 +13,4 @@ HL PUSHqq, BC PUSHqq, ;CODE + diff --git a/blk/322 b/blk/322 index e5c4f5e..f8cc7da 100644 --- a/blk/322 +++ b/blk/322 @@ -13,3 +13,4 @@ CODE @ D (HL) LDrr, DE PUSHqq, ;CODE + diff --git a/blk/323 b/blk/323 index 58fb98a..c447edc 100644 --- a/blk/323 +++ b/blk/323 @@ -11,3 +11,6 @@ CODE C@ H 0 LDrn, HL PUSHqq, ;CODE + + + diff --git a/blk/324 b/blk/324 index 4234faa..7bd2afd 100644 --- a/blk/324 +++ b/blk/324 @@ -12,3 +12,5 @@ CODE PC@ HL PUSHqq, ;CODE + + diff --git a/blk/327 b/blk/327 index 038c5cd..b316c6d 100644 --- a/blk/327 +++ b/blk/327 @@ -11,3 +11,6 @@ CODE (resRS) ;CODE + + + diff --git a/blk/328 b/blk/328 index 5b2d2a5..9ca68c2 100644 --- a/blk/328 +++ b/blk/328 @@ -13,3 +13,4 @@ CODE S= THEN, PUSHZ, ;CODE + diff --git a/blk/331 b/blk/331 index c617fa3..07dad26 100644 --- a/blk/331 +++ b/blk/331 @@ -12,3 +12,5 @@ CODE -1 ;CODE + + diff --git a/blk/332 b/blk/332 index 5e9418f..9651d15 100644 --- a/blk/332 +++ b/blk/332 @@ -12,3 +12,5 @@ CODE 1- HL PUSHqq, ;CODE + + diff --git a/blk/334 b/blk/334 index eb87937..8aff1dd 100644 --- a/blk/334 +++ b/blk/334 @@ -10,3 +10,7 @@ CODE RSHIFT ( n u -- n ) THEN, HL PUSHqq, ;CODE + + + + diff --git a/blk/335 b/blk/335 index db87447..2d8cc0d 100644 --- a/blk/335 +++ b/blk/335 @@ -11,3 +11,6 @@ CODE LSHIFT ( n u -- n ) HL PUSHqq, ;CODE + + + diff --git a/blk/352 b/blk/352 index f80571b..ee84a48 100644 --- a/blk/352 +++ b/blk/352 @@ -7,3 +7,10 @@ impossible. The gap between these 2 parts is the ideal place to put device driver code. Load the low part with "353 LOAD", the high part with "380 LOAD" + + + + + + + diff --git a/blk/353 b/blk/353 index 16a9781..3d497ad 100644 --- a/blk/353 +++ b/blk/353 @@ -12,3 +12,5 @@ LIT< (main) FIND DROP EXECUTE ; 1 25 LOADR+ ( xcomp core low ) + + diff --git a/blk/354 b/blk/354 index 9471640..152e71f 100644 --- a/blk/354 +++ b/blk/354 @@ -13,3 +13,4 @@ : C@- ( a -- a-1 c ) DUP C@ SWAP 1- SWAP ; : C!- ( c a -- a-1 ) TUCK C! 1- ; : LEAVE R> R> DROP I 1- >R >R ; : UNLOOP R> 2R> 2DROP >R ; + diff --git a/blk/355 b/blk/355 index 00037e1..92a3a26 100644 --- a/blk/355 +++ b/blk/355 @@ -12,3 +12,5 @@ SWAP 10 * + ( r*10+n ) 0 ( good ) ; + + diff --git a/blk/356 b/blk/356 index 0cface1..b442551 100644 --- a/blk/356 +++ b/blk/356 @@ -9,3 +9,8 @@ non-digit. 1 means WS, which means parsing was a success. -1 means non-digit, which means we have a non-decimal. ) + + + + + diff --git a/blk/357 b/blk/357 index 65b827f..3837991 100644 --- a/blk/357 +++ b/blk/357 @@ -6,3 +6,11 @@ IF DROP 1- 0 UNLOOP EXIT THEN LOOP ( a r ) ( negate if needed ) SWAP C@ '-' = IF 0 -^ THEN 1 ( r 1 ) ; + + + + + + + + diff --git a/blk/358 b/blk/358 index 63ed549..aa31529 100644 --- a/blk/358 +++ b/blk/358 @@ -9,3 +9,8 @@ 2+ C@ 1 ( n 1 ) ; + + + + + diff --git a/blk/359 b/blk/359 index 1b5d0e8..898c07a 100644 --- a/blk/359 +++ b/blk/359 @@ -6,3 +6,11 @@ ; + + + + + + + + diff --git a/blk/360 b/blk/360 index 4e44983..0a85133 100644 --- a/blk/360 +++ b/blk/360 @@ -8,3 +8,9 @@ DUP 0< IF 2DROP 0 UNLOOP EXIT THEN SWAP 4 LSHIFT + ( a r*16+n ) LOOP NIP 1 ; + + + + + + diff --git a/blk/361 b/blk/361 index 9cee536..fbd30b5 100644 --- a/blk/361 +++ b/blk/361 @@ -5,3 +5,12 @@ ; + + + + + + + + + diff --git a/blk/362 b/blk/362 index 556905b..442d225 100644 --- a/blk/362 +++ b/blk/362 @@ -8,3 +8,9 @@ DUP 0< IF 2DROP 0 UNLOOP EXIT THEN SWAP 1 LSHIFT + ( a r*2+n ) LOOP NIP 1 ; + + + + + + diff --git a/blk/363 b/blk/363 index b97157c..6e71653 100644 --- a/blk/363 +++ b/blk/363 @@ -6,3 +6,11 @@ ( nothing works ) LIT< (wnf) FIND IF EXECUTE ELSE ABORT THEN ; + + + + + + + + diff --git a/blk/364 b/blk/364 index 865da53..5d3aa6b 100644 --- a/blk/364 +++ b/blk/364 @@ -12,3 +12,5 @@ IF OVER C@ OR ELSE 0xff XOR OVER C@ AND THEN ( addr flg ) SWAP C! ; + + diff --git a/blk/365 b/blk/365 index 8977d54..01e54dd 100644 --- a/blk/365 +++ b/blk/365 @@ -6,3 +6,11 @@ 0 ( dummy ) BEGIN DROP C< DUP WS? NOT OVER EOT? OR UNTIL ; + + + + + + + + diff --git a/blk/366 b/blk/366 index bd40900..8402834 100644 --- a/blk/366 +++ b/blk/366 @@ -11,3 +11,6 @@ UNTIL ( a c ) SWAP _wb - 1- ( ws len ) _wb C! EOT? IF _eot ELSE _wb THEN ; + + + diff --git a/blk/367 b/blk/367 index 7e21ebf..b2abad6 100644 --- a/blk/367 +++ b/blk/367 @@ -6,3 +6,11 @@ : / /MOD NIP ; : MOD /MOD DROP ; : ALLOT HERE +! ; + + + + + + + + diff --git a/blk/369 b/blk/369 index 2aad0d2..b482fb3 100644 --- a/blk/369 +++ b/blk/369 @@ -10,3 +10,7 @@ NIP ; : 2OVER 3 PICK 3 PICK ; : 2SWAP 3 ROLL 3 ROLL ; + + + + diff --git a/blk/370 b/blk/370 index b488aa3..49faaa4 100644 --- a/blk/370 +++ b/blk/370 @@ -12,3 +12,5 @@ LOOP 2DROP ; : MOVE, ( a u -- ) H@ OVER ALLOT SWAP MOVE ; : PREV 3 - DUP @ - ; + + diff --git a/blk/371 b/blk/371 index f1669c6..cac2325 100644 --- a/blk/371 +++ b/blk/371 @@ -8,3 +8,9 @@ : (entry) WORD [entry] ; : CREATE (entry) 11 ( 11 == cellWord ) C, ; : VARIABLE CREATE 2 ALLOT ; + + + + + + diff --git a/blk/372 b/blk/372 index 3cb48b4..c6c5e4f 100644 --- a/blk/372 +++ b/blk/372 @@ -11,3 +11,6 @@ WORD( HERE ! ( w ) PREV CURRENT ! ; + + + diff --git a/blk/373 b/blk/373 index 6bad060..227c662 100644 --- a/blk/373 +++ b/blk/373 @@ -13,3 +13,4 @@ ; : CONSTANT CREATE , DOES> @ ; + diff --git a/blk/374 b/blk/374 index ad14ea9..d513ef0 100644 --- a/blk/374 +++ b/blk/374 @@ -3,3 +3,14 @@ LIT< [THEN] BEGIN DUP WORD S= UNTIL DROP ; : [THEN] ; + + + + + + + + + + + diff --git a/blk/376 b/blk/376 index be477fb..09bbd52 100644 --- a/blk/376 +++ b/blk/376 @@ -10,3 +10,7 @@ : BLK) BLK( 1024 + ; + + + + diff --git a/blk/377 b/blk/377 index 11037da..bdedaef 100644 --- a/blk/377 +++ b/blk/377 @@ -9,3 +9,8 @@ ; + + + + + diff --git a/blk/378 b/blk/378 index 6b1063e..97ae670 100644 --- a/blk/378 +++ b/blk/378 @@ -11,3 +11,6 @@ : BLK!! 1 BLKDTY ! ; + + + diff --git a/blk/380 b/blk/380 index 171c335..13c1ad5 100644 --- a/blk/380 +++ b/blk/380 @@ -1 +1,16 @@ 1 20 LOADR+ ( xcomp core high ) + + + + + + + + + + + + + + + diff --git a/blk/381 b/blk/381 index e5f4045..bf91477 100644 --- a/blk/381 +++ b/blk/381 @@ -7,3 +7,10 @@ : NL 0x0a RAM+ @ ( NLPTR ) ?DUP IF EXECUTE ELSE CRLF THEN ; : (uflw) LIT" stack underflow" ERR ; : (wnf) (print) SPC LIT" word not found" ERR ; + + + + + + + diff --git a/blk/382 b/blk/382 index 7084dd5..4ba2f1c 100644 --- a/blk/382 +++ b/blk/382 @@ -8,3 +8,9 @@ ; IMMEDIATE : ." [COMPILE] LIT" COMPILE (print) ; IMMEDIATE : ABORT" [COMPILE] ." COMPILE ABORT ; IMMEDIATE + + + + + + diff --git a/blk/385 b/blk/385 index 31b564d..378e0c9 100644 --- a/blk/385 +++ b/blk/385 @@ -11,3 +11,6 @@ SWAP 8 /MOD SWAP IF 1+ THEN 0 DO _ LOOP ; + + + diff --git a/blk/390 b/blk/390 index 498ec64..2a234f2 100644 --- a/blk/390 +++ b/blk/390 @@ -9,3 +9,8 @@ 1 0x06 RAM+ ! ( 06 == C 0x0238 @PUT NOT IF _err THEN ; + + + + + + + + + diff --git a/blk/503 b/blk/503 index 62cb724..b69898c 100644 --- a/blk/503 +++ b/blk/503 @@ -13,3 +13,4 @@ A ORr, JRZ, L1 BWR ( loop2, not an error ) L3 FSET ( error ) C A LDrr, ( error code from @GET/@PUT ) A 0x1a LDrn, ( @ERROR ) 0x28 RSTn, RET, + diff --git a/blk/520 b/blk/520 index a317715..09e0dd0 100644 --- a/blk/520 +++ b/blk/520 @@ -11,3 +11,6 @@ would mean that we would have 12x2 glyphs per block. 521 Font compiler 530 3x5 font 532 5x7 font 536 7x7 font + + + diff --git a/blk/521 b/blk/521 index f2bc28d..abc2d40 100644 --- a/blk/521 +++ b/blk/521 @@ -4,3 +4,13 @@ Therefore, for a 5-bit wide char, "X.X.X" translates to 0b10101000. Left-aligned bytes are easier to work with when compositing glyphs. ) + + + + + + + + + + diff --git a/blk/524 b/blk/524 index b4bb0f8..8bcda78 100644 --- a/blk/524 +++ b/blk/524 @@ -13,3 +13,4 @@ 541 536 DO I BLK@ BLK( 9 _l 448 + 9 _l DROP LOOP ( 90 ) 542 BLK@ BLK( 4 _l DROP ( 94! ) ; + diff --git a/blk/531 b/blk/531 index db3e3d0..34dd258 100644 --- a/blk/531 +++ b/blk/531 @@ -9,3 +9,8 @@ X.XX.XX.X.X..X..XXX...X...XXX. X.XX.XXXX.X..X.XX..X..X..X.... XXX.X.X.XX.X.X.XXX.XX.X.XX.... `abcdefghijklmnopqrstuvwxyz{|}~ + + + + + diff --git a/blk/532 b/blk/532 index 589729d..ffaae6c 100644 --- a/blk/532 +++ b/blk/532 @@ -13,3 +13,4 @@ XXXXX.......X..X.X.X...X....X...XX.XXXXX....XXXXX....X..XXX. ......XX..X....X...X...X..X...X...X...X.X...XX...X.X...X...X ......XX........XXX..XXXXXXXXX.XXX....X..XXX..XXX.X.....XXX. !"#$%&'()*+,-./012345678 + diff --git a/blk/533 b/blk/533 index a74f57f..89f90f5 100644 --- a/blk/533 +++ b/blk/533 @@ -13,3 +13,4 @@ X....X....X...XX...X..X......XXX...X....X...XX..XXX...XX.... X....X....X...XX...X..X..X...XX.X..X....X...XX..XXX...XX.... XXXXXX.....XXX.X...X.XXX..XXX.X..X.XXXXXX...XX...X.XXX.X.... 9:;<=>?@ABCDEFGHIJKLMNOP + diff --git a/blk/534 b/blk/534 index a03f060..b0fe000 100644 --- a/blk/534 +++ b/blk/534 @@ -13,3 +13,4 @@ X..XXX..X.X...X..X..X...X.X.X.X.X.XX...X..X..X...XX........X ....X...............X...XX..X.X...X.X..XX....XXX......XX..X. ..XXX.....XXXXX......XXXXXXX...XXX...XXX.XXXXX......XX.X..X. QRSTUVWXYZ[\]^_`abcdefgh + diff --git a/blk/535 b/blk/535 index 48f71ad..d1f27ee 100644 --- a/blk/535 +++ b/blk/535 @@ -13,3 +13,4 @@ X...XX...XX...X..X....X....X...X.....X.....X...... X...X.X.X.X.X.X.X.X..X....X....X.....X.....X...... .XXX...X...X.X.X...XX....XXXXX..XX...X...XX....... ijklmnopqrstuvwxyz{|}~ + diff --git a/blk/536 b/blk/536 index cc945be..d8143e8 100644 --- a/blk/536 +++ b/blk/536 @@ -13,3 +13,4 @@ XXXXXX...XX.........................XX....XXX.XX...XX.....XX... ..XX.....XX.....XX............XX...XX.....XX..XX...XX....XX.... ...............XX.............XX...........XXXX..XXXXXX.XXXXXX. !"#$%&'()*+,-./012 + diff --git a/blk/537 b/blk/537 index 0dba57f..49d500a 100644 --- a/blk/537 +++ b/blk/537 @@ -13,3 +13,4 @@ XX...............XX....XX...XX.X.X.XXXXXX.XXXXX..XX.....XX..XX. ..XX...........XX...........XX.....XX..XX.XX..XX.XX..XX.XX.XX.. ...XX.........XX.......XX....XXXX..XX..XX.XXXXX...XXXX..XXXX... 3456789:;<=>?@ABCD + diff --git a/blk/538 b/blk/538 index c0c8bfc..2bbcb84 100644 --- a/blk/538 +++ b/blk/538 @@ -13,3 +13,4 @@ XX.XXX.XX..XX.XX.....XX.X.X.XX.XX......XX...XX...XX..XX.XX..XX. XX..XX.XX..XX.XX.....XX.XX..XX..XX.XX..XX...XX...XX..XX..XXXX.. XX..XX..XXXX..XX......XX.XX.XX..XX..XXXX....XX....XXXX....XX... EFGHIJKLMNOPQRSTUVWXYZ[\]^_ + diff --git a/blk/539 b/blk/539 index c1f2f2d..58004ac 100644 --- a/blk/539 +++ b/blk/539 @@ -13,3 +13,4 @@ XX...XXXX..XX...XX...XXXXXX.XXXXX.........XXXXX.........XXXXXXX .......XX..XX.XX..XX.XX..XX.XX..XX.XX......XX........XX.XX..XX. ........XXXXX.XXXXX...XXXX...XXXXX..XXXX...XX.....XXX...XX..XX. WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ + diff --git a/blk/540 b/blk/540 index bd0b9be..d54037f 100644 --- a/blk/540 +++ b/blk/540 @@ -13,3 +13,4 @@ XX......XXXX...XX....XX..XX.XX..XX.XX.X.XX..XX...XX..XX...XX... XX.........XX..XX....XX..XX..XXXX..XXXXXXX.XXXX...XXXXX..XX.... XX.....XXXXX....XXX...XXXXX...XX....XX.XX.XX..XX.....XX.XXXXXX. ijklmnopqrstuvwxyz{|}~ + diff --git a/blk/541 b/blk/541 index 17f11d1..c07298f 100644 --- a/blk/541 +++ b/blk/541 @@ -6,3 +6,11 @@ XXX......XX.....XXX......... ..XX.....XX....XX........... ...XX....XX...XX............ {|}~ + + + + + + + + diff --git a/blk/550 b/blk/550 index 5820af0..4715c73 100644 --- a/blk/550 +++ b/blk/550 @@ -4,3 +4,13 @@ Support code for the TI-84+ recipe. Contains drivers for the keyboard and LCD. 551 LCD 564 Keyboard + + + + + + + + + + diff --git a/blk/554 b/blk/554 index 3d65dbc..faa77fb 100644 --- a/blk/554 +++ b/blk/554 @@ -1,3 +1,16 @@ That being said, it's important to define clearly what CURX and CURY variable mean. Those variable keep track of the current position *in pixels*, in both axes. + + + + + + + + + + + + + diff --git a/blk/555 b/blk/555 index de38d2d..6665885 100644 --- a/blk/555 +++ b/blk/555 @@ -11,3 +11,6 @@ CODE _wait RLA, ( When 7th bit is clr, we can send a new cmd ) JRC, AGAIN, ;CODE + + + diff --git a/blk/556 b/blk/556 index 8de9f3b..d722a27 100644 --- a/blk/556 +++ b/blk/556 @@ -11,3 +11,6 @@ : _data@ 0x11 ( DATA ) PC@ _wait ; : LCDOFF 0x02 ( CMD_DISABLE ) _cmd ; : LCDON 0x03 ( CMD_ENABLE ) _cmd ; + + + diff --git a/blk/557 b/blk/557 index 14cc84c..9c347b8 100644 --- a/blk/557 +++ b/blk/557 @@ -7,3 +7,10 @@ LCDON 0x01 ( 8-bit mode ) _cmd FNTH 1+ _zoff! ; + + + + + + + diff --git a/blk/558 b/blk/558 index 32a9f08..d7e5240 100644 --- a/blk/558 +++ b/blk/558 @@ -12,3 +12,5 @@ LCD_CURY C@ FNTH 1+ + DUP 63 > IF DROP 0 THEN DUP _clrln DUP FNTH 1+ + _zoff! LCD_CURY C! 0 LCD_CURX C! ; + + diff --git a/blk/560 b/blk/560 index b1f21b5..e334476 100644 --- a/blk/560 +++ b/blk/560 @@ -2,3 +2,15 @@ DUP 0xd = IF DROP _lf EXIT THEN DUP 0x20 0x7e =><= NOT IF DROP EXIT THEN 0x20 - FNTH * ~FNT + _glyph> ; + + + + + + + + + + + + diff --git a/blk/565 b/blk/565 index 7d47d12..7637639 100644 --- a/blk/565 +++ b/blk/565 @@ -4,3 +4,13 @@ bit. Thus, to know if *any* key is pressed, we send 0xff to reset the keypad, then 0x00 to select all groups, if the result isn't 0xff, at least one key is pressed. + + + + + + + + + + diff --git a/blk/566 b/blk/566 index 2ea1d19..e645808 100644 --- a/blk/566 +++ b/blk/566 @@ -12,3 +12,5 @@ CODE _get EI, L A LDrr, HL PUSHqq, ;CODE + + diff --git a/blk/568 b/blk/568 index 6847457..cbce4ab 100644 --- a/blk/568 +++ b/blk/568 @@ -11,3 +11,6 @@ CREATE _atbl : _2nd! 0 [ KBD_MEM LITN ] BIT! ; : _alock@ 1 [ KBD_MEM LITN ] BIT@ ; : _alock^ _alock@ NOT 1 [ KBD_MEM LITN ] BIT! ; + + + diff --git a/blk/569 b/blk/569 index dea7c07..f2bbc98 100644 --- a/blk/569 +++ b/blk/569 @@ -10,3 +10,7 @@ BEGIN 1+ 2DUP RSHIFT NOT UNTIL 1- ( gid dpos dindex ) NIP ( gid dindex ) SWAP 8 * + ; + + + + diff --git a/blk/570 b/blk/570 index 446e894..f9172f5 100644 --- a/blk/570 +++ b/blk/570 @@ -12,3 +12,5 @@ _2nd@ IF DUP 'A' 'Z' =><= IF 0x20 OR THEN THEN ; : KBD$ 0 [ KBD_MEM LITN ] C! ; + + diff --git a/blk/580 b/blk/580 index b1b7b7f..ffede7f 100644 --- a/blk/580 +++ b/blk/580 @@ -5,3 +5,12 @@ ACIA, SD card and AT28 EEPROM. 581 ACIA 590 AT28 EEPROM 600 SD card 618 Xcomp unit + + + + + + + + + diff --git a/blk/582 b/blk/582 index 030f71c..ea58a0b 100644 --- a/blk/582 +++ b/blk/582 @@ -6,3 +6,11 @@ 1 6 LOADR+ + + + + + + + + diff --git a/blk/585 b/blk/585 index 323bf33..7dae0f2 100644 --- a/blk/585 +++ b/blk/585 @@ -13,3 +13,4 @@ EI, RETI, + diff --git a/blk/586 b/blk/586 index 591001a..8881b66 100644 --- a/blk/586 +++ b/blk/586 @@ -9,3 +9,8 @@ ( This means that if W> == R>, buffer is full. If R>+1 == W>, buffer is empty. ) + + + + + diff --git a/blk/588 b/blk/588 index e3efd55..fd65c34 100644 --- a/blk/588 +++ b/blk/588 @@ -11,3 +11,6 @@ 0b10010110 [ ACIA_CTL LITN ] PC! (im1) ; + + + diff --git a/blk/590 b/blk/590 index 0f8c8d1..70af41c 100644 --- a/blk/590 +++ b/blk/590 @@ -4,3 +4,13 @@ Write to an AT28 EEPROM while making sure that proper timing is followed and verify data integrity. Load with "591 LOAD" + + + + + + + + + + diff --git a/blk/591 b/blk/591 index bb49b54..2b667cf 100644 --- a/blk/591 +++ b/blk/591 @@ -13,3 +13,4 @@ ( We're finished writing. do we have a mismatch? ) C@ = NOT IF ABORT" mismatch" THEN ; + diff --git a/blk/600 b/blk/600 index 59cf355..d9c5a5b 100644 --- a/blk/600 +++ b/blk/600 @@ -1,3 +1,16 @@ SD Card driver Load range: 602-616 + + + + + + + + + + + + + diff --git a/blk/602 b/blk/602 index 24d54e0..55ac0c5 100644 --- a/blk/602 +++ b/blk/602 @@ -10,3 +10,7 @@ CODE _sdcSR ( n -- n ) L A LDrr, HL PUSHqq, ;CODE + + + + diff --git a/blk/605 b/blk/605 index e3b2953..0ff0924 100644 --- a/blk/605 +++ b/blk/605 @@ -8,3 +8,9 @@ do this right after a write, so I prefer to stay cautious for now. ) : _ready BEGIN _idle 0xff = UNTIL ; + + + + + + diff --git a/blk/607 b/blk/607 index a1a7c9f..fa08a20 100644 --- a/blk/607 +++ b/blk/607 @@ -2,3 +2,15 @@ ( n c -- c ) : _s+crc SWAP DUP _sdcSR DROP _crc7 ; + + + + + + + + + + + + diff --git a/blk/612 b/blk/612 index 134dd9d..5838f1c 100644 --- a/blk/612 +++ b/blk/612 @@ -13,3 +13,4 @@ _idle 8 LSHIFT _idle + ( crc2 ) _wait DROP _sdcDesel = NOT IF _err THEN ; + diff --git a/blk/613 b/blk/613 index 23c80a9..350f6d3 100644 --- a/blk/613 +++ b/blk/613 @@ -5,3 +5,12 @@ _sdc@ ; + + + + + + + + + diff --git a/blk/615 b/blk/615 index f443dc2..a1f71f0 100644 --- a/blk/615 +++ b/blk/615 @@ -5,3 +5,12 @@ _sdc! ; + + + + + + + + + diff --git a/blk/618 b/blk/618 index 2a1e41e..1bc9825 100644 --- a/blk/618 +++ b/blk/618 @@ -13,3 +13,4 @@ RAMSTART 0x70 + CONSTANT ACIA_MEM ( Update LATEST ) PC ORG @ 8 + ! ," ACIA$ " EOT, + diff --git a/blk/620 b/blk/620 index a3833c8..f45e03b 100644 --- a/blk/620 +++ b/blk/620 @@ -2,3 +2,15 @@ Sega Master System Recipe 622 VDP 630 PAD 640 KBD + + + + + + + + + + + + diff --git a/blk/623 b/blk/623 index 63cfd76..4d415c1 100644 --- a/blk/623 +++ b/blk/623 @@ -8,3 +8,9 @@ CODE _data HL POPqq, chkPS, A L LDrr, VDP_DATAPORT OUTnA, ;CODE + + + + + + diff --git a/blk/624 b/blk/624 index 2212e80..5f0a354 100644 --- a/blk/624 +++ b/blk/624 @@ -8,3 +8,9 @@ CODE _blank ( this is way too slow in Forth ) JRNZ, AGAIN, ;CODE + + + + + + diff --git a/blk/625 b/blk/625 index 70e9aee..d9c8f99 100644 --- a/blk/625 +++ b/blk/625 @@ -8,3 +8,9 @@ CREATE _idat 0b00000000 C, 0x88 C, ( BG X scroll ) 0b00000000 C, 0x89 C, ( BG Y scroll ) 0b11111111 C, 0x8a C, ( Line counter (why have this?) ) + + + + + + diff --git a/blk/626 b/blk/626 index e81e993..b43049b 100644 --- a/blk/626 +++ b/blk/626 @@ -10,3 +10,7 @@ always stay zero. ) : _sfont ( a -- Send font to VDP ) 7 0 DO C@+ _data 3 _zero LOOP DROP ( blank row ) 4 _zero ; + + + + diff --git a/blk/627 b/blk/627 index 0ae0e4f..97880da 100644 --- a/blk/627 +++ b/blk/627 @@ -13,3 +13,4 @@ 0x5e MIN ( tilenum ) XYPOS @ _cell! XYPOS @ 1+ DUP [ VDP_COLS VDP_ROWS * LITN ] = IF DROP 0 THEN XYPOS ! ; + diff --git a/blk/628 b/blk/628 index 720a699..0c91ddf 100644 --- a/blk/628 +++ b/blk/628 @@ -8,3 +8,9 @@ 0 XYPOS ! ( bit 6, enable display, bit 7, ?? ) 0x81c0 _ctl ; + + + + + + diff --git a/blk/631 b/blk/631 index f8a16e3..5b42a09 100644 --- a/blk/631 +++ b/blk/631 @@ -4,3 +4,13 @@ selection. Load range: 632-637 + + + + + + + + + + diff --git a/blk/632 b/blk/632 index be43e4e..b5eab66 100644 --- a/blk/632 +++ b/blk/632 @@ -10,3 +10,7 @@ This logic below is for the Genesis controller, which is modal. TH is an output pin that swiches the meaning of TL and TR. When TH is high (unselected), TL = Button B and TR = Button C. When TH is low (selected), TL = Button A and TR = Start. ) + + + + diff --git a/blk/633 b/blk/633 index 61a537c..9eda475 100644 --- a/blk/633 +++ b/blk/633 @@ -13,3 +13,4 @@ CODE _status A SLAr, A SLAr, B ORr, PUSHA, ;CODE + diff --git a/blk/634 b/blk/634 index 1fc3e5d..c19e91c 100644 --- a/blk/634 +++ b/blk/634 @@ -6,3 +6,11 @@ CREATE _ '0' C, ':' C, 'A' C, '[' C, 'a' C, 0xff C, _sel @ _ BEGIN ( c a ) C@+ 2 PICK > UNTIL ( c a ) 1- C@ NIP _sel ! ; + + + + + + + + diff --git a/blk/635 b/blk/635 index 2ea7ea7..a9d1621 100644 --- a/blk/635 +++ b/blk/635 @@ -11,3 +11,6 @@ ( return whether any of the high 3 bits is low ) 0xe0 AND 0xe0 < ; + + + diff --git a/blk/636 b/blk/636 index 6ea0980..3db7252 100644 --- a/blk/636 +++ b/blk/636 @@ -7,3 +7,10 @@ ( If not BUTC or BUTA, it has to be START ) 0xd _next C! _sel C@ ; + + + + + + + diff --git a/blk/637 b/blk/637 index 39cffdb..931efe7 100644 --- a/blk/637 +++ b/blk/637 @@ -1,2 +1,16 @@ : PAD$ 0xff _prevstat C! 'a' _sel C! 0 _next C! ; + + + + + + + + + + + + + + diff --git a/blk/640 b/blk/640 index 341b0a4..f655cfb 100644 --- a/blk/640 +++ b/blk/640 @@ -12,3 +12,5 @@ TL. When the '164 is full, TL is low. Port A TL is bit 4 ) ( Port A/B reset ) 0xff 0x3f PC! ; + + diff --git a/blk/641 b/blk/641 index 6574f05..40ff985 100644 --- a/blk/641 +++ b/blk/641 @@ -9,3 +9,8 @@ 0xdd PC@ ( bit 1:0 go in 7:6 ) 0x03 AND 6 LSHIFT OR ( n ) ( Port A/B reset ) 0xff 0x3f PC! ; + + + + + diff --git a/blk/650 b/blk/650 index 31f722d..2d90163 100644 --- a/blk/650 +++ b/blk/650 @@ -1 +1,16 @@ AVR assembler + + + + + + + + + + + + + + + diff --git a/blk/660 b/blk/660 index 6b830ca..ee857f6 100644 --- a/blk/660 +++ b/blk/660 @@ -1 +1,16 @@ 1 12 LOADR+ + + + + + + + + + + + + + + + diff --git a/blk/661 b/blk/661 index 448b789..7f5eae3 100644 --- a/blk/661 +++ b/blk/661 @@ -8,3 +8,9 @@ VARIABLE L1 VARIABLE L2 VARIABLE L3 VARIABLE L4 ( A, spits an assembled byte, A,, spits an assembled word Both increase PC. To debug, change C, to .X ) : A, C, ; : A,, SPLITB A, A, ; + + + + + + diff --git a/blk/662 b/blk/662 index 504a7fa..cfddfd3 100644 --- a/blk/662 +++ b/blk/662 @@ -5,3 +5,12 @@ : _r64c DUP 63 > IF _oor THEN ; : _r256c DUP 255 > IF _oor THEN ; : _Rdp ( op rd -- op', place Rd ) 4 LSHIFT OR ; + + + + + + + + + diff --git a/blk/663 b/blk/663 index 021b926..481349b 100644 --- a/blk/663 +++ b/blk/663 @@ -8,3 +8,9 @@ 0b1001000000001111 OPRd POP, 0b1001001000001111 OPRd PUSH, 0b1001010000000111 OPRd ROR, 0b1001010000000010 OPRd SWAP, 0b1001001000000100 OPRd XCH, + + + + + + diff --git a/blk/664 b/blk/664 index 6aff3dd..7719d51 100644 --- a/blk/664 +++ b/blk/664 @@ -13,3 +13,4 @@ OVER _r64c 0x30 AND 3 RSHIFT OR ( rd A op' ) 8 LSHIFT OR 0xff0f AND ( rd op' ) SWAP _r32c _Rdp A,, ; 0xb0 OPRdA IN, 0xb8 OPRdA _ : OUT, SWAP _ ; + diff --git a/blk/665 b/blk/665 index 236bb0a..3117fb7 100644 --- a/blk/665 +++ b/blk/665 @@ -11,3 +11,6 @@ ROT _r32c 3 LSHIFT ROT _r8c OR A, A, ; 0x98 OPAb CBI, 0x9a OPAb SBI, 0x99 OPAb SBIC, 0x9b OPAb SBIS, + + + diff --git a/blk/666 b/blk/666 index 2f2c56d..77b2ac5 100644 --- a/blk/666 +++ b/blk/666 @@ -9,3 +9,8 @@ 0x9468 OPNA SET, 0x9438 OPNA SEV, 0x9418 OPNA SEZ, 0x9588 OPNA SLEEP, 0x95a8 OPNA WDR, + + + + + diff --git a/blk/667 b/blk/667 index f5e79dd..c8ec621 100644 --- a/blk/667 +++ b/blk/667 @@ -11,3 +11,6 @@ ( special cases ) : CLR, DUP EOR, ; : TST, DUP AND, ; : LSL, DUP ADD, ; + + + diff --git a/blk/668 b/blk/668 index 0b21fe6..5a13d72 100644 --- a/blk/668 +++ b/blk/668 @@ -5,3 +5,12 @@ : RJMP _raddr12 0xc000 OR ; : RCALL _raddr12 0xd000 OR ; : RJMP, RJMP A,, ; : RCALL, RCALL A,, ; + + + + + + + + + diff --git a/blk/669 b/blk/669 index acd3657..c151553 100644 --- a/blk/669 +++ b/blk/669 @@ -10,3 +10,7 @@ : BRSH BRCC ; : BRTC 6 BRBC ; : BRTS 6 BRBS ; : BRVC 3 BRBC ; : BRVS 3 BRBS ; + + + + diff --git a/blk/670 b/blk/670 index df8ccd5..4bebd92 100644 --- a/blk/670 +++ b/blk/670 @@ -4,3 +4,13 @@ : _ldst ( Rd XYZ op ) SWAP DUP 0x10 AND 8 LSHIFT SWAP 0xf AND OR OR ( Rd op' ) SWAP _Rdp A,, ; : LD, 0x8000 _ldst ; : ST, SWAP 0x8200 _ldst ; + + + + + + + + + + diff --git a/blk/671 b/blk/671 index 4e30db4..546ecbe 100644 --- a/blk/671 +++ b/blk/671 @@ -13,3 +13,4 @@ : BEGIN, PC ; : AGAIN?, ( op ) SWAP 1- SWAP EXECUTE A,, ; : AGAIN, ['] RJMP AGAIN?, ; : IF, ['] BREQ SKIP, ; : THEN, TO, ; + diff --git a/blk/672 b/blk/672 index 87b1c11..e616f7f 100644 --- a/blk/672 +++ b/blk/672 @@ -6,3 +6,11 @@ : R24 24 ; : R25 25 ; : R26 26 ; : R27 27 ; : R28 28 ; : R29 29 ; : R30 30 ; : R31 31 ; : XL R26 ; : XH R27 ; : YL R28 ; : YH R29 ; : ZL R30 ; : ZH R31 ; + + + + + + + + diff --git a/tools/blkunpack.c b/tools/blkunpack.c index 19fc271..dcac59a 100644 --- a/tools/blkunpack.c +++ b/tools/blkunpack.c @@ -28,8 +28,26 @@ int main(int argc, char *argv[]) // not an empty block FILE *fp = fopen(fullpath, "w"); for (int i=0; i<16; i++) { - int len = strlen(&buf[i*64]); - fwrite(&buf[i*64], len, 1, fp); + char *line = &buf[i*64]; + // line length is *not* strlen()! it's the + // position of the first non-null, starting + // from the right. Then, we normalize nulls + // to space. + int j; + for (j=63; j>=0; j--) { + if (line[j] != '\0') { + break; + } + } + int len = j+1; + if (len) { + for (; j>=0; j--) { + if (line[j] == '\0') { + line[j] = ' '; + } + } + fwrite(line, len, 1, fp); + } fputc('\n', fp); } fclose(fp);