[comp.sys.amiga.programmer] Help with language writing needed

mlaidlaw@Daisy.EE.UND.AC.ZA (Mike Laidlaw) (05/23/91)

Help!

I'm writing a Forth-like language and am stuck.My problem is this,when
creating secondarys using the outer interpreter (editor) I am using absolute
memory jumps to primitives or other secondarys.I then save the dictionary to
disk as a straight memory dump.When I next load my language,AllocMem gives
me memory starting at a different address thus when I load my program,all the
absolute calls are incorrect thus my program bombs.My question is this,do I
save my sources as ascii text and compile them everytime I load the text back
in again,or is there some method of using indirect addressing within
secondarys? The problem with ascii text files is if I want to create whole
dictionarys which emulate another language which would take pretty long to
compile.

Does anyone know how JPForth or any other Forth does it?

Please Note : I am using assembly code to produce the language.

Thanks in Advance.

Myron 8->

My e-mail address is : mlaidlaw@Daisy.EE.UND.AC.ZA

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) (05/27/91)

In article <1991May23.082645.28243@Daisy.EE.UND.AC.ZA> mlaidlaw@Daisy.EE.UND.AC.ZA (Mike Laidlaw) writes:
>Help!
>
>I'm writing a Forth-like language and am stuck.My problem is this,when
>creating secondarys using the outer interpreter (editor) I am using absolute
>memory jumps to primitives or other secondarys.I then save the dictionary to
>disk as a straight memory dump.When I next load my language,AllocMem gives
>me memory starting at a different address thus when I load my program,all the
>absolute calls are incorrect thus my program bombs.My question is this,do I
>save my sources as ascii text and compile them everytime I load the text back
>in again,or is there some method of using indirect addressing within
>secondarys? The problem with ascii text files is if I want to create whole
>dictionarys which emulate another language which would take pretty long to
>compile.
>
>Does anyone know how JPForth or any other Forth does it?
>
>Please Note : I am using assembly code to produce the language.
>
>Thanks in Advance.
>
>Myron 8->
>
>My e-mail address is : mlaidlaw@Daisy.EE.UND.AC.ZA

If you point an address register at the base of your code (or if it is > 32K,
32K past the start of your code), you can use jsr offset(An) addressing mode
to get at your routine, no matter where you load.  You can also use PC relative
addressing mode (and use the address register trick for addresses between
64K and 128K from the start of the code).  Doing what you are doing would require
you to write out a hunk format file with reloc32 records to relocate your addresses...

--
****************************************************
* I want games that look like Shadow of the Beast  *
* but play like Leisure Suit Larry.                *
****************************************************