6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 10:19 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Porting fig-Forth
PostPosted: Fri Jan 05, 2024 4:55 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
Howdy everyone!

I'm trying to port fig-Forth to my upcoming 65816 SBC. But I am getting some very strange results already! Attached is the code I'm using and the results from it from my simulator. The fuzzy characters might be control characters that are just coming in as garbage pixels, but regardless the rest is very readable. These only pop up when I hit any key, like 'A' or 'Enter', it doesn't matter what key I hit. Is this... usual behavior?

My big question is: How do you port this thing?! So far what I think I'm doing is changing some addresses:

Code:
0054  0000            ;      Monitor calls for terminal support
0055  0000            ;
0056  0000            OUTCH  =$D2C1      ; output one ASCII character to termina
0057  0000            INCH   =$D1DC      ; input one ASCII character from termina
0058  0000            TCR    =$D0F1     ; terminal return and line feed


and

Code:
0162  026F            ;   Monitor routines needed to trace
0163  026F            ;
0164  026F            XBLANK =$D0AF    Print one blank
0165  026F            CRLF   =$D0D2    Print a carriage return and line feed
0166  026F            HEX2   =$D2CE    Print accum as two hex numbers
0167  026F            LETTER =$D2C1    Print accumulator as one ASCII character
0168  026F            ONEKEY =$D1DC    Wait for keystroke, into accum.


These are from the Listing file. All I did was change the addresses to some other place in memory (right after the end of this code BTW). With my subroutine extras at the bottom of this code, everything fits in $0200 to $1FFF range.

So,
1) What is the difference between OUTCH and LETTER?
2) What is the difference between INCH and ONEKEY?
3) What is the difference between TCR and CRLF?

I can't give you reliable altered code because it's frankly all in hex right now. Weird indeed :)

Thank you for any insight you might have.

Chad


Attachments:
FigForthListing.txt [180.63 KiB]
Downloaded 19 times
FigForthBoot.png
FigForthBoot.png [ 9.34 KiB | Viewed 4517 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Porting fig-Forth
PostPosted: Sat Jan 06, 2024 3:09 am 
Offline

Joined: Fri Apr 15, 2016 1:03 am
Posts: 136
The funny characters in the trace output is PRNAM handing your LETTER a character with bit7 set.


This listing has the "normal" console & "trace" console defined with separate I/O routines.
The trace set could be redirected to the normal set if you have only 1 console.

--- normal console ---
outch = output char
inch = input char
tcr = output cr & lf

--- TColon & Trace & PrNam console ---
letter = output char
onekey = input char
crlf = output cr & lf

Traditional FIG-FORTH is an Indirect-Threaded-Code (ITC) implementation.
Many words are written in an intermediate language. It is mostly a list of word addresses to call.

TColon & Trace are the guts of a trace function for the intermediate language.
This helps you get the essential parts running. When most of it works, you'll probably want to unhook these trace routines.


If you're interested, I've got most of a 65816 native mode Subroutine-Threaded-Code (STC) version of FIG-FORTH available.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: