Page 4 of 4

Re: Firing up a FIG-Forth

Posted: Wed Sep 05, 2012 3:57 am
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

Re: Firing up a FIG-Forth

Posted: Mon Jul 22, 2013 5:35 pm
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 2239 times

Re: Firing up a FIG-Forth

Posted: Wed Jul 24, 2013 6:41 pm
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?

Re: Firing up a FIG-Forth

Posted: Wed Jul 24, 2013 7:40 pm
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

Re: Firing up a FIG-Forth

Posted: Wed Jul 24, 2013 11:47 pm
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

Re: Firing up a FIG-Forth

Posted: Wed Jul 24, 2013 11:50 pm
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.

Re: Firing up a FIG-Forth

Posted: Thu Jul 25, 2013 3:44 am
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.