# Berkeley Pascal Assembler Kernel
.globl _interpret #normal interpreter entry point
# registers R0 - R6 are for scratch use
.set R2,0x004 #register fields in call mask
.set SIGINT,2 #interrupt signal
.set SIGFPE,8 #arithmetic exception signal
.set SIGSEGV,11 #segmentation violation
.set MASK,6 #offset of save mask in call stack
.set FP,12 #offset of "fp" in call stack
.set PC,16 #offset of "pc" in call stack
.set REGS,20 #beginning of saved registers in call stack
.set O_DATE,0346 #DATE opcode number
.set O_TIME,0347 #TIME opcode number
.set tempsize,-256 #maximum required temporary stack space
.set HZ,60 #interrupt frequency
.globl _display #runtime display
.globl _addrsze #size of addresses
.globl _file #current file name
.globl _bufopt #standard output buffering option
.globl _fchain #head of active file chain
.globl _llimit #max number of output lines
.globl _stcnt #number of stmts executed
.globl _stlim #max number of stmts to exec
.globl _nodump #1 => no postmortum dump
.globl _perrno #interpreter error number
.globl _profcnts #PX profile execution counts
.globl _pxpbuf #ptr to pxp buffer
.globl _pxpsize #size of pxp buffer
.globl _argc #number of passed args
.globl _argv #values of passed args
.globl __iob #base of I/O buffer block
# pascal specific subroutines
.globl _error #error message routine
.globl _palloc #heap allocator
.globl _pcttot #set constructor
.globl _pdattim #getting date, time info
.globl _perror #process pxp errors
# initializing the interpreter
.word 0xffc #register save mask
tstl 8(ap) #check for profiling
moval ploop,r8 #set profiling request
callg *4(ap),l0051 #set ap to base of program
bispsw $0xe0 #enable overflow traps
movl ap,r10 #program start address
pushal stderr #set up global file variables
movl _llimit,stderr+LLIMIT
movl _llimit,stdout+LLIMIT
jmp (r8) #begin interpreter
# the instruction 'jmp (loop)'