home .. forth .. misc mail list archive ..

No Subject


I need some help from the P21 assembly language gurus!  I'm working on a C
compiler for P21.  To save myself some work, I'd like to use some words
from P21Forth as a runtime library.  That is, I'd like to "call" words
from outside the normal Forth inner interpreter.  What I have so far is
appended below.  This looks kind of clumsy.  Is there a better way?  Thanks!

-Dave

VARIABLE IPSAVE
VARIABLE IPNEW
HERE 6 + IPNEW !

' TX!

ASSEMBLER

CODE CALL-TX!
  / some code...
  A PUSH IPSAVE # NOP
  A! POP !A IPNEW #
  A! # PUSH ;'
  IPSAVE # NOP A! @A
  A! NOP NOP NOP
  / some more code...
  NEXT
  END-CODE