Firing up a FIG-Forth

Topics relating to various Forth models on the 6502, 65816, and related microprocessors and microcontrollers.
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Firing up a FIG-Forth

Post by Dr Jefyll »

dclxvi wrote:
It appears to be OCR'd as there are some instances of things like uppercase Os that should be zeros, and lowercase Ls that should be ones.
A clean version of the Forth source for the assembler is here. :D
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: Firing up a FIG-Forth

Post by enso »

Somewhat related to the stack underflow issue mentioned before... On my system, underflowing the stack with a . results in the following output:
forthcrash.png
forthcrash.png (10.5 KiB) Viewed 2229 times
Last edited by enso on Wed Jul 24, 2013 6:41 pm, edited 1 time in total.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: Firing up a FIG-Forth

Post by enso »

Another weirdness: I can't edit the line being typed. Backspacing looks right, but the interpreter complains. For instance if I type in
10 SPADES and back up to correct it to say 10 SPACES, I get an error. Is that normal behavior or is it something to do with my terminal sending wrong backspace characters?
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Tor
Posts: 597
Joined: 10 Apr 2011
Location: Norway/Japan

Re: Firing up a FIG-Forth

Post by Tor »

It does sound like the old backspace vs. delete character problem.. it used to be such a hassle when using terminals on older Unix systems.

-Tor
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: Firing up a FIG-Forth

Post by whartung »

The characters for backspace and enter are actually "hard coded" in the EXPECT routine.

Code: Select all

L1729     .BYTE $86,'EXPEC',$D4
          .WORD L1701    ; link to ."
EXPEC     .WORD DOCOL
          .WORD OVER
          .WORD PLUS
          .WORD OVER
          .WORD PDO
L1736     .WORD KEY
          .WORD DUP
          .WORD CLIT
          .BYTE $E
          .WORD PORIG
          .WORD AT
          .WORD EQUAL
          .WORD ZBRAN
L1744     .WORD $1F       ; L1760-L1744
          .WORD DROP
          .WORD CLIT
          .BYTE 08        ;; <<-- Backspace character
          .WORD OVER
          .WORD I
          .WORD EQUAL
          .WORD DUP
          .WORD RFROM
          .WORD TWO
          .WORD SUB
          .WORD PLUS
          .WORD TOR
          .WORD SUB
          .WORD BRAN
L1759     .WORD $27       ; L1779-L1759
L1760     .WORD DUP
          .WORD CLIT
          .BYTE $0A       ;; <<--- Newline character to end a line.
          .WORD EQUAL
          .WORD ZBRAN
L1765     .WORD $0E       ; L1772-L1765
          .WORD LEAVE
          .WORD DROP
          .WORD BL
          .WORD ZERO
          .WORD BRAN
L1771     .WORD 04        ; L1773-L1771
L1772     .WORD DUP
L1773     .WORD I
          .WORD CSTOR
          .WORD ZERO
          .WORD I
          .WORD ONEP
          .WORD STORE
L1779     .WORD EMIT
          .WORD PLOOP
L1781     .WORD $FFA9
          .WORD DROP      ; L1736-L1781
          .WORD SEMIS
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: Firing up a FIG-Forth

Post by enso »

My terminal sends $08 as backspace; FIG-Forth defined it as $7F with a DW at the top... I don't know what words use it, but changing it fixed the problem.

Curious about the EXPECT $08...

I have to figure out the underflow next.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: Firing up a FIG-Forth

Post by whartung »

Well, that was my Fig listing, I know I changed to the $0A for end of line due to how my simulator works, being I'm on a Mac. The $08 may have well been a $7F originally as well.
Post Reply