DOCOL in ITC Forth Engines (UK Newbie)
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

 Up
DOCOL in ITC Forth Engines (UK Newbie)         

Group: comp.lang.forth · Group Profile
Author: MarkWills
Date: Sep 19, 2008 00:19

Hi there,

I'm writing a traditional ITC FORTH implimentation on my favourite
processor, the very old TMS9900 (RISC, stackless).

I have a question regarding DOCOL.

Should DOCOL follow the 'norm' of having a CFA (code-field address) or
can it be considered a 'special' routine?

I couldn't get things working until I realised that EXIT needed one,
and I am starting to think that DOCOL does to.

Previously, my EXIT routine was:

exit dect r5
mov *r5,r3
jmp next

However, NEXT expects a CFA, so I changed it to:

exit data exit1
exit1 dect r5
mov *r5,r3
jmp next

(just added a pointer which points one (16 bit) word forward).

I think I have just convinced myself that DOCOL does indeed need a CFA
header, as it too is called by NEXT. Here's DOCOL:

docol mov r3,*r5+
inct r7
mov r7,3
jmp next

I think it should be:

docol data $+2
mov r3,*r5+
inct r7
mov r7,3
jmp next

Damn! I actually have it executing a simple FORTH thread too: BEGIN 1+
2+ AGAIN ;

Trouble is I had to put a hack in EXIT, and think this may be the
reason why.

I hope you guys don't mind me asking old questions about out of date
implementations!

Many thanks

Mark Wills
UK
6 Comments
diggit! del.icio.us! reddit!