; VMEMSOFT.ASM - software replacement for map microcode
; last modified December 16, 1976 1:33 PM
;
; Copyright Xerox Corporation 1979
.EXTDHASHMAP,HASHMAPMASK,MapStatPtr,ReprobeInc
.EXTNSOFTMAPFLAG
.EXTNRDREF0,RDREF1,WTREF0
;
.ENTVmemSoft
.ENTNPROBE
;
.SREL
VmemSoft: VMS
NPROBE:
NPRB
;
.NREL
;
VMS:
STA3,1,2
ADC0,0
STA0,@SOFTMF
; Overwrite microcode calls with JSR’s to software routines
LDA0,JRRS
LDA3,@RR0
STA0,0,3
LDA3,@RR1
STA0,0,3
LDA0,JWRS
LDA3,@WR0
STA0,0,3
LDA3,1,2
JMP1,3
;
SOFTMF:
SOFTMAPFLAG
JRRS:
JSR@RDREFS
JWRS:
JSR@WTREFS
RR0:
RDREF0
RR1:
RDREF1
WR0:
WTREF0
;
; MAPPING SUBROUTINE
; CALL WITH AC0-1=V.A., AC3=BITS TO CLEAR IN MAP ENTRY
; RETURNS AC3=CORE ADDRESS OR MAP PTR
;
.ZREL
RDREFS:
RDREFX
WTREFS:
WTREFX
;
.NREL
REFED:
4;REFERENCED
REFDY:
6;REFERENCED+DIRTY
MAPRET:
0
VA0:
0;UPPER V.A.
VA1:
0;LOWER V.A.
BITS:
0
LMSK:
177400
MAMSK:
177600
CAHI:
376;AC0 FOR V.A.S THAT GO DIRECTLY TO CORE
NPRB:
0; REPROBE COUNT
0
;
WTREFX:
INC3,3
STA3,MAPRET
LDA3,REFDY
JMPREFX
RDREFX:
INC3,3
STA3,MAPRET
LDA3,REFED
REFX:
STA3,BITS
STA0,VA0
STA1,VA1
LDA3,LMSK;LEFT HALF MASK
AND3,1
ADD1,0;PAGE NO. SWAPPED IN AC0
COMS0,1; KEY IN AC1
SUB1,0
RETRY:
LDA3,HASHMAPMASK
AND3,0;HASH INDEX
LDA3,HASHMAP
ADD0,3
LDA0,0,3;HASH KEY
SUB#0,1,SZR
JMPPROBE;NO MATCH
LDA0,1,3;ENTRY
LDA1,BITS
ANDZR0,1,SZR;TEST BITS
JMPBITSET
INCORE:
LDA3,MAMSK
AND0,3;MASK OFF BITS
LDA1,VA1
ADD1,3
SKRET:
LDA0,MapStatPtr
MOV#0,0,SZR
JMPSKRET1
LDA0,VA0
JMP@MAPRET
SKRET1:
LDA1,HASHMAP
SUB#1,0,SNR
JMPNOMAP1
LDA0,VA0
STA0,@MapStatPtr
ISZMapStatPtr
LDA1,VA1
STA1,@MapStatPtr
ISZMapStatPtr
JMP@MAPRET
; SOME BITS SET, CHECK FOR STORE TO CLEAN PAGE
BITSET:
MOVR#1,1,SZC
JMPNOMAP
MOVZL1,1
SUB1,0;CLEAR BITS
STA0,1,3
JMPINCORE
; PROBE FAILED
PROBE:
MOV#0,0,SNR;EMPTY SLOT?
JMPEMPTY;YES, RETURN NOSKIP
ISZNPRB+1;LOG THE REPROBE
JMP.+3
ISZNPRB
JMP.+1
LDA0,HASHMAP
SUB0,3; RECONSTRUCT PROBE INDEX
LDA0,ReprobeInc
ADD3,0
JMPRETRY
; LOOKUP FAILED, TEST FOR CORE ADDRESS
EMPTY:
LDA0,VA0
LDA1,CAHI
SUB#0,1,SZR
JMPNOMAP
LDA1,VA1
MOV1,3
JMPSKRET
; MAP FAULT
NOMAP1:
ADCZL3,3
ADD1,3; Statistics overflow
NOMAP:
LDA0,VA0
LDA1,VA1
DSZMAPRET
JMP@MAPRET
;
.END