Trailing-Edge
-
PDP-10 Archives
-
decuslib20-02
-
decus/20-0027/pdp8.mac
There are 3 other files named pdp8.mac in the archive. Click here to see a list.
00100 TITLE PDP8 SIMULATOR VERSION #2 SEPT. 1 '69
00200 SUBTTL DAVE MCCLURE'S MODIFICATIONS TO DON WITCRAFT'S ORIGINAL
00300
00400
00500 ;CONSOLE INQUIRY
00600
00700 ENTRY CYCLE,TC,NXIOT
00800 EXTERNAL CONSOLE,ERROR,NTIME,TIME,SR
00900
01000 JOBVER=137
01100 VERNUM=2
01200 LOC JOBVER
01300 VERNUM
01400 RELOC
01500
01600
01700
01800 TC0: HRLOI AC1,377777 ;SET NO TIME OUT
01900 MOVEM AC1,NTIME
02000 MOVSI AC1,MDLISTL ;SEARCH FOR ACTIVE DEVICES
02100 TC1: MOVE DDB,DLIST(AC1) ;LOAD ADDRES OF DEVICE DATA BLOCK
02200 MOVS AC2,DFLAG(DDB) ;[XWD DEVICE FLAG FOR PDP8,,ACTIVE FLAG]
02300 TLNN FLAGS,(AC2) ;DEVICE ACTIVE?
02400 TC2: AOBJN AC1,TC1 ;NO
02500 JUMPGE AC1,TC3 ;JUMP IF DONE.
02600 CAMGE RUNTIM,DTIME(DDB) ;DEVICE NEED ATTENTION?
02700 JRST TC4 ;NO
02800 TLZ FLAGS,(AC2) ;YES. DEACTIVATE DEVICE
02900 MOVS AC0,AC2 ;[XWD ACTIVE FLAG,,DEVICE FLAG FOR PDP8]
03000 TRO FLAGS,(AC0) ;TURN ON DEVICE FLAG
03100 MOVE AC0,DRATE(DDB) ;LOAD INTERRUPT DELAY TIME CONSTANT
03200 ADDB AC0,DTIME(DDB) ;ADD LAST FLAG TIME
03300 SKIPE AC3,DDISP(DDB) ;LOAD DISPATCH ADDRESS
03400 TLZN AC3,400000 ;SET DELAY TIME IMMEDIATELY?
03500 JRST TC2A
03600 TLO FLAGS,(AC2) ;SET DEVICE ACTIVE AGAIN
03700 CAMGE AC0,NTIME ;NEXT DEVICE TO FLAG?
03800 MOVEM AC0,NTIME ;YES
03900 TC2A: JUMPE AC3,TC2 ;DISPATCH TO A SPECIAL ROUTINE?
04000 PUSHJ PDP,(AC3) ;SO GO
04100 JRST TC2 ;NEXT DEVICE
04200 TC4: MOVE AC2,DTIME(DDB) ;LOAD TIME FOR NEXT INTERRUPT
04300 CAMGE AC2,NTIME ;NEXT DEVICE TO NEED ATTENTION?
04400 MOVEM AC2,NTIME ;YES
04500 JRST TC2
04600
04700
04800 CYCLE: TLNN FLAGS,RUN ;IS MACHINE HALTED?
04900 PUSHJ PDP,CONSOLE ;YES
05000
05100 ;TIME CONTROL
05200 TC: ADDB RUNTIM,TIME ;ACCUMULATE LAST INSTRUCTION TIME
05300 CAML RUNTIME,NTIME ;TIME TO RAISE A FLAG
05400 JRST TC0 ;YES
05500 TC3: SETZM RUNTIME ;CLEAR TIME FOR THIS INSTRUCTION
05600 IFE DRM08,<TRZE FLAGS,BRQFLG ;BREAK REQUEST?
05700 PUSHJ PDP,BREAK ;YES.>
05800
05900
06000 ;INTERRUPT SIMULATION
06100
06200 EXTERNAL IBR,DFF,IF,DFSAVE,IFSAVE
06300
06400 TLZE FLAGS,INTDEL ;INTERRUPT DELAY?
06500 JRST INSFET ;YES. TURN IT OFF AND CONTINUE.
06600 TRNE FLAGS,INTFLG ;NO. IS THERE A PI REQUEST?
06700 TRNN FLAGS,PION ;YES, IS PI TURNED ON?
06800 JRST INSFET ;NO.
06900 TRZ FLAGS,PION ;YES. DISABLE INTERRUPT.
07000 SETZB AC0,IBR ;SAVE AND CLEAR IF AND DFF.
07100 EXCH AC0,DFF
07200 MOVEM AC0,DFSAVE
07300 MOVE AC0,IF
07400 MOVEM AC0,IFSAVE
07500 SETZM MA
07600 JRST JMS ;JMS 0 AND START A NEW INSTRUCTION CYCLE