Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
434B

  1. ( Read word from C<, copy to WORDBUF, null-terminate, and
  2. return WORDBUF. )
  3. : WORD
  4. 0x0e RAM+ TOWORD ( a c )
  5. DUP EOT? IF OVER ! EXIT THEN
  6. BEGIN
  7. ( We take advantage of the fact that char MSB is
  8. always zero to pre-write our null-termination )
  9. OVER ! 1+ C< ( a c )
  10. OVER 0x2d ( 2e-1 for NULL ) RAM+ = OVER WS? OR
  11. UNTIL ( a c )
  12. NIP 0x0e RAM+ ( ws a )
  13. SWAP EOT? IF 4 OVER ! THEN ;