PDA

View Full Version : ASCII ( char -- u ) supported ?


Jim Ubersetzig
01-31-06, 10:34 PM
I'm trying

: name SCI1 ASCII > TX ASCII # TX ;

and IsoMax doesn't recognize ASCII

In some versions of Forth, ASCII takes the following character and
places the numerical value on the stack.

How can I do this on a IsoPod V2, firmware version 0.55 ?

Jim Ubersetzig

RMDumse
02-01-06, 03:39 PM
Hi Jim, Our Forth doesn't have ASCII. I usually just declare constants, like this:

3E CONSTANT ">"

and then use the ">" definition when I want the value on the stack.

Interactively I did KEY .<CR> After the return, I hit the key I'm curious about, and the ASCII code is printed in whatever number base I have already choosen.

Of course it is Forth, so you can add the function if you wish. With some help courtesy of MPE Stephen Pelc, we have

: ASCII BL WORD 1+ @ STATE @ IF [COMPILE] LITERAL THEN ; IMMEDIATE

Jim Ubersetzig
02-01-06, 11:33 PM
Thank you Randy !

Exactly the information I needed !

Jim Ubersetzig