The CP/M SAVE routine works as an hForth SAVESYSTEM

1 view
Skip to first unread message

BruceMcF

unread,
Apr 4, 2008, 1:16:30 AM4/4/08
to Niclos-for-Forth-94
This was taken from Brad Rodriguez's documentation for the CP/M
version of the Z80 CamelForth. See below.

I defined a word ``save#'' to return the parameter for the CP/M SAVE
command (based on below), and sure enough, it came back with an
"hfnew.com" that loaded and contained the "save#" word.

In hForth:

: save# ( -- #pages ) HERE 0 256 UM/MOD . DROP ;

then ``BYE'', then using the number returned (replacing ## below):

SAVE ## hfnew.com

Sadly, when trying to SUBMIT source, as described below for
CamelForth, there does not seem to be any response from hForth, but
the ability to SAVESYSTEM is the cornerstone of boostrapping a version
with a working INCLUDED ... and that then will allow further program
development.

http://www.camelforth.com/page.php?5

QUOTE

Program Development

Disk I/O is not yet supported under CP/M. However, CamelForth v1.2
will accept commands from a CP/M SUBMIT file using the XSUB utility.
The SUBMIT file should contain the commands

XSUB
CAMEL80
...Forth source code...

This will run CamelForth/80 under XSUB, which will feed the rest of
the file to CamelForth as terminal input. You can automatically return
to CP/M by putting the CamelForth BYE command in the file. Then you
can save the modified CamelForth image with the CP/M command

SAVE nn CAMELNEW.COM

'nn' is the decimal number of pages occupied by the CamelForth
dictionary. You can determine this value while in CamelForth with the
statement

DECIMAL HERE 0 256 UM/MOD NIP .

Unfortunately, at the moment there's no way to totally automate this
as part of the SUBMIT file. And I'm reluctant to add SAVE to
CamelForth when CP/M has a perfectly good SAVE command.

UNQUOTE
Reply all
Reply to author
Forward
0 new messages