1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-02 06:30:55 +11:00

Compare commits

..

No commits in common. "53c9580944f6e267e41bd043a19ee8c56dba6f70" and "a776df27d272c095eb614b60b47c19c52b7ccac2" have entirely different histories.

6 changed files with 39 additions and 23 deletions

View File

@ -11,4 +11,3 @@
: 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
View File

@ -1,11 +1,16 @@
: _ ( a len -- n f )
OVER C@ ( a len c )
'-' = IF
1- SWAP 1+ SWAP ( a+1 len-1 ) _ 0 ROT ( f 0 n )
: (parsed) ( a -- n f )
DUP C@ ( a c )
DUP '-' = IF
DROP 1+ ( a+1 ) (parsed) 0 ROT ( f 0 n )
- SWAP EXIT ( 0-n 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 ) _ ;
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 ) ;

17
blk/360
View File

@ -2,9 +2,14 @@
( '0': ASCII 0x30 'x': 0x78 0x7830: 30768 )
DUP @ 30768 = NOT IF 0 EXIT THEN ( a 0 )
( We have "0x" prefix )
DUP 1- C@ ( a len )
0 SWAP ( len ) 2 DO ( a r )
OVER I + C@ ( a r c ) _ ( a r n )
DUP 0< IF 2DROP 0 UNLOOP EXIT THEN
SWAP 4 LSHIFT + ( a r*16+n ) LOOP
NIP 1 ;
2+
0 ( a r )
BEGIN
SWAP C@+ ( r a+1 c )
?DUP NOT IF DROP 1 EXIT THEN ( r, 1 )
_ ( r a n )
DUP 0< IF ROT 2DROP 0 EXIT THEN ( a 0 )
ROT 16 * + ( a r*16+n )
AGAIN
;

18
blk/362
View File

@ -2,9 +2,15 @@
( '0': ASCII 0x30 'b': 0x62 0x6230: 25136 )
DUP @ 25136 = NOT IF 0 EXIT THEN ( a 0 )
( We have "0b" prefix )
DUP 1- C@ ( a len )
0 SWAP ( len ) 2 DO ( a r )
OVER I + C@ ( a r c ) _ ( a r n )
DUP 0< IF 2DROP 0 UNLOOP EXIT THEN
SWAP 1 LSHIFT + ( a r*2+n ) LOOP
NIP 1 ;
2+
0 ( a r )
BEGIN
SWAP C@+ ( r a+1 c )
?DUP NOT IF DROP 1 EXIT THEN ( r 1 )
_ ( r a n )
DUP 0< IF ROT 2DROP 0 EXIT THEN ( a 0 )
ROT 2 * + ( a r*2+n )
AGAIN
;

View File

@ -7,3 +7,4 @@
: / /MOD NIP ;
: MOD /MOD DROP ;
: ALLOT HERE +! ;
: LEAVE R> R> DROP I 1- >R >R ;

Binary file not shown.