X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/c075df18e474b68803f6b28c1b9465b7e0343849..c3c85287fd9b80455b39ebf30f57a28bfe7aa68b:/usr/src/usr.bin/pascal/px/interp.c diff --git a/usr/src/usr.bin/pascal/px/interp.c b/usr/src/usr.bin/pascal/px/interp.c index 1a55db83b7..809d092db0 100644 --- a/usr/src/usr.bin/pascal/px/interp.c +++ b/usr/src/usr.bin/pascal/px/interp.c @@ -1,6 +1,6 @@ /* Copyright (c) 1979 Regents of the University of California */ -static char sccsid[] = "@(#)interp.c 1.5 %G%"; +static char sccsid[] = "@(#)interp.c 1.8 %G%"; #include #include "vars.h" @@ -110,17 +110,24 @@ interpreter(base) /* * the following variables are used as scratch */ - double td, td1; + register char *tcp; register long tl, tl1, tl2; + double td, td1; + struct sze8 t8; long *tlp; short *tsp, *tsp1; - register char *tcp; char *tcp1; struct stack *tstp; struct formalrtn *tfp; union progcntr tpc; struct iorec **ip; + /* + * Setup sets up any hardware specific parameters before + * starting the interpreter. Typically this is inline replaced + * by interp.sed to utilize specific machine instructions. + */ + setup(); /* * necessary only on systems which do not initialize * memory to zero @@ -510,8 +517,8 @@ interpreter(base) continue; case O_AS8: pc.cp++; - td = pop8(); - *(double *)popaddr() = td; + t8 = popsze8(); + *(struct sze8 *)popaddr() = t8; continue; case O_AS: tl = *pc.cp++; @@ -841,13 +848,13 @@ interpreter(base) continue; case O_RV8: tcp = _display.raw[*pc.ucp++]; - push8(*(double *)(tcp + *pc.sp++)); + pushsze8(*(struct sze8 *)(tcp + *pc.sp++)); continue; case O_RV: tcp = _display.raw[*pc.ucp++]; tcp += *pc.sp++; tl = *pc.usp++; - tcp1 = pushsp(tl); + tcp1 = pushsp((tl + 1) & ~1); blkcpy(tl, tcp, tcp1); continue; case O_LV: @@ -876,7 +883,7 @@ interpreter(base) continue; case O_LRV8: tcp = _display.raw[*pc.ucp++]; - push8(*(double *)(tcp + *pc.lp++)); + pushsze8(*(struct sze8 *)(tcp + *pc.lp++)); continue; case O_LRV: tcp = _display.raw[*pc.ucp++]; @@ -911,7 +918,7 @@ interpreter(base) continue; case O_IND8: pc.cp++; - push8(*(double *)(popaddr())); + pushsze8(*(struct sze8 *)(popaddr())); continue; case O_IND: tl = *pc.cp++; @@ -1048,7 +1055,7 @@ interpreter(base) if (tl1 == *tcp++) break; if (tl == 0) /* default case => error */ - ERROR(ECASE, tl2); + ERROR(ECASE, tl1); pc.cp += *(tsp - tl); continue; case O_CASE2OP: @@ -1062,7 +1069,7 @@ interpreter(base) if (tl1 == *tsp1++) break; if (tl == 0) /* default case => error */ - ERROR(ECASE, tl2); + ERROR(ECASE, tl1); pc.cp += *(tsp - tl); continue; case O_CASE4OP: @@ -1076,7 +1083,7 @@ interpreter(base) if (tl1 == *tlp++) break; if (tl == 0) /* default case => error */ - ERROR(ECASE, tl2); + ERROR(ECASE, tl1); pc.cp += *(tsp - tl); continue; case O_ADDT: