etherforth_logo

Node 309

This node performs elementary editing functions.

Source code

editor node 409 node 310 node 209 node 308 node 309
309 bridge
get 00 a 5619 read ! dup ! 5605 write !b !b ;
fill 05 get 599 for @ !b unext 1203B .blk !b ;
flush 0B a 5623 write ! dup ! 5621 read !b !b
199 for @b ! unext ;
head 12 n push zif ; then begin @ !b unext ;
tail 15 n - 599 . + -if ; then for @ !b unext ;
rest 1B x for 3C eob !b unext ;
ins 1E cna get dup push head !b pop tail @ ;
bsp 24 na get dup push head @ pop tail 3C eob !b ;
del 2B xna get dup push head dup push
for @ unext pop dup pop . + tail rest ;
start 33 @ !b left b! -d-u ; 37

init right a! down b! start ; 3B

1 r 2 d 0 ether

Definitions

get
Request contents of block starting at address a in SRAM, write a to stack of node 310, and call write in 310. It is a common factor editing words.
fill
Call get and reads 600 symbols from SRAM to block buffer. Then call .blk in 310 to display the current block number.
flush
Write block buffer/command line content to block starting in SRAM at address a.
head
Transfer symbols from SRAM to block buffer up to the symbol at sequence number n (which starts at zero and each symbol increments it by one).
tail
Transfer symbols from SRAM to block buffer from sequence number n till the end of block.
rest
Write x times eob symbol to node 310. Words head, tail, and rest are factors of editing words.
ins
Insert one character. Start reading block from SRAM address a, write symbols into block buffer, inserts symbol c at sequence number n, and continues transfering symbols from SRAM to block buffer. The last symbol from SRAM is removed.
bsp
Remove one character. Start reading block from SRAM address a, write symbols into block buffer, delete symbol at sequence number n, and continue transfering symbols from SRAM to block buffer. The last symbol in block buffer is filled with eob code (just in case).
del
Remove one word. Start reading block from SRAM address a, write symbols into block buffer, delete x symbols starting from sequence number n, and continue transfering symbols from SRAM to block buffer. Fill the end of block with x eob symbols.
start
Wait till a signal (dummy word) from 308 indicating the system has booted up is received, send it to node 209, set B to LEFT, and execute from UP and DOWN.
init
Set registers A and B, and jump to LEFT waiting for a signal from 707 that the system has booted up.

Description