aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel C. Sobral <dcs@FreeBSD.org>1999-04-06 02:43:06 +0000
committerDaniel C. Sobral <dcs@FreeBSD.org>1999-04-06 02:43:06 +0000
commit459b9f6fce4aa3a0d538d153563b6c75ccb40221 (patch)
tree2ebb5cd6792178f13639e8dd77ee6f14e6f703ee
parentb10532acb64315442d1e7795a7a3042e61d90ff7 (diff)
Notes
-rw-r--r--sys/boot/ficl/Makefile4
-rw-r--r--sys/boot/ficl/ficl.c25
2 files changed, 16 insertions, 13 deletions
diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
index 74eca13356f72..ab10716207042 100644
--- a/sys/boot/ficl/Makefile
+++ b/sys/boot/ficl/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.8 1999/02/04 17:13:30 dcs Exp $
+# $Id: Makefile,v 1.9 1999/03/17 23:03:36 dcs Exp $
#
LIB= ficl
NOPROFILE= yes
@@ -14,7 +14,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr
#SOFTWORDS+= oo.fr classes.fr
.PATH: ${.CURDIR}/softwords
-CFLAGS+= -I${.CURDIR} # -DFICL_TRACE
+CFLAGS+= -I${.CURDIR} -DFICL_TRACE
softcore.c: ${SOFTWORDS} softcore.awk
(cd ${.CURDIR}/softwords; cat ${SOFTWORDS} | awk -f softcore.awk) > ${.TARGET}
diff --git a/sys/boot/ficl/ficl.c b/sys/boot/ficl/ficl.c
index 2dada3db4f6c0..9274c1bfebebc 100644
--- a/sys/boot/ficl/ficl.c
+++ b/sys/boot/ficl/ficl.c
@@ -176,6 +176,9 @@ int ficlBuild(char *name, FICL_CODE code, char flags)
**************************************************************************/
int ficlExec(FICL_VM *pVM, char *pText, INT32 size)
{
+#ifdef FICL_TRACE
+ extern int isAFiclWord(FICL_WORD *pFW);
+#endif
int except;
FICL_WORD *tempFW;
jmp_buf vmState;
@@ -230,7 +233,7 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size)
if (tempFW->code == literalParen)
{
- c = *(pVM->ip);
+ c = *PTRtoCELL(pVM->ip);
if (isAFiclWord(c.p))
{
FICL_WORD *pLit = (FICL_WORD *)c.p;
@@ -242,12 +245,12 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size)
}
else if (tempFW->code == stringLit)
{
- FICL_STRING *sp = (FICL_STRING *)(void *)pVM->ip;
+ FICL_STRING *sp = PTRtoSTRING(pVM->ip);
sprintf(buffer, " s\" %.*s\"", sp->count, sp->text);
}
else if (tempFW->code == ifParen)
{
- c = *pVM->ip;
+ c = *PTRtoCELL(pVM->ip);
if (c.i > 0)
sprintf(buffer, " if / while (branch rel %ld)", c.i);
else
@@ -255,7 +258,7 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size)
}
else if (tempFW->code == branchParen)
{
- c = *pVM->ip;
+ c = *PTRtoCELL(pVM->ip);
if (c.i > 0)
sprintf(buffer, " else (branch rel %ld)", c.i);
else
@@ -263,23 +266,23 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size)
}
else if (tempFW->code == qDoParen)
{
- c = *pVM->ip;
+ c = *PTRtoCELL(pVM->ip);
sprintf(buffer, " ?do (leave abs %#lx)", c.u);
}
else if (tempFW->code == doParen)
{
- c = *pVM->ip;
+ c = *PTRtoCELL(pVM->ip);
sprintf(buffer, " do (leave abs %#lx)", c.u);
}
else if (tempFW->code == loopParen)
{
- c = *pVM->ip;
- sprintf(buffer, " loop (branch rel %#ld)", c.i);
+ c = *PTRtoCELL(pVM->ip);
+ sprintf(buffer, " loop (branch rel %ld)", c.i);
}
else if (tempFW->code == plusLoopParen)
{
- c = *pVM->ip;
- sprintf(buffer, " +loop (branch rel %#ld)", c.i);
+ c = *PTRtoCELL(pVM->ip);
+ sprintf(buffer, " +loop (branch rel %ld)", c.i);
}
else /* default: print word's name */
{
@@ -292,7 +295,7 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size)
* - punt and print value
*/
{
- sprintf(buffer, " %ld (%#lx)", ((CELL*)pVM->ip)->i, ((CELL*)pVM->ip)->u);
+ sprintf(buffer, " %ld (%#lx)", (PTRtoCELL(pVM->ip))->i, (PTRtoCELL(pVM->ip))->u);
vmTextOut(pVM, buffer, 1);
}
#endif FICL_TRACE