collapseos/blk/360

11 lines
348 B
Plaintext
Raw Normal View History

: (parseh) ( a -- n f )
2020-05-25 20:16:07 -04:00
( '0': ASCII 0x30 'x': 0x78 0x7830 )
DUP 1+ @ 0x7830 = NOT IF 0 EXIT THEN ( a 0 )
( We have "0x" prefix )
2020-05-25 20:16:07 -04:00
DUP C@ ( a len )
0 SWAP 1+ ( len+1 ) 3 DO ( a r )
2020-05-25 13:40:25 -04:00
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 ;