Patent GB-1495514-A (GB)
Title: Procedure calls and stack mechanism
IPC: G06F9/44
Filed: 1974-11-28
Abstract: 1495514 Data processing COMPAGNIE INTERNATIONALE POUR L'INFORMATIQUE CII HONEYWELL BULL 28 Nov 1974 [30 Nov 1973] 51654/74 Heading G4A An automatic data processing system, in which information is processed under the control of procedures each assigned a maximum ring number, includes a memory in the form of a push down store for storing information in stacks, each stack being associated with an address space bounded by a segment having a predetermined ring number and a central processing unit of control the CPU being transferable from a procedure having a higher ring number to a procedure having a lower ring number. Segments of memories are shared by several processes. A ring system is utilized having four classes 0-3 into which are grouped procedure and data segments, class 0 having the highest level of system privilege. Every procedure has a minimum and maximum execute ring number assigned to it to specify who may call it. The following rules apply: (1) a procedure in an inner ring has free access to data in an outer ring; (2) a procedure in an outer ring cannot access data in an inner ring; (3) a procedure in an outer ring can branch to a procedure in an inner ring but not vice versa; (4) each segment containing data has two ring values one for read and one for write. The central processor unit is operated under the control of micro instructions, a control store array (1333, Fig. 4b, not shown) being addressed by the contents of a register (1337) which receives an address from hardware registers (1335, 1336) in control store unit sequence control, the microinstruction read out being decoded to provide control signals. The CPU includes general registers, base registers, scientific registers, a T register (locating the top of the stack of the currently running process, stack segments being dynamically allocated to each procedure), status registers and an instruction counter. A procedure is accessed by an "enter procedure instruction" (ENT) which is a 32 bit instruction having an 8 bit of code, a 1 bit complementary code which when zero specifies a special instruction using base register 0, a three bit base register code BRn and a 20 bit address code AS. When a ring crossing is required a gating procedure descriptor is accessed. A check is first made as to whether the caller's maximum ring number is greater than the procedure's ring number (representing by bits 2, 3 of the descriptor), a call violation exception being generated if it is. A check is then made as to whether the address boundary of the procedure (represented by bits 10-31 of the gating procedure description) is greater than the segment relative address of the procedure descriptor an illegal access exception occurring if it is not. Otherwise the address in the instruction ENT is used to access the required procedure descriptor which comprises two 32 bit words, word 0 containing the segmented address of the entry point of the desired procedure, a ring number and a 2 bit tag field, tag 00 implying the descriptor is direct, tag 01 implying the descriptor includes the second word, tag 10 implying an indirect descriptor (an illegal procedure descriptor exception then occurring) and tag 11 implying a fault procedure descriptor (an exception then occurring). The second word when used contains the segmented address of a linkage section whose contents are loaded on to base register (BR7). A prepare stack instruction comprises two 32 bit words the first having the OP code, the base register code and the number of bytes in the parameter space of the stack frame and the second having the saving area mask in which a bit is assigned to each of the 8 base registers, 16 general registers and 4 scientific registers, the bits being set to one if the contents of the corresponding register are to be stored in the saving area of the stack frame. The base register 0 is used to point to the first word in the communication area of the stack frame of the caller, this register also having a ring field representing the ring number. The instruction counter section of the stack indicates the instruction following an enter instruction. Base register 1 points to the first byte of the working area of the stack. Different stack segments are assigned to different ring numbers, the stack frame of a procedure being located in the segment associated with the ring number in which it is executed. As well as a saving area used when another procedure is stored parameters to be passed to the called procedure are loaded into a parameter space in the communication area. Each call results in a stack frame within a segment being created, the last frame loaded being considered the top of the stack.