6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 5:48 pm

All times are UTC




Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue May 14, 2019 12:14 am 
Offline

Joined: Tue May 14, 2019 12:10 am
Posts: 1
When is REFILL called? I see it in the reference implementation of ANS Forth, but it seems like no other function needs it. EVALUATE and LIST and LOAD seem like they would, but do they? Maybe this is implementation-dependent, but there must be some typical way of using REFILL. I am working on a small Forth for a little 8085 system I made for fun, and I am trying to stay with the ANS specification, and I don't want to go off in a direction that's going to make it hard to do something else later, and I also don't want to reinvent things too much.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 14, 2019 7:09 pm 
Offline

Joined: Sun May 13, 2018 5:49 pm
Posts: 255
You've revived an old thread. Tali Forth is now on version 2!

To answer your question, though, REFILL is called when you are trying to process a long line of input but your input buffer is too small. Forth will process it right up to the last character in the buffer and will then call REFILL to fill the buffer up with the next "chunk" of input and start back at the beginning of the buffer again. In Tali Forth 2, it is called in S" to allow strings longer than 255 characters, and in QUIT to initially fill up the input buffer.

Other forths might also use it when evaluating strings or loading blocks, however Tali Forth 2 simply evaluates strings in-place as their actual size (not using the input buffer at all) and evaluates entire blocks as a 1024 byte string once they have been loaded into a buffer (which is 1024 bytes in Tali, so it always contains an entire block when it has something in it).


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 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: