Hi all,

SamForth seems a clever implementation of the language.  Forth words are
direct Z80 rutines (contrary to many other 8-bit implementations, the
Z80 stack is used as Forth return stack and the Forth data stack is
handled apart), thus Z80 code can be easily mixed with Forth code.
Unfortunately its sources are lost.  With some changes (e.g the way
handling the Forth sources) and updates (e.g. some missing features
already present in most modern Forth systems), SamForth would be very
interesting for cross-development: the easy of MasterBASIC combined with
machine code speed.

I've started to disassemble SamForth, as a "background" slow project.
It will take a lot of time because of course the disassembler needs to
know what is Z80 code and what is data.  Every Forth word in the
dictionary has a header before its code, as usual in most Forth systems.
Therefore all those data address ranges must be marked by hand first.
For example:

  drop_header: start 0x921b end 0x9221 type bytedata
  interpret_header: start 0x9224 end 0x922f type bytedata
  bracket_find_header: start 0x92e0 end 0x92eb type bytedata
  number_header: start 0x93cc end 0x93d4 type bytedata

Has anyone tried this before and maybe has some information to share?

For John Avis:

Do you remember the meaning of the two bytes before the name length in
the word header, or any other relevant information not included in the
docs?  Everything can be eventually found out from the Z80 code, but any
information would be helpful and will save time.

Thank you.

Marcos

-- 
http://programandala.net

Reply via email to