etherforth_logo

Node 310

This node packs symbols three in one word. We also choose where to send packed symbols, either to the block buffer or command line buffer.

Source code

editor node 410 node 311 node 309 node 310
310 pack
6* 00 2* 2* 2* 2* 2* 2* ;
pack! 02 @ 6* @ or 6* or !b ;
write 05 b if 199 12001 write over @p @p push @p .
!b !b !b @p ! . . . !b @p !b . begin @p ! unext ;
for pack! next ; then @p !b @p dup dup or a! @p 12 ,
!b @p !b @p push . . . begin @p !+ unext .
!b for pack! next left @p !b . @p a! ; !b 560 for @ unext ;
read 21 b if 199 12009 read over @p @p push @p .
!b !b !b @p ! . . . !b @p !b . begin @ !p unext ;
for @b ! unext ; then @p !b @p dup dup or a! @p 12 ,
!b @p !b @p push . . . begin @+ !p unext .
!b for @b ! unext left @p !b !b . @p a! ;
3AEBA 3b. 186 for dup ! unext ;
.blk 3B 1001E .blk !b ; 3D

init left a! right b! --lu ; 42

2 r 2 d 0 ether

Definitions

6*
Left shift by 6 bits.
pack!
Read three symbols, pack them into a word, and send it to 311.
write
Test address a left on stack by node 309, and if non-zero build a bridge through node 311 to node 312 and execute write there, which writes 200 words of packed symbols from SRAM into block buffer. If address a is zero, set A in 311 to zero, and let it read 13 words (39 symbols) from 310 and store in RAM from address zero (command line buffer). Then restore content of A in 311 to LEFT. Finaly discard remaining 561 symbols from block zero.
read
Start by testing address a left on stack by node 309. If non-zero, build a bridge through node 311 to node 312 and execute read there, where it reads 200 words of packed symbols from block buffer and writes them to SRAM. If address a is zero, set A in 311 to zero, and let it read 13 words (39 symbols) from RAM (command line buffer) and store them in SRAM. Then we restore content of A in 311 to LEFT, and we then fill remaining 187 words in SRAM with space symbols (3AEBA is 3× space symbol).
.blk
Call .blk in node 311.
init
Set registers A and B, and jump to LEFT and UP.

Description