Text preview for : Mesa-Nova1.asm_Sep78.pdf part of xerox Mesa-Nova1.asm Sep78 xerox mesa 4.0_1978 listing Mesa_4_Microcode Mesa-Nova1.asm_Sep78.pdf



Back to : Mesa-Nova1.asm_Sep78.pdf | Home

Mesa-Noval,asm 2-Sep-78 17:21:54 Page 1


FILE MESA-NOVA1,ASM
R, JOHNSSON
LAST MODIFIED August la, 1978 9:47 AM
. TITL MesaNova1
.TXTM B
.ENT EMLOOP
,ENT MesaNova1
,ENT MesaNovaSizel
.ENT ACOPtr
,ENT AC1Ptr
,ENT AbsoluteTXV
,ENT CleanUpQueueUser
,ENT RequeueSubUser
,ENT WakeHeadImplementer
,ENT STOP User
,ENT AdvanceTimerPtr
,ENT processTrapPtr
.ENT firstProcessPtr
,ENT lastProcessPtr
,ENT firstStateVectorPtr
,SREL
EMLOOP: EMLP-TXV ;WHERE TO START RUNNING
MesaNoval: TXV
MesaNovaSizel: END-TXV
ACOPtr: currentState
AC1Ptr: WASAC1
AbsoluteTXV: X ; To check compatibility
CleanUpQueueUser: CleanUpQueue
RequeueSubUser: RequeuePtr
WakeHeadlmplementer: WakeHead-TXV+X
STOPUser: pSTOP
AdvanceTimerPtr: AdvanceTimer-TXV+X
processTrapPtr: processTrap
firstProcessPtr: firstProcess
lastProcessPtr: lastProcess
firstStateVectorPtr: firstStateVector
,NREL
,GET "Mesa-NovaDefs,asm"
x .. 25 ; The absolute location of TXV at run time

TXV: EMLP-TXV+X Microcode expects this to be in location 25
MSTOP-TXV+X
77400 BLK
77400 CONVERT
ME-TXV+X
MRE-TXV+X
MXW-TXV+X
MXO-TXV+X
NOTIFY-TXV+X
BCAST-TXV+X
REQUEUE-TXV+X
CVArray: ; This will be location 40
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
MSTOP: JMP @pSTOP
Mesa-Noval.asm 2-Sep-78 17:21:54 Page 2


pSTOP: 0



Locations for saving accumulators
WASAC1: 0
trapmask: abortPending;+timeoutPending make timeout not trap
processTrap: 0
; Monitor ReEntry(@Monitor,cvptr)
MRE:
sta 1 cvptr
jsr Enter
mov o 0 snc if failed
jmp EMLPl then return
lda o cvptr
jsr @CleanUpQueue
lda 2 currentPSB
sub o0
sta o cleanUpLink.2 ; currentPSB.cleanUpLink ~ Clean
lda o trapmask
lda 1 bitsandpriority,2
and# o 1 snr - if no timeout or abort
jmp EnterTrue then return
lda 2 currentState cause a trap in the current state
lda 1 dest.2
sta 1 source,2 make the dest be the source
lda 1 @processTrap
sta 1 dest,2 and cause a call to SD[sProcessTrap]
jmp EMLP
Enter: : (@Monitor) returns carry=l iff success
mov 0,2 copy pointer
lda o 10ckqueue.2 get lock and queue word
movzl o0 lock bit to carry
movl 1 1 store carry in low-order ACl
movzr o0 set lock bit to 0 = locked
sta o lockqueue,2 store value back
movzr 1 1 szc test and remove lock bit
jmp 0,3 done, carry=l
EnterFai 1:
sta 3 EXWreturn
mov 2 1 ; assumes queue=O
lda 2 currentPSB
lda o bitsandpriority,2
movl o0
movor o0
sta o bitsandpriority.2 ; set enterrailed ~ TRUE
lda o pReadyList
jsr RequeueSub:([email protected])
movz o0 ; set carry=O
jmp @EXWreturn
REQUEUE: : (@[email protected])
jsr RequeueSub
jmp EMLPl
TabortPending: abortPending
ReSchedulePending: 0
clStateVector: lStateVector
; Monitor Exit and Depart(@Monitor)
MXD:
jsr Exit
jrnp EMLPl

NoneReady:
EIR
EMLP: OIR
EMLP1: LOA 1 WASACl
LOA 0 currentS tate
LOA 2 ReSchedulePending
SNZ 2 2
61010 ; JMPRM
ReSchedule:
Mesa-Naval.asm 2-Sep-78 17:21:54 Page 3



lda 2 SOC
sz 2 2 ; scheduling disabled?
61010 JMPRM jmp EMLP
lda 3 readyList
snz 3 3
jmp NoneReady
sta 2 ReSchedulePending
lda 3 link,3 ; pReadyListtt. link
lda 2 currentPSB
;sne 2 3
;jmp EMLP
sta 3 currentPSB store new PSB
lda 3 currentS tate
lda o dest,3
sta o frame,2
lda 3 currentPSB
lda 1 bitsandpriority,3
movzl t o ; carry .. enterfailed
cycle 17
sta o bitsandpriority,3 ; enterfailed .. FALSE
lda o mPriority
and o 1 ; isolate priority
lda o @firstStateVector
lda 2 clStateVector
mul ; ACt .. priority*lStateVector+firstStateVector
sta t currentState
mov 1 2
lda 1 frame,3
sta 1 dest,2
mov o 0 snc
jmp EMLP1
jmp EnterFalse
mPriority: priority
firstStateVector: 0
; Monitor Exit and Wait(@Monitor,cvptr,timeout)
MXW:
sta 1 cvptr
sta 2 savetimeout
jsr Exit
lda o cvptr
jsr @CleanUpQueue
lda 2 currentPSB
lda 1 TabortPending
lda o bitsandpriority,2
and# 1 0 szr ; if not abortPending
jmp EMLP1
lda 1 @cvptr
movzl 1 1 snc test ww bit
jmp MXWq
sta 1 @cvptr ww set, clear it and don't stop
jmp EMLP1
MXWq: lda 1 TwaitingOnCV
add 1 0
lda 1 FtimeoutAllowed
and 1 0 timeoutAllowed .. FALSE
lda 3 savetimeout
sz 3 3
adc 1 0 ; timeoutAllowed .. TRUE
sta o bitsandpriority,2
lda o timer
add o3
sta 3 timeout,2 ; currentPSB.timeout .. timer+timeout
lda o pReadyList
lda 1 cvptr
jsr RequeueSub;(pReadyList,cvptr,currentPSB)
jmp EMLP1
CleanUpQueue: o ;(q) returns (q)
HequeueSub: sta 2 ReSchedulePending
jmp @RequeuePtr
HequeuePtr' : o ; (ql,q2,p)
Mesa-Noval.asm 2-Sep-78 17:21:54 Page 4



EXWreturn: 0
cvptr: 0
savetimeout: 0
TwaitingOnCV: waitingOnCV
FtimeoutAllowed: O-timeoutAllowed-l
pReadyList: readyList
i Monitor Entry(@Monitor)
ME:
jsr Enter
mov o 0 snc i if failed
jmp EMLPl then reschedule
EnterTrue:
subzl o 0 skp
EnterFalse:
sub o0
lda 2 currentState
sta o stkO,Z store return value
mkone o0
sta o stkp,Z stkp +- 1
jmp EMLP
NOTIFY: i(cvptr)
jsr @CleanUpQueue
jsr WakeHead
jmp EMLPl
BCAST: i(cvptr)
jsr @CleanUpQueue
sta o cvptr
BCASTl oop:
lda o cvptr
jsr WakeHead
sz 2 2 process notified or 0 if none
jmp BCASTloop
jmp EMLPl
Exit: i(@Monitor) returns carry"l iff requeue was called
sta o saveq
sta 3 EXWreturn
lda 1 @saveq
mov 1 2 snr if mqt .. NIL
jmp exits tore low-order zero will go to carry
lda 1 pReadyList
i 0 correct from above
lda 2 link,2 i p +- mqtt. link
jsr RequeueSubi(@Monitor.queue,pReadyList,Monitor.queue.link)
lda 1 @saveq
movol 1 1 low-order one will go to carry
exitstore:
movor 1 1 set lock to 1 = unlocked
carry +- 1 iff requeue happened
sta 1 @saveq
jmp @EXWreturn
saveq: 0

WakeHead: i(cvptr)
sta 3 EXWreturn
mov o3
lda 2 0,3 cvptrt
movzl# 2 2 snr test for process 0, ignore ww
jmp @EXWreturn
lda 2 link,2 ; cvptrtt.link
lda 1 bitsandpriority,2
lda 3 FwaitingOnCV
and 3 1
sta 1 bitsandpriority,2
lda 1 pReadyList
jsr RequeueSub;(cvptr,pReodyList,cvptrt)
jmp @EXWrtlturn
FwaitingOnCV: O-waitingOnCV-l
Mesa-Noval.asm 2-Sep-78 17:21:54 Page 5



timer: 0
timeflag: -3
timeconst: -3
AdvanceTimer:
isz timefl ag
bri
lda o timeconst
sta o timeflag
isz timer
nop
lda 2 @firstProcess
loop: lda o timermask
lda 1 bitsandpriority,2
and o1
seq o1
jmp not ready
lda 1 timeout,2
lda o timer
seq o1
jmp notready
lda o FtimeoutPending
lda 1 bitsandpriority,2
and o1
adc o1 ; p.timeoutPending +- TRUE
lda o FwaitingOnCV
lda 1 bitsandpriority,2
and o1 ; p.waitingOnCV +- FALSE
sta 1 bitsandpriority,2
sub o0
lda 1 pReadyList
jsr RequeueSub;(NIL,pReadyList,p) -- returns p in AC2
notready:
lda 1 @lastProcess
sne 1 2
bri
lda 1 clPSB
add 1 2
jmp loop
timermask: state+timeoutAllowed+waitingOnCV
FtimeoutPending: O-timeoutPending-l
firstProcess: 0
lastProcess: 0
clPSB: lPSB
END: jmp TXV+200 generate error if too big


.END