\r
/***************************************************************/\r
/************** Static Prototypes ******************************/\r
/***************************************************************/\r
\r
static void ffStringColon( const ForthStringPtr FName );\r
\r
/***************************************************************/\r
/************** Static Prototypes ******************************/\r
/***************************************************************/\r
\r
static void ffStringColon( const ForthStringPtr FName );\r
** Create an entry in the Dictionary for the given ExecutionToken.\r
** FName is name in Forth format.\r
*/\r
** Create an entry in the Dictionary for the given ExecutionToken.\r
** FName is name in Forth format.\r
*/\r
\r
/* Advance Header Dictionary Pointer */\r
gCurrentDictionary->dic_HeaderPtr.Byte += sizeof(cfNameLinks);\r
\r
/* Advance Header Dictionary Pointer */\r
gCurrentDictionary->dic_HeaderPtr.Byte += sizeof(cfNameLinks);\r
/***************************************************************\r
** Convert name then create dictionary entry.\r
*/\r
/***************************************************************\r
** Convert name then create dictionary entry.\r
*/\r
- RelNamePtr = READ_LONG_DIC((const cell *) (&cfnl->cfnl_PreviousName));\r
-/* DBUG(("\nNameToPrevious: RelNamePtr = 0x%x\n", (int32) RelNamePtr )); */\r
+ RelNamePtr = READ_CELL_DIC((const cell_t *) (&cfnl->cfnl_PreviousName));\r
+/* DBUG(("\nNameToPrevious: RelNamePtr = 0x%x\n", (cell_t) RelNamePtr )); */\r
/* Convert absolute namefield address to absolute link field address. */\r
cfnl = (const cfNameLinks *) ( ((const char *) NFA) - sizeof(cfNameLinks) );\r
\r
/* Convert absolute namefield address to absolute link field address. */\r
cfnl = (const cfNameLinks *) ( ((const char *) NFA) - sizeof(cfNameLinks) );\r
\r
{\r
if( ffFindC( "(QUIT)", &gQuitP_XT ) == 0) goto nofind;\r
if( ffFindC( "NUMBER?", &gNumberQ_XT ) == 0) goto nofind;\r
if( ffFindC( "ACCEPT", &gAcceptP_XT ) == 0) goto nofind;\r
{\r
if( ffFindC( "(QUIT)", &gQuitP_XT ) == 0) goto nofind;\r
if( ffFindC( "NUMBER?", &gNumberQ_XT ) == 0) goto nofind;\r
if( ffFindC( "ACCEPT", &gAcceptP_XT ) == 0) goto nofind;\r
CreateDicEntryC( ID_BODY_OFFSET, "BODY_OFFSET", 0 );\r
CreateDicEntryC( ID_BYE, "BYE", 0 );\r
CreateDicEntryC( ID_CATCH, "CATCH", 0 );\r
CreateDicEntryC( ID_BODY_OFFSET, "BODY_OFFSET", 0 );\r
CreateDicEntryC( ID_BYE, "BYE", 0 );\r
CreateDicEntryC( ID_CATCH, "CATCH", 0 );\r
CreateDicEntryC( ID_CFETCH, "C@", 0 );\r
CreateDicEntryC( ID_CMOVE, "CMOVE", 0 );\r
CreateDicEntryC( ID_CMOVE_UP, "CMOVE>", 0 );\r
CreateDicEntryC( ID_CFETCH, "C@", 0 );\r
CreateDicEntryC( ID_CMOVE, "CMOVE", 0 );\r
CreateDicEntryC( ID_CMOVE_UP, "CMOVE>", 0 );\r
** ( xt -- nfa 1 , x 0 , find NFA in dictionary from XT )\r
** 1 for IMMEDIATE values\r
*/\r
** ( xt -- nfa 1 , x 0 , find NFA in dictionary from XT )\r
** 1 for IMMEDIATE values\r
*/\r
** ( $name -- $addr 0 | nfa -1 | nfa 1 , find NFA in dictionary )\r
** 1 for IMMEDIATE values\r
*/\r
** ( $name -- $addr 0 | nfa -1 | nfa 1 , find NFA in dictionary )\r
** 1 for IMMEDIATE values\r
*/\r
NameChar = NameField+1;\r
/* DBUG((" %c\n", (*NameField & FLAG_SMUDGE) ? 'S' : 'V' )); */\r
if( ((*NameField & FLAG_SMUDGE) == 0) &&\r
NameChar = NameField+1;\r
/* DBUG((" %c\n", (*NameField & FLAG_SMUDGE) ? 'S' : 'V' )); */\r
if( ((*NameField & FLAG_SMUDGE) == 0) &&\r
\r
Result = ffFindNFA( WordName, &NFA );\r
DBUG(("ffFind: %8s at 0x%x\n", WordName+1, NFA)); /* WARNING, not NUL terminated. %Q */\r
\r
Result = ffFindNFA( WordName, &NFA );\r
DBUG(("ffFind: %8s at 0x%x\n", WordName+1, NFA)); /* WARNING, not NUL terminated. %Q */\r
/****************************************************************\r
** Find name when passed 'C' string.\r
*/\r
/****************************************************************\r
** Find name when passed 'C' string.\r
*/\r
{\r
DBUG(("ffFindC: %s\n", WordName ));\r
CStringToForth( gScratch, WordName );\r
{\r
DBUG(("ffFindC: %s\n", WordName ));\r
CStringToForth( gScratch, WordName );\r
/*************************************************************\r
** Check for dictionary overflow. \r
*/\r
/*************************************************************\r
** Check for dictionary overflow. \r
*/\r
RoomLeft = gCurrentDictionary->dic_HeaderLimit -\r
gCurrentDictionary->dic_HeaderPtr.Byte;\r
if( RoomLeft < DIC_SAFETY_MARGIN )\r
RoomLeft = gCurrentDictionary->dic_HeaderLimit -\r
gCurrentDictionary->dic_HeaderPtr.Byte;\r
if( RoomLeft < DIC_SAFETY_MARGIN )\r
/*************************************************************\r
** Check to see if name is already in dictionary.\r
*/\r
/*************************************************************\r
** Check to see if name is already in dictionary.\r
*/\r
ExecToken XT;\r
\r
flag = ffFind( FName, &XT);\r
if ( flag && !gVarQuiet)\r
{\r
ExecToken XT;\r
\r
flag = ffFind( FName, &XT);\r
if ( flag && !gVarQuiet)\r
{\r
\r
/**************************************************************/\r
/* Used to pull a number from the dictionary to the stack */\r
\r
/**************************************************************/\r
/* Used to pull a number from the dictionary to the stack */\r
temp = (PF_FLOAT *)CODE_HERE;\r
WRITE_FLOAT_DIC(temp,fnum); /* Write to dictionary. */\r
temp++;\r
temp = (PF_FLOAT *)CODE_HERE;\r
WRITE_FLOAT_DIC(temp,fnum); /* Write to dictionary. */\r
temp++;\r
}\r
#endif /* PF_SUPPORT_FP */\r
\r
/**************************************************************/\r
ThrowCode FindAndCompile( const char *theWord )\r
{\r
}\r
#endif /* PF_SUPPORT_FP */\r
\r
/**************************************************************/\r
ThrowCode FindAndCompile( const char *theWord )\r
{\r
ThrowCode exception = 0;\r
\r
Flag = ffFind( theWord, &XT);\r
ThrowCode exception = 0;\r
\r
Flag = ffFind( theWord, &XT);\r
\r
DBUG(("FindAndCompile: not found, try number?\n" ));\r
PUSH_DATA_STACK( theWord ); /* Push text of number */\r
\r
DBUG(("FindAndCompile: not found, try number?\n" ));\r
PUSH_DATA_STACK( theWord ); /* Push text of number */\r
DBUG(("ffInterpret: IN=%d, SourceNum=%d\n", gCurrentTask->td_IN,\r
gCurrentTask->td_SourceNum ) );\r
}\r
DBUG(("ffInterpret: IN=%d, SourceNum=%d\n", gCurrentTask->td_IN,\r
gCurrentTask->td_SourceNum ) );\r
}\r
/* Check for stack underflow. %Q what about overflows? */\r
if( (gCurrentTask->td_StackBase - gCurrentTask->td_StackPtr) < 0 )\r
{\r
/* Check for stack underflow. %Q what about overflows? */\r
if( (gCurrentTask->td_StackBase - gCurrentTask->td_StackPtr) < 0 )\r
{\r
***************************************************************/\r
ThrowCode ffOuterInterpreterLoop( void )\r
{\r
***************************************************************/\r
ThrowCode ffOuterInterpreterLoop( void )\r
{\r
***************************************************************/\r
Err ffPushInputStream( FileStream *InputFile )\r
{\r
***************************************************************/\r
Err ffPushInputStream( FileStream *InputFile )\r
{\r
/***************************************************************\r
** Convert file pointer to value consistent with SOURCE-ID.\r
***************************************************************/\r
/***************************************************************\r
** Convert file pointer to value consistent with SOURCE-ID.\r
***************************************************************/\r
/***************************************************************\r
** Convert file pointer to value consistent with SOURCE-ID.\r
***************************************************************/\r
/***************************************************************\r
** Convert file pointer to value consistent with SOURCE-ID.\r
***************************************************************/\r
** ( -- , fill Source from current stream )\r
** Return 1 if successful, 0 for EOF, or a negative error.\r
*/\r
** ( -- , fill Source from current stream )\r
** Return 1 if successful, 0 for EOF, or a negative error.\r
*/\r