[comp.lang.forth] NMI forth assembly routines

RAYBRO%HOLON@UTRCGW.UTC.COM ("William R Brohinsky", ay) (02/26/91)

>I have a single-board computer from New Micros Inc, based on their forth
>interpreter masked into the Motorola 68HC11.  As a novice to forth, I have
>enjoyed fiddling around with the thing.

>Now I would like to write some assembly-language routines for time-critical
>work that can be called from forth.  I have both the hardware manual (thin)
>for the SBC and the 318-page MAX-FORTH reference manual, but neither gives
>plain-English instructions for doing this.  I suspect that a well-seasoned
>forth user would find this documentation sufficient, but not me.  I have
>tried permutations of the following, to no avail:
>       CODE NAME1 01 END-CODE
>       CODE-SUB NAME2 01 39 END-CODE
>(where the 01 is a NOP and 39 is RTS)
>
>I have already hand-assembled the (short) routines.  I don't mind feeding
>hex into the SBC.
>
>I have noticed other users of NMI forth on this board.  Would anybody care to
>explain how to hook in these routines?  Thanks!

I'd say that your first problem is that you are putting these numbers
on the stack, but not putting them in the dictionary!

CODE-SUB NAME2 01 C, 39 C, END-CODE

will do that. As for hand assembling, I have the motorola freebie
assembler, which runs on an IBM PC, and use it to assemble all my code.
When it is done, I have it produce a listing, which I then edit with
brief (also on PC) to remove all original source, place C, after each
byte, add CODE or CODE-SUB to the beginning with an appropriate
name, and END-CODE to the end. brief has a convenient `capatilize all
letters' command, which I use because the listing's hex are all lower
case.

I also have a rather lengthy paper that I have been assembling about
the NMIX, and using it with lots of memory, external hardware,
code routines, autostarting with routines in EEPROM, etc.

For instance, I prefer to start with my dictionary going from $2000,
my stack in high memory, the PC's backspace (from kermit) as the
legitimate backspace character, and 64 character lines. I put this into
a code definition and placed it into the EEPROM, with a secondary autostart
code at the beginning of EEPROM. This allows me to just turn on the
NMIX board and start programming.

The paper is written in LaTeX, but most of the markup commands are
pretty obvious. Would you be interested in a copy, as it stands?
(It's not finished, but probably won't be until I'm finished using
NMIX boards [he,he,he!])

raybro
raybro@res.utrc.com