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

Topics relating to various Forth models on the 6502, 65816, and related microprocessors and microcontrollers.
dwight
Posts: 213
Joined: 08 Jun 2004

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

Post 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
dwight
Posts: 213
Joined: 08 Jun 2004

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

Post 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
Post Reply