; BlockEq.mu -- Fast Block compare instruction ; Copyright Xerox Corporation 1979 ; Last modified September 10, 1979 6:04 PM by Boggs ; Accepts in: ; AC0/ address of block0 ; AC1/ address of block1 ; AC3/ number of words to compare ; Returns: ; AC3/ offset of first not equal pair of words $AC0 $R3; The accumulators $AC1 $R2; $AC2 $R1; $AC3 $R0; $PC $R6; Program counter $NWW $R4; New wakeups waiting !1,2,BeMore,BeDone; !1,2,BeMaybeInt,BeNoInt; !1,2,BeError,BeMain; !1,2,BeDoInt,BeIntOff; BlockEq: L_ AC1-1; AC1_ L; MAR_ L_ AC0, :Be2; ; main loop is 12 cycles - runs memory at full (single word) speed BeMain: MAR_ L _ AC0+1; Fetch a word from block 0 Be2: AC0_ L; L_ AC3-1, BUS=0; Update count, check for done AC3_ L, :BeMore; [BeMore,BeDone] BeMore: T_ MD; MAR_ L_ AC1+1; Fetch a word from block 1 AC1_ L; L_ NWW, BUS=0; Check for interrupts SH<0, :BeMaybeInt; [BeMaybeInt,BeNoInt] BeNoInt: L_ MD-T; Check for words equal BeIntOff: SH=0, TASK; :BeError; [BeError,BeMain] BeMaybeInt: L_ MD-T, :BeDoInt; [BeDoInt,BeIntOff] BeDoInt: L_ PC-1, TASK; Save state for interrupt PC_ L; BeError: SWMODE, L_ AC3+1, :Be3; Come here on compare error BeDone: SWMODE, L_ AC3+1; Come here when done Be3: AC3_ L, :START;