added PDX constant
[unix-history] / usr / src / usr.bin / pascal / px / interp.c
index 29b3a99..8a24aba 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)interp.c 1.16 %G%";
+static char sccsid[] = "@(#)interp.c 1.17 %G%";
 
 #include <math.h>
 #include "whoami.h"
 
 #include <math.h>
 #include "whoami.h"
@@ -90,6 +90,13 @@ struct iorec *_actfile[MAXFILES] = {
        ERR
 };
 
        ERR
 };
 
+/*
+ * stuff for pdx
+ */
+
+union progcntr *pcaddrp;
+asm(".globl _loopaddr");
+
 /*
  * Px profile array
  */
 /*
  * Px profile array
  */
@@ -128,6 +135,8 @@ interpreter(base)
        union progcntr tpc;
        struct iorec **ip;
 
        union progcntr tpc;
        struct iorec **ip;
 
+       pcaddrp = &pc;
+
        /*
         * Setup sets up any hardware specific parameters before
         * starting the interpreter. Typically this is inline replaced
        /*
         * Setup sets up any hardware specific parameters before
         * starting the interpreter. Typically this is inline replaced
@@ -150,6 +159,8 @@ interpreter(base)
        stp = (struct stack *)pushsp((long)(sizeof(struct stack)));
        _dp = &_display.frame[0];
        pc.cp = base;
        stp = (struct stack *)pushsp((long)(sizeof(struct stack)));
        _dp = &_display.frame[0];
        pc.cp = base;
+
+       asm("_loopaddr:");
        for(;;) {
 #              ifdef DEBUG
                if (++opcptr == 10)
        for(;;) {
 #              ifdef DEBUG
                if (++opcptr == 10)
@@ -160,6 +171,10 @@ interpreter(base)
                _profcnts[*pc.ucp]++;
 #              endif PROFILE
                switch (*pc.ucp++) {
                _profcnts[*pc.ucp]++;
 #              endif PROFILE
                switch (*pc.ucp++) {
+               case O_BPT:                     /* breakpoint trap */
+                       asm(".byte 0");
+                       pc.ucp--;
+                       continue;
                case O_NODUMP:
                        _nodump = TRUE;
                        /* and fall through */
                case O_NODUMP:
                        _nodump = TRUE;
                        /* and fall through */