KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 TABLE OF CONTENTS 13- 24 SYMBOL DEFINITIONS 13- 37 INITIALIZATION 14- 156 SUBROUTINES FOR WAITING 15- 194 BRKPNT KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 PAGE 13 MOVE INSTRUCTIONS 1 .TITLE KMC11 ECHO DR11-K INPUT 2 .LIST MEB 3 4 ;+ 5 ; 6 ; DRECHO ECHO THE INPUT FROM THE DR11-K 7 ; 8 ; AUTHOR THOMAS J. LINSCOMB 9 ; COMPUTATION CENTER 10 ; UNIVERSITY OF TEXAS AT AUSTIN 11 ; AUSTIN, TEXAS 78712 12 ; 13 ; DATE 830331 14 ; 15 ; INPUT DR.CSR IS THE STARTING ADDRESS OF THE UNIT TO BE ECHOED 16 ; 17 ; OUTPUT THE INPUT FROM THE DR-11K WILL BE SAMPLED UNTIL AN INTERRUPT 18 ; OCCURS. THE KMC-11 WILL THEN ENTER AN INTERNAL LOOP BUT 19 ; WILL CONTINUE TO RUN. 20 ; 21 ;- 22 23 24 .SBTTL SYMBOL DEFINITIONS 25 ; 26 ; DEVICE ADDRESSES. 27 ; 28 167740 DR.CSR = 167740 ; DR11K UNIT 4 CSR 29 167742 DR.INP = DR.CSR+2 ; INPUT REG. 30 167744 DR.OUT = DR.CSR+4 ; OUTPUT REG. 31 ; 32 ; MISC. 33 ; 34 003720 LTICS = ^D2000 ; LATENCY TICKS (.1 SEC.) 35 000001 TIMEXP = 1 ; BRG OFFSET FOR TIME EXPIRED 36 37 .SBTTL INITIALIZATION 38 000000 000434 INIT: BRWRTE IMM,034 ; OUTBA17,OUTBA16, CLOCK 39 000002 061231 OUT BR,SELB,OBR ; SET MISC. REG. 40 000004 000400 BRWRTE IMM,0 ; SET UP THE SP'S 41 000006 063221 SP BR,SELB,SP1 ; OLD INPUT - LOW BYTE 42 000010 063222 SP BR,SELB,SP2 ; HIGH BYTE 43 000012 063223 SP BR,SELB,SP3 ; NEW INPUT - LOW BYTE 44 000014 063224 SP BR,SELB,SP4 ; HIGH BYTE 45 000016 000720 BRWRTE IMM,LTICS 46 000020 063225 SP BR,SELB,SP5 ; LATENCY CLOCK TICKS 47 000022 000407 BRWRTE IMM, ; LAT. HIGH BYTE KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 PAGE 13-1 INITIALIZATION 48 000024 063226 SP BR,SELB,SP6 49 50 ; 51 ; CLEAR THE DR11 CSR 52 ; 53 54 000026 000740 BRWRTE IMM,DR.CSR ; DR11 CSR 55 000030 062226 OUT BR,SELB,OBA1 ; LOW BYTE OF ADDRESS 56 000032 000757 BRWRTE IMM, ; GET HIGH BYTE 57 000034 062227 OUT BR,SELB,OBA2 ; MOVE HIGH BYTE 58 000036 000400 BRWRTE IMM,0 ; CLEAR CSR 59 000040 062222 OUT BR,SELB,OUTDA1 ; NPR HIGH AND 60 000042 062223 OUT BR,SELB,OUTDA2 ; -- LOW BYTE =0 61 000044 000421 BRWRTE IMM,021 ; OUT NPR ! NPR RQ 62 000046 061230 OUT BR,SELB,ONPR ; ISSUE NPR REQUEST 63 000050 120600 INIT1: BRWRTE IBUS,NPR 64 000052 102024 BR0 INIT1 ; NPR STILL IN PROGRESS 65 66 67 000054 000757 BRWRTE IMM, ; HIGH BYTE OF DR11K ADRESS 68 000056 062225 OUT BR,SELB,IBA2 ; INPUT ! CSR 69 70 ; 71 ; READ THE CSR TO DETECT AN INTERUPT. 72 ; 73 74 75 000060 000740 RDCSR: BRWRTE IMM,DR.CSR ; SET UP LOW BYTE FOR CSR 76 000062 062224 OUT BR,SELB,IBA1 77 000064 000415 BRWRTE IMM,15 ; INBA17!INBA16!NPR RQ 78 000066 061230 OUT BR,SELB,ONPR 79 000070 120600 RDCSR1: BRWRTE IBUS,NPR ; NPR - READ COMPLETE ? 80 000072 102034 BR0 RDCSR1 ; NO 81 82 ; 83 ; LOW BYTE OF THE DR11-K CSR IS NOW IN INDAT1. IF BIT SEVEN IS 84 ; SET THE INTERRUPT BOTTON HAS BEEN PRESSED AND THE PROGRAM SHOULD KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 PAGE 13-2 INITIALIZATION 85 ; EXIT. 86 ; 87 88 000074 020400 BRWRTE IBUS,INDAT1 ; LOW CSR TO BRG 89 000076 103500 BR7 EXIT ; INTERRUPT SET -EXIT 90 91 ; 92 ; NOW GO OUT AND READ THE INPUT DATA 93 ; 94 95 000100 000742 BRWRTE IMM,DR.INP ; LOW BYTE FOR INPUT 96 000102 062224 OUT BR,SELB,IBA1 97 000104 000415 BRWRTE IMM,15 ; INBA17!INBA16!NPR RQ 98 000106 061230 OUT BR,SELB,ONPR ; READ DR11K INPUT 99 100 ; 101 ; MOVE SP3 TO SP1 AND SP4 TO SP2. MAKING SP1 AND SP2 THE LAST 102 ; INPUT RECIEVED 103 ; 104 105 000110 060603 BRWRTE SELA,SP3 ; LOW BYTE 106 000112 063221 SP BR,SELB,SP1 107 000114 060604 BRWRTE SELA,SP4 ; HIGH BYTE 108 000116 063222 SP BR,SELB,SP2 109 110 000120 120600 20$: BRWRTE IBUS,NPR ; NOW WAIT FOR NPR 111 000122 102050 BR0 20$ ; INPUT NOT FINISHED 112 113 000124 023403 SPBR IBUS,INDAT1,SP3 ; LOW BYTE TO BRG AND SP3 114 000126 023024 SP IBUS,INDAT2,SP4 ; HIGH BYTE TO SP4 115 116 000130 060361 COMP BR,SP1 ; NEW INPUT = TO SP 117 000132 101457 Z 30$ ; .EQ. 118 000134 100462 ALWAYS DROUT ; .NE. -UPDATE THE OUTPUT 119 000136 060604 30$: BRWRTE SELA,SP4 ; NOW CHECK HIGH BYTE 120 000140 060362 COMP BR,SP2 121 000142 101470 Z WATE ; .EQ. KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 PAGE 13-3 INITIALIZATION 122 ; .NE. 123 124 ; 125 ; THE INPUT FROM THE DR11K IS NOT THE SAME AS LAST READ SO THE 126 ; OUTPUT HAS TO BE UPDATED. 127 ; 128 129 000144 022002 DROUT: OUT IBUS,INDAT1,OUTDA1 ; LOW BYTE 130 000146 022023 OUT IBUS,INDAT2,OUTDA2 ; HIGH BYTE 131 000150 000744 BRWRTE IMM,DR.OUT ; DR11K OUTPUT ADDRESS 132 000152 062226 OUT BR,SELB,OBA1 ; LOW BYTE 133 000154 000421 BRWRTE IMM,21 ; OUT NPR!NPR RQ 134 000156 061230 OUT BR,SELB,ONPR ; WRITE IT OUT 135 136 ; 137 ; NOW LETS WAIT A FEW CLOCK TICKS SO WE DON'T SUCK THE SYSTEM 138 ; BUS DOWN. 139 ; 140 141 000160 000473 063237 100504 WATE: CALLSB SP17,TCB ; TEST CLOCK BIT 142 000166 000476 063237 100513 CALLSB SP17,DLC ; DECREMENT LATENCY COUNTER 143 000174 102030 BR0 RDCSR ; TIME EXPIRED 144 000176 100470 ALWAYS WATE ; STILL MORE WAITING 145 146 147 ; 148 ; COME HERE TO EXIT - KMC WILL LOOP SETTING AND WAITING FOR TICS 149 ; 150 151 000200 000503 063237 100504 EXIT: CALLSB SP17,TCB ; HANG KMC IN 152 000206 100500 ALWAYS EXIT ; WAITING LOOP 153 154 KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 PAGE 14 SUBROUTINES FOR WAITING 156 .SBTTL SUBROUTINES FOR WAITING 157 158 ;; TCB - TEST CLOCK BIT. 159 ; 160 ; WAIT UNTIL TIMER EXPIRES. THEN RESTART IT AND RETURN. 161 ; 162 ; ENTRY: SP17 = RETURN REGISTER 163 ; 164 000210 123620 TCB: SPBR IBUS,UBBR,SP0 ; READ CLOCK STATUS 165 000212 103107 BR4 TCB1 ; IF TIMER EXPIRED 166 000214 100504 ALWAYS TCB 167 000216 000434 TCB1: BRWRTE IMM,034 ; MASK CLOCK AND OUT BA'S 168 000220 063260 SP BR,AANDB,SP0 169 000222 061211 OUT SELA,OBR ; START CLOCK AGAIN 170 000224 160617 RTNSUB SP17,P0 171 172 173 ;; DLC - DECREMENT LATENCY COUNTER 174 ; 175 ; ENTRY: SP5, SP6 = LATENCY TICS 176 ; SP17 = RETURN REGISTER 177 ; EXIT: COUNTER DECREMENTED, IF COUNTER EQUALS ZERO 178 ; BRG BIT0 SET TO 1 OTHER WISE CLEARED. 179 ; 180 000226 063165 DLC: SP DECA,SP5 ; DECREMENT LOW BYTE 181 000230 101125 C DLC1 ; IF NO CARRY 182 000232 063166 SP DECA,SP6 ; DECREMENT HIGH BYTE 183 000234 101125 C DLC1 ; IF NO CARRY 184 000236 000720 BRWRTE IMM,LTICS ; RESET COUNTER 185 000240 063225 SP BR,SELB,SP5 186 000242 000407 BRWRTE IMM, 187 000244 063226 SP BR,SELB,SP6 188 000246 000401 BRWRTE IMM,TIMEXP 189 000250 160617 RTNSUB SP17,P0 ; RETURN WITH TIME EXPIRED 190 000252 000400 DLC1: BRWRTE IMM,0 191 000254 160617 RTNSUB SP17,P0 ; MORE TIME LEFT 192 KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 PAGE 15 BRKPNT 194 .SBTTL BRKPNT 195 196 000010 NBRKS = 8. 197 000256' .SAV=. 198 003740' .=START+<<1024.->*2> 199 000000 $NBRKS=0 200 000010 .REPT NBRKS 201 .IRP $$NBRK,<\$NBRKS> 202 OUT IMM,$$NBRK*20+1,OMAIN 203 ALWAYS . 204 $NBRKS=$NBRKS+1 205 .ENDM 206 .ENDM 003740 001001 !OMAIN> 003742 114761 !<.-START&777/2>> 003744 001021 !OMAIN> 003746 114763 !<.-START&777/2>> 003750 001041 !OMAIN> 003752 114765 !<.-START&777/2>> 003754 001061 !OMAIN> 003756 114767 !<.-START&777/2>> 003760 001101 !OMAIN> 003762 114771 !<.-START&777/2>> 003764 001121 !OMAIN> 003766 114773 !<.-START&777/2>> 003770 001141 !OMAIN> 003772 114775 !<.-START&777/2>> 003774 001161 !OMAIN> 003776 114777 !<.-START&777/2>> 207 000256' .=.SAV 208 209 210 000001 .END KMC11 ECHO DR11-K INPUT MACRO M1200 15-MAY-83 20:09 PAGE 15-1 SYMBOL TABLE AANDB = 000260 EXIT 000200R NPR = 100200 PORT3 = 100140 SP7 = 000007 ADD = 000000 IBA1 = 002004 OBA1 = 002006 PORT4 = 100160 START 000000R ADDC = 000020 IBA2 = 002005 OBA2 = 002007 P0 = 000000 SUB = 000340 ALCOND= 000400 IBUS = 020000 OBR = 001011 P1 = 004000 SUBC = 000040 AORB = 000300 IIBA1 = 000100 OCON = 100040 P2 = 010000 SUBOC = 000360 AORNB = 000240 IIBA2 = 000120 OIDAT1= 002000 P3 = 014000 TCB 000210R APLUSC= 060100 IMM = 000000 OIDAT2= 002001 RDCSR 000060R TCB1 000216R AXORB = 000320 INCA = 060060 OINCON= 001000 RDCSR1 000070R TIMEXP= 000001 BR = 060000 INCMAR= 014000 OLINEN= 001003 SELA = 060200 TWOA = 060120 BR0CON= 002000 INCON = 100000 OMAIN = 001001 SELB = 000220 TWOAC = 060140 BR1CON= 002400 INDAT1= 000000 ONPR = 001010 SHFTBR= 001400 UBBR = 100220 BR4CON= 003000 INDAT2= 000020 OOCON = 001002 SPBRX = 003400 WATE 000160R BR7CON= 003400 INIT 000000R OPORT1= 001004 SPX = 003000 WRMEM = 002400 CCOND = 001000 INIT1 000050R OPORT2= 001005 SP0 = 000000 WROUT = 002000 DATI = 000001 IOBA1 = 000140 OPORT3= 001006 SP1 = 000001 WROUTX= 001000 DATIH = 000003 IOBA2 = 000160 OPORT4= 001007 SP10 = 000010 WRTEBR= 000400 DATO = 000021 IODAT1= 000040 OUTDA1= 002002 SP11 = 000011 XREG0 = 000200 DATOB = 000221 IODAT2= 000060 OUTDA2= 002003 SP12 = 000012 XREG1 = 000220 DATOBH= 000223 JUMP = 100000 OXREG0= 002010 SP13 = 000013 XREG2 = 000240 DATOH = 000023 LDMAPG= 004000 OXREG1= 002011 SP14 = 000014 XREG3 = 000260 DECA = 060160 LDMAR = 010000 OXREG2= 002012 SP15 = 000015 XREG4 = 000300 DISP = 000100 LINENM= 100060 OXREG3= 002013 SP16 = 000016 XREG5 = 000320 DLC 000226R LTICS = 003720 OXREG4= 002014 SP17 = 000017 XREG6 = 000340 DLC1 000252R MAIN = 100020 OXREG5= 002015 SP2 = 000002 XREG7 = 000360 DROUT 000144R MEMI = 054000 OXREG6= 002016 SP3 = 000003 ZCOND = 001400 DR.CSR= 167740 MEMX = 040000 OXREG7= 002017 SP4 = 000004 $NBRKS= 000010 DR.INP= 167742 MOVE = 000000 PORT1 = 100100 SP5 = 000005 .SAV = 000256R DR.OUT= 167744 NBRKS = 000010 PORT2 = 100120 SP6 = 000006 . ABS. 000000 000 004000 001 ERRORS DETECTED: 0 VIRTUAL MEMORY USED: 10884 WORDS ( 43 PAGES) DYNAMIC MEMORY: 20060 WORDS ( 77 PAGES) ELAPSED TIME: 00:00:10 DRECHO,DRECHO/-SP=KMCMAC.MAC,DISK$AGLSY:[UTEXAS.KMC11]DRECHO.KMC;