mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-28 13:08:06 +11:00
wip
This commit is contained in:
parent
a776df27d2
commit
cc59d37658
1
blk/354
1
blk/354
@ -11,3 +11,4 @@
|
||||
: C!+ ( c a -- a+1 ) TUCK C! 1+ ;
|
||||
: C@- ( a -- a-1 c ) DUP C@ SWAP 1- SWAP ;
|
||||
: C!- ( c a -- a-1 ) TUCK C! 1- ;
|
||||
: LEAVE R> R> DROP I 1- >R >R ; : UNLOOP R> 2R> 2DROP >R ;
|
||||
|
25
blk/357
25
blk/357
@ -1,16 +1,11 @@
|
||||
: (parsed) ( a -- n f )
|
||||
DUP C@ ( a c )
|
||||
DUP '-' = IF
|
||||
DROP 1+ ( a+1 ) (parsed) 0 ROT ( f 0 n )
|
||||
: _ ( a len -- n f )
|
||||
OVER C@ ( a len c )
|
||||
'-' = IF
|
||||
1- SWAP 1+ SWAP ( a+1 len-1 ) _ 0 ROT ( f 0 n )
|
||||
- SWAP EXIT ( 0-n f )
|
||||
THEN
|
||||
0 SWAP _pdacc ( a r f )
|
||||
?DUP IF 2DROP 0 EXIT THEN
|
||||
BEGIN ( a r )
|
||||
SWAP 1+ ( r a+1 )
|
||||
DUP C@ ( r a c )
|
||||
ROT SWAP ( a r c )
|
||||
_pdacc ( a r f )
|
||||
?DUP UNTIL
|
||||
1 = ( a r f )
|
||||
ROT DROP ( r f ) ;
|
||||
THEN ( a len )
|
||||
0 SWAP ( len ) 0 DO ( a r )
|
||||
OVER I + C@ ( a r c ) _pdacc ( a r f )
|
||||
IF DROP 0 UNLOOP EXIT THEN LOOP ( a r )
|
||||
NIP 1 ;
|
||||
: (parsed) ( a -- n f ) DUP 1- C@ ( a l ) _ ;
|
||||
|
1
blk/367
1
blk/367
@ -7,4 +7,3 @@
|
||||
: / /MOD NIP ;
|
||||
: MOD /MOD DROP ;
|
||||
: ALLOT HERE +! ;
|
||||
: LEAVE R> R> DROP I 1- >R >R ;
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
Loading…
Reference in New Issue
Block a user