etherforth_logo

Node 209

This node passes requests for edit functions (insert a character, delete a character, delete a word) from 210 to 309. It also transfers execute requests and replies from node 11 to 110, and from there to 409, and back. Nodes 10, 210 and 309 are bridged via port execution.

Source code

editor node 309 node 210 node 208 node 109 node 209
209 edit
fill 00 a 5605 fill !b !b ;
flush 02 a 560B flush !b !b ;
ins 04 c @p !b !b . @p @p @p . @ !b @ ins' !b 1201E ins !b ;
bsp 09 n @p !b !b . @p @p . . @ !b 12024 bsp !b ;
del 0E x @p !b !b . @p @p @p . @ !b @ !b 1202B del !b ;
xqt 13 12031 interp @p !b . @p !p @p !p !b . . . -d-- ;
rply 18 @p ! ! . @b !p ; ;
nav 1B 12011 nav rply ;
com 1D 12024 com rply ;
disp 1F n 5601 blk! @p ! . @b ! @b .
! ! 1200D rd @p ! @b ! . ! ! ;
edit 26 disp nav ;
e 28 1200D rstr rply ;
bk' 2A @p @p ! . !b . . . 1203C bk' , ! @ ;
act 2E mi bk' up b! @p . @p . . . !b !b !b dup
!b @b drop down b! disp com ;
copy 37 m 5629 copy act ;
wipe 39 bk' 562E wipe act ;
start 3C @b ! r-l- ; 3E

init left a! down b! start ; 42

1 r 3 d 0 ether

Definitions

fill
Pass address a and call fill in 309.
flush
Write current block content back to SRAM by calling flush in 309.
ins
Insert character c at current pointer position by calling ins in 309, and pass parameters from 210.
bsp
Delete a character at current pointer position by calling bsp in 309, and pass parameters from 210.
del
Delete x characters (whole word) left of the current pointer position by calling del in 309, and pass parameters from 210.
xqt
Call go in 409 via bridge in 309, and jump to DOWN so that 409 can execute following words.
nav
Let 11 jump to nav.
com
Let 11 jump to com.
edit
Load block n into block buffer and let node 11 jump to nav.
e
Call rstr in 11.
bk'
Call bk' in 209, then read the value.
act
A factor for words copy and wipe. First get value of tha last edited block stored in bk' in 211, then place it on stack in 109, and send instruction word i via UP to be executed in 109, then duplicate and send destination block number m to 109. Wait for signal from 109 indicating end of action, set B back to DOWN, display the destination block m with disp and let 11 jump to nav.
copy
Call copy in 109 with destination block number m.
wipe
Call wipe in 109 with destination block number same as source, returned by bk'.
start
Send starting signal from 309 to 210 and jump to LEFT.
init
Set registers A and B, and jump to start.

Description