uxn11/test/xclock.tal

26 lines
654 B
Tal

( xclock.tal )
( )
( runs 4 xclock processes. )
( )
( when one is killed it immediately restarts. )
( when this program exits all xclocks also exit. )
|10 @Console [
&vect $2 &stdin $1 &pad1 $1 &proc-get $1 &host-get $1 &pad2 $1 &type $1
&stdout $1 &stderr $1 &proc-put $1 &pad3 $1 &param $2 &opts $1 &host-put $1
]
|0100
#00 &loop DUP run-xclock INC DUP #04 LTH ?&loop POP
;on-console .Console/vect DEO2 BRK
@on-console ( -> BRK )
.Console/type DEI DUP #80 AND ?{ POP BRK } #0f AND run-xclock BRK
@run-xclock ( child^ -> )
.Console/opts DEO
;xclock .Console/param DEO2
#01 .Console/host-put DEO JMP2r
@xclock "xclock 00