Name

h-sh:toolbelt — immediate primitive

Synopsis

FORTH

H# ( "hexnumber" -- n )();
p4:"h-sh";

Description

Get the next word in the input stream as a hex single-number literal. (Adopted from Open Firmware.)

 : H#  ( "hexnumber" -- n )  \  Simplified for easy porting.
    0 0 BL WORD COUNT                  
    BASE @ >R  HEX  >NUMBER  R> BASE !
        ABORT" Not Hex " 2DROP          ( n)
    STATE @ IF  POSTPONE LITERAL  THEN
    ; IMMEDIATE