1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-15 05:18:05 +11:00
collapseos/blk/360

11 lines
352 B
Plaintext
Raw Normal View History

: (parseh) ( a -- n f )
( '0': ASCII 0x30 'x': 0x78 0x7830: 30768 )
DUP @ 30768 = NOT IF 0 EXIT THEN ( a 0 )
( We have "0x" prefix )
2020-05-26 03:40:25 +10:00
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 ;