-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboot.ini
160 lines (148 loc) · 6.25 KB
/
boot.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
; *********************************************************************
; ChasingLEDs - a configurable blinkenlight idle system for the PiDP-11
; *********************************************************************
set cpu 11/70,4M
;set realcons=localhost
set realcons panel=11/70
set realcons interval=8
set realcons connected
set clk 50HZ
; *********************************************************************
echo
echo -------------------------------------------------------------------------------
echo PiDP-11/70 boot menu - Set SR switches, depress address rotary switch to reboot
echo -------------------------------------------------------------------------------
!column -c 75 ../selections
echo -------------------------------------------------------------------------------
echo Now running ChasingLEDs - SR0-14 for front panel pattern, SR15 to set the speed
echo -------------------------------------------------------------------------------
; *********************************************************************
; *********************************************************************
; R0 = LED pattern
; R1 = LED speed
; R2 = Console Switch and Display Register address
; R3 = clock interrupt counter
; R4 = temporary register
;
;
; line clock interrupt vector
; 100 001500 <- address of line clock interrupt handler
; 102 000340 <- Processor Status Word, CPU to highest priority for interrupt
;
; initialize
; 1000 012706 MOV #1000,SP <- set stack location (stack decrements on push)
; 1002 001000
; 1004 012737 MOV #100,@#177546 <- enable line clock, by setting bit 6 to enable interrupt mode
; 1006 000100
; 1010 177546
; 1012 012701 MOV #5,R1 <- set default LED speed
; 1014 000005
; 1016 012702 MOV #177570,R2 <- set Console Switch and Display Register address
; 1020 177570
; 1022 000426 BR 1100 <- go to main program
;
; main program
; 1100 011204 MOV (R2),R4 <- copy switches value to temporary register (for LED pattern setting)
; 1102 100412 BMI 1130 <- if it's a negative value (switch 15 set) do not set LED pattern
; 1104 020427 CMP R4,#0 <- check if switch value is zero (no switches set)
; 1106 000000
; 1110 001003 BNE 1120 <- if not so skip the next part
; 1112 012700 MOV #1,R0 <- set LED pattern to 1 (at least one LED must be lit)
; 1114 000001
; 1116 000404 BR 1130 <- LED pattern is set, go to LED show cycle
; 1120 010400 MOV R4,R0 <- set LED pattern from temporary register
; 1122 000402 BR 1130 <- LED pattern is set, go to LED show cycle
; 1124 004767 JSR PC,1300 <- jump to "show and wait" subroutine before shifting the LEDs left again
; 1126 000150
; 1130 006100 ROL R0 <- shift LED pattern to the left
; 1132 100374 BPL 1124 <- loop left shifts as long as leftmost LED not lit (negative bit is not set)
; 1134 004767 JSR PC,1300 <- jump to "show and wait" subroutine before shifting the LEDs right (again)
; 1136 000140
; 1140 006000 ROR R0 <- shift LED pattern to the right
; 1142 102374 BVC 1134 <- loop right shifts as long as overflow bit not set (shifts have gone past the first LED)
; 1144 000755 BR 1100 <- loop to the beginning of the main program to start the next cycle
;
; "show and wait" subroutine
; 1300 011204 MOV (R2),R4 <- copy switches value to temporary register (for LED speed setting)
; 1302 010027 MOV R0,#177570 <- show LED pattern on the panel, by updating the Console Switch and Display Register
; 1304 020000
; 1306 005704 TST R4 <- set the condition codes of the temporary register value
; 1310 100014 BPL 1342 <- if it's a positive value (switch 15 not set) do not set LED speed
; 1312 010401 MOV R4,R1 <- copy temporary register to LED speed register for further processing
; 1314 012704 MOV #100000,R4 <- set bit clearing mask to temporary register
; 1316 100000
; 1320 040401 BIC R4,R1 <- clear negative bit from the LED speed register
; 1322 020127 CMP R1,#0 <- check if no switches (besides switch 15) are set
; 1324 000000
; 1326 001003 BNE 1336 <- if not so skip the next part
; 1330 012701 MOV #5,R1 <- set LED speed to the default value
; 1332 000005
; 1334 000402 BR 1342 <- LED speed is set, go to wait routine
; 1336 072127 ASH #-5,R1 <- shift LED speed value 5 positions to the right, to keep the wait delay reasonable
; 1340 177773
; 1342 005003 CLR R3 <- set the clock interrupt counter to 0
; 1344 020301 CMP R3,R1 <- wait the set number of interrupts by comparing the clock interrupt counter...
; 1346 002776 BLT 1344 <- ...and looping if not reached
; 1350 000207 RTS PC <- end of subroutine, return to main program
;
; line clock interrupt handler
; 1500 005203 INR R3 <- on every line clock interrupt increase the value of the counter
; 1502 000002 RTI <- end of interrupt handler
; *********************************************************************
; *********************************************************************
; line clock interrupt vector
D 100 001500
D 102 000340
;
; initialize
D 1000 MOV #1000,SP
D 1004 MOV #100,@#177546
D 1012 MOV #5,R1
D 1016 MOV #177570,R2
D 1022 BR 1100
;
; main program
D 1100 MOV (R2),R4
D 1102 BMI 1130
D 1104 CMP R4,#0
D 1110 BNE 1120
D 1112 MOV #1,R0
D 1116 BR 1130
D 1120 MOV R4,R0
D 1122 BR 1130
D 1124 JSR PC,1300
D 1130 ROL R0
D 1132 BPL 1124
D 1134 JSR PC,1300
D 1140 ROR R0
D 1142 BVC 1134
D 1144 BR 1100
;
; "show and wait" subroutine
D 1300 MOV (R2),R4
D 1302 MOV R0,#177570
D 1306 TST R4
D 1310 BPL 1342
D 1312 MOV R4,R1
D 1314 MOV #100000,R4
D 1320 BIC R4,R1
D 1322 CMP R1,#0
D 1326 BNE 1336
D 1330 MOV #5,R1
D 1334 BR 1342
D 1336 ASH #-5,R1
D 1342 CLR R3
D 1344 CMP R3,R1
D 1346 BLT 1344
D 1350 RTS PC
;
; line clock interrupt handler
D 1500 INC R3
D 1502 RTI
; *********************************************************************
RESET ALL
;SET CPU IDLE
SET THROTTLE 10%
D PSW 000240
D PC 001000
GO 001000