Tamarin: Internal Software Structures(635)\f5b37B Alan Bell and Bill van Melle May 14, 1985e30\f5 Introductione50\f5 This document describes the internal data structures used in the Tamarin hardware and low-level software. This is intended to cover only the hardware. In places, it describes data formats when those are used by the hardware.e15\f5 The Tamarin hardware is built around a 40 bit word size. Internally, the machine will contain a small number of fixed size stack frames.e15\f5 e15\f5b Pointer Format\f5b The word size will be 40 bits. The pointer will be 34 bits. There will be three different formats depending on the TYP field.e15\f5 127b +-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* |TYP| SUBTYP | PTR | +-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 +-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* |TYP| SUBTYP | IMMEAD | +-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 +-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* |TYP| VALUE | +-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 TYP This field describes the basic type of the pointer. 00: 32 bit Integer 01: 32 bit Floating point 10: Pointer - subtype valid 11: Unusedl6656d2999e15(0,6656)\f5 SUBTYP This field describes the exact type of the object. The size of this field may be reduced by 1 bit. Some of the subtypes, such as atom, will point at normal objects. The purpose of having the type in the pointer is in the ease of determing the type. Additional datatypes can be added. 0: Object Header 32: Atom 33: Array 34: String Pointer 35: Stack Header - "stk" 36,37: Free Stack Frame - "sstk" (1 bit flag) 40: Function pointer - "fnptr" 41: Function Pointer 42: OBJECTl6656d2999e15\f5 PTR This field contains a word pointer when TYP=ptr and SUBTYP >=32. Not all 27 address bits will be used in the first implemetation of Tamarin.l6656d2999e15\f5 IMMEAD This field contains an immeadiate quantity when TYP=ptr and SUBTYP <32.l6656d2999e15\f5 VALUE This contains a 32 bit immeadiate value when the type field indicates floating or integer.l6656d2999e15\f5 e15(635)\f5b Types\f5b5f0B The type of an object is represented in the pointer. If the pointer type is OBJECT then the type is represted in the first word of the object. These different representations result in a single type description called the composite type index. Although it will sometimes be possible to determine the type from the datum alone (not using the pointer), this is not always the case.e15\f5 382b e15\f5b List Cells\f5b10B *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | GC |CDR| PTR | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 GC The GC field contains the reference count. See GC section.l6656d2999e15(0,6656)\f5 CDR This field contins CDR-coding information. 00 : CDR IS NIL 01: CDR IS PREV 10: CDR IS NEXT 11: CDR IN NEXTl6656d2999e15\f5 e15(635)\f5b Object Format\f5b13B *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | GC |0 0| "objhdr" | TYPEINDEX | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 GC The GC field contains the reference count. See GC section.l6656d2999e15(0,6656)\f5 TYPEINDEX This is an index which describes the type of the following object.l6656d2999e15\f5 e15(635)\f5b Atoms\f5b5B Atoms will be represented by a standard object with the type field of atom. The object will contain 4 cells plus the header.e15\f5 Atm *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 0: | GC | "objhdr" | TYPEINDEX = "atom" | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 1: | | VALUE CELL | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 2: | | FUNCTION CELL | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 3: | | PROPERTY LIST | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 4: | | PNAME PTR | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* e15\f8 e15\f5b Stack Structure\f5b15B 1. Stack Framee15\f5 The processor will keep several separate frames in its internal memory. These internal frames will be imaged in main memory. The frames will contain only one part. The maximum length of a complete stack frame will be 32 words.e15\f5 HDR *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 0: | | "stk" | FLAGS | TOS | USECNT | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 1: | | PC | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 2: | | FUNCTION HEADER | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 3: | | NAMETABLE | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 4: | | CLINK | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 5: | | ALINK | VARS *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 6: | | VAR0 | | | ... | | | VARi | STK *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | STK0 | | | ... | | | STKj | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* e15\f8 Flags The flags include: TrapEntry - UFN when this frame is entered by a return TrapExit- UFN when this frame is about to be exited Deref Alink- Dereference ALink on exiting. If this is set, TrapEntry must also be set. Large Frame- This frame stk blk is large No-Push- Don't push result when returned to.l6656d2999e15(0,6656)\f5 TOS The TOS fields indicates where the end of the stack is. It points into the internal frame.l6656d2999e15\f5 Usecnt The Usecnt field indicates if this frame is pointed to by any other frames or Stack pointers.l6656d2999e15\f5 PC This contains the program counter. It is represented as an integer with the low 3 bits selecting the byte. The high-order bits point directly at the word to be executed. There is no base value added in.l6656d2999e15\f5 CLink This field points to the previous frame.l6656d2999e15\f5 Function Header This field points at the start of the function's header.l6656d2999e15\f5 ALink This field points to the frame which denotes the previous access environment. If this field is UNBOUND, then the CLink should be used for the ALink. (An alternative is to fill in both the ALink and CLink at the same time. But this is hard since that location only wants to be filled with AssignStackAddress and not LoadStackBlocks.)l6656d2999e15\f5 Nametable This points to the nametable of the function. If it is unbound, then the function binds no names and the function should not be searched on free variable lookup. The field is set by the compiled code setting this location.l6656d2999e15\f5 234f8 Vars This section contains the IVars, PVars, and FVars. Each is indexed from a single offset . This field can contain indirect pointers.l6656d2999e15\f5 Stk This section contains the working stack. The start of the stack is determined by the number of IVars and PVars.l6656d2999e15\f5 116f8 2. Unused Stack Framese15(635)\f5 There will be two lists of unused stack frames. One list will contain full length stack frames. The other list will contain shorter frames. The Short Frame flag in the function header will select the later size. Unused stack frames will be contained in a linked list. The pointer in the first word points to the beginning of the next stack frame. The pointer will contain a flag - F. The flag will indicate that the number of free frames is getting low. If the machine uses a frame with the flag set, an internal note is made and the next time an interruptable opcode is about to be executed, a trap is taken. The flag must be set on all frames past a certain point in the chain. The minimum number of frames with the flag set are nbr internal frames + max non-interruptable calls. The hardware will not check if the end of the list is exceeded. All stack frames on the chain may be required to be locked in memory. The frames will be quad word aligned.e15\f5 147u11U *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 0: | | "sstk" |F| NEXTFRAME | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* 1: | | unused | | | ... | | | unused | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* e15\f8 3. Common Stack Operationse15\f5 Function Call Dump next internal frame if not empty Fetch Function Def cell Set new frame to "UNBOUND" Copy first 4 words of Function Header into Frame. Set low order three bits of PC from opcode. Copy args from old frame STK to new frame VARS Start at PCl6656d2999e15(0,6656)\f5 Start Function The function is started at the appropriate start address. All of the actions decribed here are performed by opcodes. See Argument preparation section for detailed description.l6656d2999e15\f5 Return Load previous frame if not present UFN if TrapExit(Current) set Fetch return value Deallocate old frame UFN if TrapEntry(prev) set Push return value unless No`push set Continue at PCl6656d2999e15\f5 Load Frame Read first quad word Read additional Quad word until TOSl6656d2999e15\f5 Dump Frame If no addresss then Assign Stack Address Write quad words until TOSl6656d2999e15\f5 Assign Stack Address Set address to next frame ptr Next frame ptr _ Read(NextFramePtr[size]) --size is determined by flag in the header.l6656d2999e15\f5 4. Argument preparatione15(635)\f5 If the number of arguments is greater than 7 or the caller feels that the callee is a NLAMBDA*, then the arguments are presented as a vector. The callee is then required to reformat the opcodes to a useful form.e15\f5 APPLY, APPLY* If the number of arguments are less than 8, then the arguements are put on the stack, else these functions prepare a vector.l6656d2999e15(0,6656)\f5 Number of Args>7 The caller writes all the args into a vector. It passes the vector and the number of args as the arguments of the function.l6656d2999e15\f5 e15(635)\f5b Function Header\f5b 1. Function definition cellse15\f5 Function Definition cells are:e15\f5 *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | "fnptr" | pointer to function header | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 2. Function headere15\f5 *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | "fnhdr" | 0 | TOS | 0 | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | |int| PC | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | FUNCTION HDR | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | NAMETABLE | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | "atom" | FUNCTION NAME | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | unused | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | unused | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | |int| NTSIZE | NLOCALS | FVAROFFSET | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | | "atom" | Var Name | | | ... | | | ... | | | Var Name | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | |int| Offset | | | ... | | | ... | | | Offset | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 The first four words are loaded verbatim into the first four words of the stack. The function hdr and Nametable fields simply point to the structure.e15\f5 3. Function entry vectore15\f5 The function is started at a location determined by the number of arguments in the call and by type of call.e15\f5 Entry 0: Vector of arguments provided (>7 args or NLambda*) 1-7: 0-6 arguments respectivelyl6656d2999e15(0,6656)\f5 In a normal Interlisp functions of 2 arguments, the opcodes will be 0: ERROR, 1: UFN(Move 2 args), 2: IVAR0_NIL, 3: IVar1_NIL, 4: JMP 12, 5: JMP 7, 6: NOP, 7: BINDUNB 3,3, 12: start of code.e15(635)\f5 e15\f5b Virtual Memory\f5b The page size will be 1024 words per page. The maximum real memory size will be 2 million words. The maximum possible virtual memory size will be 128 million words. The maximum virtual memory size on the initial version of Tamarin will be 16 million words. This means that there will be 16K virtual pages in the system. The mapping of virtual page into real address will be done by taking bits 23 through 10 and using them to index a resident mapping table. Each entry in the table will be one word. This word will contain 3 flags and the real page number. The flags are: entry valid, dirty, accessed. The first 2 million words of the virtual address space will refer directly to the real memory. No address translation will occur on these addresses. e15\f5 762b Map table entry:e15\f5 16f8 *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-* | GC |CDR| "int" | FLG | PAGE NUMBER | *-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*-+-+-+-+-+-+-+-*e15\f8 e15\f5b Garbage Collection\f5b In each cell there is a four bit field that contains the GC reference count information for that cell. This field is divided into a 3 bit refernce count field and a 1 bit overflow flag. A value of zero in the whole field means that there is one pointer to the object. If there are no non-stack pointers, then there will be a pointer to the object in the zero count table.e15\f5 When an additional pointer to an object is created, the reference count is incremented. If the field overflows past 7, a UFN trap occurs. If the overflow bit is off, an overflow entry is created with an reference count of 0. Then the trap gets the overflow entry the count in the entry is incremented by 4. In the GC field, the reference count field is decremented by 4.e15\f5 When a pointer to a objec is removed, its reference count field is decremented. If this decrements it past zero, a UFN trap occurs. The trap checks to see if the overflow flag is on. If so, the overflow field is decremented by 4. The objects reference count field is incremented by 4. If this causes the has entry to become zero, the entry is deleted and the overflow flag is turned off. If the overflow flag was not originally on, the reference count is incremented by one and the object is placed on the zero count queue.e15\f5 Periodically, the zero count queue is processed. Each entry is examined. First the reference count field is examined. If it has the overflow flag set of if the count is not 0, then the entry is removed from the queue and the reference count is decremented by one. If the entry is still on the stack, then the entry is requeued on the queue. If the entry is no longer on the stack, then it is deallocated.e15\f5 e15\f5b OPCODES\f5b 1. Constants:e15(0,6080)(1,8096)(2,9888)(3,11488)(4,13728)(5,15168)\f5 'T 1 Push "T" onto stackl8096d2999e15(0,7072)\f5 'NIL 1 Push "NIL" onto stackl8096d2999\f5 '0 1 Push "0" onto stackl8096d2999\f5 '1 1 Push "1" onto stackl8096d2999\f5 SIC 3 Push 1 byte positive integer onto stackl8096d2999\f5 SNIC 3 Push 1 byte negative integer onto stackl8096d2999\f5 PCONST 5 Push 4 byte pointer onto stackl8096d2999\f5 FCONST 5 Push 4 byte floating onto stackl8096d2999\f5 ICONST 5 Push 4 byte integer onto stackl8096d2999\f5 2. Variable access:e15(0,6080)\f5 VAR0-15 1 Push Var i onto stack.l8096d2999e15(0,7072)\f5 VARX.i 2 Push Var i onto stack.l8096d2999\f5 VARX_.i 2 Set Var i from stack.l8096d2999\f5 VARX_^.i 2 Set Var i from stack, pop stack.l8096d2999\f5 VVARX.i 2 Push Var i onto stack, don't follow indirect.l8096d2999\f5 VVARX_.i 2 Set Var i from stack, don't follow indirect.l8096d2999\f5 FVARX.i 2 Push Var i onto stack, UFN if unbound.l8096d2999\f5 FVARX_.i 2 Set Var i from stack, UFN if unbound.l8096d2999\f5 BINDNIL.n.k 3 Set Var k to k+n to "NIL".l8096d2999\f5 BINDUNB.n.k 3 Set Var k to k+n to "UNBOUND".l8096d2999\f5 VAR0-7_NIL 1 Set Var i to NIL.l8096d2999\f5 OVAR.n.m_ 3 Set Var m from frame current-n. This may trap to accomplish this function.l8096d2999\f5 43i44I OVAR.n.m 3 Push Var m from frame current-n. This may trap to accomplish this function.l8096d2999\f5 43i44I GVARX 5 Push GVar onto stack.l8096d2999\f5 GVARX_ 5 Set GVar from stack, do ref counts.l8096d2999\f5 e15(0,6080)\f5 3. Stack modificatione15\f5 COPY 1 This copies the TOS onto the stack.l8096d2999e15(0,7072)\f5 SWAP 1 This exchanges the TOS and TOS-1.l8096d2999\f5 POP 1 This pops one entry off the stack.l8096d2999\f5 SETTOSVAL.n 2 Saves the TOS val, sets TOS to n, pushs saved TOS val.l8096d2999\f5 SETTOS.n 2 This sets TOS to n.l8096d2999\f5 4. Testing and Type checkinge15(0,6080)\f5 EQ 1 Compare (TOS) and (TOS-1). Pushs T or NIL based on result of comparison.l8096d2999e15(0,7072)\f5 LISTP 1 Return arg if LISTP, else NIL.l8096d2999e10\f5 NTYPEX 1 Return composite type index of (TOS).l8096d2999\f5 TYPEP.n 3 Return (TOS) if its composite type index is eq to n, else return NIL.l8096d2999\f5 DTEST.n 3 Return (TOS) if its composite type index is eq to n, else UFN.l8096d2999\f5 TYPECHECK.n 3 Same as DTEST.l8096d2999\f5 TYPEMASK.n 2 This needs to be worked out.l8096d2999\f5 13i27I 5. Binary Ops:e15(0,6080)\f5 PLUS 1 Add TOS and TOS-1, UFN if not int, ovfll8096d2999e15(0,7072)\f5 DIFFER 1 Sub TOS and TOS-1, UFN if not int, ovfll8096d2999\f5 LOGAND 1 And TOS and TOS-1, UFN if not int, ovfll8096d2999\f5 LOGOR 1 Or TOS and TOS-1, UFN if not int, ovfll8096d2999\f5 LOGXOR 1 Xor TOS and TOS-1, UFN if not int, ovfll8096d2999\f5 TIMES 1 Mul TOS and TOS-1, UFN if not int, ovfll8096d2999\f5 QUOTIENT 1 Div TOS and TOS-1, UFN if not int, ovfll8096d2999\f5 REMAINDER 1 Rem TOS and TOS-1, UFN if not int, ovfll8096d2999\f5 GREATERP 1 Cmp TOS and TOS-1, Push T or NIL, UFN if not intl8096d2999\f5 LLSH.n 2 Logical Left shift. This takes (TOS), shifts it left n, and pushes back onto the stack. It traps if (TOS) is not an integer.l8096d2999\f5 LRSH.n 2 Logical Right shift. This takes (TOS), shifts it right n, and pushes back onto the stack. It traps if (TOS) is not an integer.l8096d2999\f5 FEXT.fd 2 Field Extract. This takes (TOS), extracts the field described by fd, and pushes the result onto the stack. It traps if (TOS) is not an integer. This does not sign extend the field.l8096d2999\f5 FINS.fd 2 Field Insert. This takes (source, dest) on the stack, inserts source into the field described by fd in dest, and pushes the result onto the stack. It traps if source and dest are not an integer.l8096d2999\f5 6. Memory Access:e15(0,6080)\f5 GETBASEPTR.n 2 Takes (PTR) on stack. Retrives 34 bit ptr at PTR+n. The result will have the same data type as the word in memory.l8096d2999e15(0,7072)\f5 PUTBASEPTR.n 2 Takes (PTR, newval) on stack, leaves PTR on stack, stores newval at PTR+n. Does not reference count anything. Does not trap.l8096d2999\f5 RPLPTR.n 2 Takes (PTR, newval) on stack, leaves PTR on stcak, deleteref value at PTR+n, addref newval, stores newval at PTR+n. The reference count operations will be queued until this opcode finishs. Does not trap.l8096d2999\f5 GETBITS.n.fd 3 Takes (PTR) on stack. Retrieves field specified by fd from location PTR+n. The type of the result is set to integer. This will actually be four opcodes since it takes 10 bits to specify all fields.l8096d2999e10\f5 PUTBITS.n.fd 3 Takes (PTR, newval) on stack, leaves PTR on stack, stores newval into field specified by fd at location PTR+n. This is actualloy 4 opcodes. This punts if newval isn't an integer.l8096d2999\f5 GETBASEBYTE 1 Takes (PTR, offset) on stack. Shifts offset right 2 bits. Retrieves word at PTR+(offset rsh 2). Pushs byte selected by low low bits of offset onto stack.l8096d2999e10\f5 PUTBASEBYTE 1 Takes (PTR, offset, byte) on stack, leaves PTR on stack. Stores byte at byte position selected by low 2 bits of offset at location PTR+(offset rsh 2). This traps if offset is not an integer.l8096d2999\f5 ADDBASE 1 Takes (PTR, offset) on stack. Leaves PTR+int on stack. This traps if integer is not an integer.l8096d2999e10\f5 7. List Operationse15(0,6080)\f5 CONS 1l8096d2999e10(0,7072)\f5 RPLCONS 1l8096d2999e1\f5 CAR 1 This takes the CAR of the (TOS). It traps if the argument is not LISTP or if the CAR cell is an indirect pointer.l8096d2999e1\f5 CDR 1 This takes the CDR of the (TOS). It traps if the argument is not listp of if the CAR cell is an indirect pointer. This may just implement the CDR next and CDR prev tags in hardware.l8096d2999e1\f5 122i66I RPLACA 1 This replaces the CAR field of the (TOS). It traps if the argument is not LISTP or if the CAR cell is an indirect pointer.l8096d2999e1\f5 RPLACD 1 This always traps.l8096d2999e1\f5 8. Garbage Collection / Storage Allocatione15(0,6080)\f5 INCREF 1 This increments the reference count of the word pointed at by TOS by 1. If the field is 7, the field is incremented and then a UFN trap occurs.l8096d2999e10(0,7072)\f5 INCREFNT 1 This increments the reference count of the word pointed at by TOS by 1. This does not trap.l8096d2999e10\f5 DECREF 1 This decrements the reference count of the word pointed at by TOS by 1. If the field is 0, the field is decremented and then a UFN trap occurs.l8096d2999e10\f5 OFFSETREF 1 This complements the high-order bit in the reference count field of the word pointed at by (TOS). This is equivelent to adding (or subtracting) a reference count of 4.l8096d2999e10\f5 9. Function Calls:e15(0,6080)\f5 FN0-6 5 Call function with k argumentsl8096d2999e10(0,7072)\f5 FNL 5 Call function with list of argumentsl8096d2999e10\f5 APPLYFN 1 Call function. This takes the name of the function and the entry vector offset on the stack.l8096d2999e10\f5 RETURN 1 Returnl8096d2999e10\f5 CONTEXTSWITC 1 Context Switch - I need input on the requirements for this opcode.l8096d2999e10\f5 32i49I MYALINK 1 This returns the address of the previous frame. If the previous frame does not have a frame assigned, it dumps the previous frame first.l8096d2999e10\f5 10. Jumps:e15(0,6080)\f5 NOP 1 No operationl8096d2999e10(0,7072)\f5 JUMP2-17 1 This unconditionally jumps k bytes forward.l8096d2999e1\f5 JUMPX 2 This jumps up to (+128, -127) locations.l8096d2999e1\f5 JUMPXX 3 The 2 bytes of the opcode are added to the PC to get the new PC.l8096d2999e1\f5 FJUMP2-17 1 This jumps k bytes forward if TOS is NIL It pops the stack..l8096d2999e1\f5 FJUMPX 2 This jumps up to (+128, -127) locations if TOS is not NIL. It posp the stack.l8096d2999e1\f5 TJUMP2-17 1 This jumps k bytes forward if TOS is not NIL. It pops the stack.l8096d2999e1\f5 TJUMPX 2 This jumps up to (+128, -127) locations if TOS is not NIL. It posp the stack.l8096d2999e1\f5 NFJUMPX 2 This jumps up to (+128, -127) locations if TOS is NIL. It posp the stack if the jump is taken.l8096d2999e1\f5 NTJUMPX 2 This jumps up to (+128, -127) locations if TOS is not NIL. It posp the stack if the jump is taken.l8096d2999e1\f5 e15(635)