etherforth_logo

Node 508

This node contains interface to other modules. Words here send data and instructions via ether to other modules.

Source code

editor node 408 node 508
508 gate
pth 00 -n @p drop @p ; pth! 01 n !p ; 0 ,
ok? 03 @b
ok 04 dup or - down b! !b ;
reach 07 p up b! 12027 code up !b !b !b ;
rch0 0C reach 1 !b !b !b ok ;
rch1 10 reach 100 !b !b ok? ;
rch2 14 reach 101 !b !b !b ok? ;
hook 18 p pth! ok ;
run 1A i pth 7 l 1 u 0 path lit rch0 ;
disk 1D n 560B disk 1 l 0 u 0 path lit rch0 ;
back 21 n 5720 blk@ 2 l 0 u 0 path lit rch0 ;
keep 25 n 5621 blk! 5 l 0 u 0 path lit rch0 ;
work 29 12019 work 1 l 0 u 0 path lit rch1 ;
save 2D 12034 save 5 l 0 u 0 path lit rch1 ;
peer 31 p 5631 peer 7 l 0 0 path lit rch2 ;
code 35 n 561D code 3 l 3 d 0 path lit rch2 ;
load 39 n 5728 load 4 l 2 d 0 path lit rch2 ; 3D

init down b! -d-- ; 40

0 d 0 0 ether

Definitions

pth, pth!
This variable keeps paths used by run.
ok
Always send negative as reply to 409.
ok?
Fetch reply from a module (B being set to ???) and send it back to 409.
reach
Build and send an ether message. It expects first payload word (usually a call) and path on stack. Set B to UP (the output port), send focus, call to code, and path from stack. The rest of message is specific for each command and is built by words rch0, rch1, and rch2.
init
Set register B, and jump to DOWN.

Description