! (c) copyright 1984 by the Vrije Universiteit, Amsterdam, The Netherlands.
! See the copyright notice in the ACK home directory, in the file "Copyright".
!=========================================================================

! This is an interpreter for EM programs with no virtual memory for the
! the PMDS-II . This interpreter is adapted from an interpreter which was
! made for the pdp11 by Evert Wattel and Hans van Staveren . The present
! version is made by Freek van Schagen
!		     Vrije Universiteit
!		     Amsterdam.
! Heavily modified by Ceriel Jacobs for better system-call support,
! floating point, and other miscellaneous fixes


!-------------------------------------------------------------------------

! The program requires preprocessing by the C-preprocessor . There are
! several options :
!	lword:  4byte word size in stead of 2 byte word size ;
!	test:   checking for undefined variables , nil pointers
!		array indices , overflow , etc ;
!	last:	generation of a file with the last 16 lines executed ;
!	count:	generation of a file with a flow count ;
!	flow:	generation of a file with a flow bitmap ;
!	prof:	generation of a file with a runtime profile ;
!	opfreq:	generation of a file with a frequency count per opcode.

!--------------------------------------------------------------------------

! Memory layout:

!  --------------------------------------------------------------------------
!  |		|	|     |		|	|	|	|	|   |
!  |	1	|   2	|  3  |	   4	|   5	|   6	|   	|   7	| 8 |
!  |		|	|     |		|	|	|	|	|   |
!  --------------------------------------------------------------------------

!	1:	Interpreter text+data+bss.
!	2:	EM text.
!	3:	EM procedure descriptors.
!	4:	EM global data area.
!	5:	tables for flow , count , profile.
!	6:	EM heap area.
!	7:	EM local data and stack.
!	8:	Arguments to the interpreter .


!REGISTER USE
!	pc	programcounter
!	a7=sp	stackpointer		d7	if lword: 1 , if not lword: 0
!	a6	external base= eb	d6	0
!	a5	scratch			d5	scratch
!	a4	address of loop		d4	scratch
!	a3	EM programcounter	d3	scratch
!	a2	local base =lb		d2	scratch
!	a1	address of return area	d1	scratch
!	a0	scratch			d0	opcode byte and scratch