2020-10-29 19:40:13 -04:00
|
|
|
: (spie) DROP ; ( always enabled )
|
|
|
|
: (spix) ( x -- x, for port B )
|
|
|
|
0 SWAP ( rx tx ) 8 0 DO
|
2020-11-02 18:53:57 -05:00
|
|
|
( send current bit to TRB, TR's output bit )
|
|
|
|
DUP 7 I - RSHIFT 1 AND _TRB!
|
|
|
|
1 _THB! ( CLK hi )
|
|
|
|
0 _THB! ( CLK lo )
|
|
|
|
( read into rx ) SWAP 1 LSHIFT _D1@ ( tx rx<< x )
|
2020-10-29 19:40:13 -04:00
|
|
|
( out bit is the 6th ) 6 RSHIFT 1 AND OR
|
|
|
|
SWAP LOOP ( rx tx ) DROP ;
|