Page 2 of 2

Re: How do I enter a 1-byte literal from the keyboard?

Posted: Tue Jun 16, 2020 10:47 pm
by dwight
It sounds like a create does ( Builds Does ) or whatever works for your Forth.
It you want it to be smart to deal with numbers larger and smaller than 255 you could deal with as well.
Dwight

Re: How do I enter a 1-byte literal from the keyboard?

Posted: Tue Jun 16, 2020 10:56 pm
by dwight
For fig, I think this works:

: C-CONSTANT
<BUILDS C,
DOES> C@ ;

It can be faster but this is about as simple as I can get.
Dwight