Elliott 803 Algol 60 Compiler (reconstructed)


File: reset.t2

For general comments see here
LineAddressObject Code LabelF1N1BF2N2CommentsCheck
1 0  ; tape2/reset.t2
2 0  ;---------------
3 0  ; initialise run-time system
4 0  ;
5 0  Reset:; 
6 0 0615154 lod W6764   ; @7069
7 0+0400074 sto Rfmt   ;
8 1 0616213 lod N8   ;=-8 @7070
9 1+0420075 stn Ndigits   ;digits(-8)
10 2 0540076 cls prtfmt   ; @7071
11 2+0540077 cls outdev   ;output stream=punch 1
12 3 0540100 cls RdBuff   ; @7072
13 3+0540101 cls RdBuff+1   ;
14 4 0540102 cls RdBuff+2   ; @7073
15 4+0540103 cls RdBuff+3   ;
16 5 0540025 cls indev   ;input stream=reader 1 @7074
17 5+0600033 lod himem   ;
18 6 0400027 sto stkpt   ; @7075
19 6+0000000 o00 0   ;
20 7 1160006 jo ep6#   ; @7076
21 7+1100006 jmp ep6#   ;
22 8  ;--------------------------------------------------------------------
23 8  CheckStack::; 
24 8 0000000000000.lnk:+0;return address @7077
25 9  ;---------------
26 9  ; checkstack - if stack has reached lomem, see if we can extend
27 9  ; if not goto SpaceOflo
28 9  ; stack pointer in acc on entry
29 9  ;
30 9  .ent:; 
31 9 0120031 sub lomem   ;compare pointer @7078
32 9+1020013 jn .1   ;problems->
33 10   ret     ;OK, return @7079
33+110 0000043000001 o00 CheckStack.lnk/jmp 1 
34 11  ;
35 11  ; only way to make more space is to overwrite the compiler etc.
36 11  ; modify entry points to indicate reload needed
37 11  ;
38 11  CheckStacka.lnk= P/@hhX@ CheckStack.lnk; 
39 11  CheckStacka.ent:; 
40 11  .1:; 
41 11 0615155 lod Jcorrupt   ;= @7080
42 11+0400011 sto ep9   ;set up entry points
43 12 0400010 sto ep8   ;ditto @7081
44 12+0056220 o02 K15a   ;=15+1=>16
45 13 0320031 o15 lomem   ;store, and subtract @7082
46 13+1040014 jz SpaceOflo   ;out of memory
47 14 0600027 lod stkpt   ; @7083
48 14+1000011 jmp .ent   ;and try again
49 15  ;--------------------------------------------------------------------
50 15  ;
51 15  pause::; 
52 15  pause:; 
53 15 1600000 kbd 0   ;get initial state @7084
54 15+1120021 jn .2   ;sign bit set->
55 16  ;loop until sign bit is set
56 16  ;
57 16  .1:; 
58 16 1600000 kbd 0   ;read state again @7085
59 16+1020000 jn Return   ;negative, return
60 17 1000020 jmp .1   ;not yet, continue @7086
61 17+ ;
62 17+ ;loop until sign bit clears
63 17+ .2:; 
64 17+1600000 kbd 0   ;read state again
65 18 1120021 jn .2   ;loop while still set @7087
66 18+1000000 jmp Return   ;exit
67 19  ;--------------------------------------------------------------------
68 19  ; DWait, Data Wait - emit warbling sound while waiting for
69 19  ; leftmost F2 digit to be toggled
70 19  ;
71 19  DWait::; 
72 19  DWait:; 
73 19 1600000 kbd 0   ;test for F2 bit @7088
74 19+0075156 and F2bit   ;=<00 0:40 0> get initial setting
75 20 1040027 jz .1   ;not set, wait for it @7089
76 20+ ;
77 20+ ; bit already set, wait for it to clear
78 20+ ;
79 20+1600000 kbd 0   ;input state of k/b
80 21 0075156 and F2bit   ;=<00 0:40 0> @7090
81 21+1055212 jz CkoRet   ;now clear, return
82 22   calln ,   ; returns at 7090 @7091
82+122 7300021000033 lnk 4:jmp Delay 
83 23  ;
84 23  ; bit not set, wait for it to set
85 23  ;
86 23  .1:; 
87 23 1600000 kbd 0   ;input state of k/b @7092
88 23+0075156 and F2bit   ;=<00 0:40 0>
89 24 1040031 jz .2   ;still set, wait @7093
90 24+1015212 jmp CkoRet   ;cleared, return
91 25  ;
92 25  .2:; 
93 25   calln ,   ;very odd return (7092+) @7094
93+125 7300021000033 lnk 4:jmp Delay 
94 26  ;
95 26 7777777777700KM64:-64; @7095
96 27  ;
97 27  ; delay subroutine, issue two-tone wail and read keyboard
98 27  ;
99 27  Delay:; 
100 27 0600032 lod KM64   ;=-64 @7096
101 27+ .3:; 
102 27+0136210 sub N1   ;=-1
103 28 0000000000000 00 0:00 0;four no-ops @7097
104 29 0000000000000 00 0:00 0;to set tone @7098
105 30 1120033 jn .3   ;repeat 64 times @7099
106 30+0600032 lod KM64   ;=-64
107 31  .4:; 
108 31 0136210 sub N1   ;=-1 @7100
109 31+0000000 o00 0   ;three no-ops
110 32 0000000000000 00 0:00 0;to set different tone @7101
111 33 1020037 jn .4   ;repeat 64 times @7102
112 33+1600000 kbd 0   ;get keyboard setting
113 34 0000023077776 o00 4/jmp -2#;and very odd return @7103
114 35  ;--------------------------------------------------------------------

Page created by Bill Purvis, last updated: January 09 2004