Text preview for : Mesad.mu_Sep78.pdf part of xerox Mesad.mu Sep78 xerox mesa 4.0_1978 listing Mesa_4_Microcode Mesad.mu_Sep78.pdf



Back to : Mesad.mu_Sep78.pdf | Home

Mesad.mu 2-Sep-78 17:21:54 Page 1



,------------------------------------------------------------.----
,
i Mesad.Mu - Xfer, State switching, process support, Nova interface
; Last modified by Levin - August 1, 1978 3:26 PM
;----------------------------------------------------------------.
;-----------------------------------------------------------------
; F ram e All 0 cat ion
:-----------------------------------------------------------------
._-----------------.----------------------------------------------
,
A110c subroutine:
allocates a frame
Entry conditions:
frame size index (fsi) in T
Exit conditions:
frame pOinter in L, T, and frame
if allocation fails, alternate return address is taken and
temp2 is shifted left by 1 (for ALLOC)
11,2,AllocSub,ALLOClarge; for ALLOC byte code
11,2,ALLOCr,XferGr; subroutine returns
11,2,ALLOCrf,XferGrf; failure returns
13,4,AllocO,Allocl,Alloc2,Alloc3; dispatch on pointer flag
if more than 2 callers, un-comment the following pre-definition:
i 117,1,Allocx; shake IR~ dispatch
AllocSub: L~avml+T+1, TASK, :A11ocx; fetch av entry
Allocx: entry~L; save av entry address
L~MAR~entry;
T~3; mask for pointer flags
L~MD AND T, T~MD; (L~MD AND 3, T~MD)
temp~L, L~MAR~T; start reading pointer
SINK~temp, BUS; branch on bits 14:15
frame~L, :A110cO;

Bits 14:15 00, a frame of the right index is queued for allocation

A1locO: L~MD, TASK; new entry for frame vector
temp~L; new value of vector entry
MAR~entry; update frame vector
L~T~frame, IDISP; establish exit conditions
MD~temp, :ALLOCr; update and return

Bits 14:15 = 01, allocation list empty: restore argument, take failure return

Allocl: L~temp2, IDISP, TASK, :Alloclx; restore parameter
Alloclx: temp2~L LSH 1, :ALLOCrf; allocation failed
,
; Bits 14:15 a 10, a pointer to an alternate list to use

Alloc2: temp~L RSH 1, :Allocp; indirection: index~index/4


Allocp: L~temp, TASK;
temp~L RSH 1;
T~temp, :AllocSub;


Alloc3: temp~L RSH 1, :Allocp; (treat type 3 as type 2)
Mesad.mu 2-Sep-78 17:21:54 Page 2




;-----------------------------------------------------------------
Free subroutine:
frees a frame
Entry conditions: address of frame is in 'frame'
Exit conditions: 'frame' left pointing at released frame (for LSTF)
;-----------------------------------------------------------------
13,4,RETr,FREEr,LSTFr,; FreeSub returns
Il7,l,Freex; shake IR~ dispatch
FreeSub: MAR+-frame-1; start read of fsi word
Freex: NOP; wait for memory
T+-MD; T+-index
L~MAR+-avml +T+1; fetch av entry
entry~L; save av entry address
L+-MD; read current pointer
MAR+-frame; write it into current frame
temp+-L, TASK;
MD+-temp; write I
MAR+-entry; entry points at frame
IDISP, TASK;
MD+-frame, : RETr; free
Mesad.mu 2-Sep-78 17:21:54 Page 3




"-----------------------------------------------------------------
,
; ALLOC - allocate a frame of size specified by (popped)
if (TOS> < maxallocslot, (TOS) is a frame size index (fsi)
otherwise, is requested frame size in words.
,
0 ______ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ___________ _



11,1,Savpcinframe; (here so ALLOCrf can call it)
17,10,XferGT,Xfer,Mstopr,PORTOpc,LSTr,ALLOCrfr, ,; return points for Savpcinframe
11,2,doAllocTrap,XferGfz; used by XferGrf
ALLOC: L<-ret7, TASK, : Xpopsub; returns to ALLOCrx
ALLOCrx: L<-maxallocslot-T-1j
L<-T, SH temp2<-L LSH 1, IR<-msrO, :AllocSub;
ALLOCr: :pushTB; successful allocation

Allocation failed - save mpc, undiddle lp, push fsi*4 on stack, then trap

ALLOCrf: IR<-sr5, :Savpcinframe; failure because lists empty
ALLOCrfr: L... temp2, TASK, :doAllocTrap; pick up trap parameter
ALLOClarge: L... temp2, TASK, :Alloclx; failure because too large

Inform software that allocation failed

doAllocTrap: ATPreg<-L; store paramo to trap proc.
T<-sAllocListEmpty, :Mtrap; go trap to software

,
0 ______ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __