/SYSTEMS ENGINEERING LABORATORY'S GRAPHICAL IMPLEMENTATION 1

*1
/INTERRUPT PROCESSOR
 6132 /SKIP ON LIGHT PEN FLAG AND RESET FLAG
 SKP
 JMP I 7
 KCC
 ION
 JMP I 0
 PENHIT

*20
/TRACKING CROSS
CROSS, 3000 /REPLACE BY 1307 TO TURN CROSS ON
YT, 0 /Y COORDINATE OF CENTER OF CROSS
XT, 0 /X COORDINATE OF CENTER OF CROSS
 1321
 0000
 2040
 4000
 0100
X1, 4000
 2100
X2, 2040
 0040
 4100
 0000
Y1, 6100
 4000
Y2, 3000

/DISPLAY FILE PARAMETERS
LINES, 2200 /LINE STORAGE
PJ, 4460 /PJMP TABLE
DISF, 4500 /DISPLAY FILE
ABAS, BASIC /PERMANENT DISPLAY FILE
DSS, DRAW /DRAW STATE SWITCH
CSS, CONNCT /CONNECT STATE SWITCH
ESS, ERASE /ERASE STATE SWITCH

/TRACKING CROSS STOP ADDRESSES
AX1, -X1
AX2, -X2
AY1, -Y1
AY2, -Y2

/LITERALS
K0005, 5
K0477, 477
K1307, 1307
K1327, 1327
K2000, 2000
K2010, 2010
K3000, 3000
K3300, 3300
K3124, 3124
K3777, 3777
K4000, 4000
K4001, 4001
K5000, 5000
K6000, 6000
K6302, 6302
K6451, 6451
K7240, 7240
K7640, 7640
K7700, 7700
K7740, 7740
K7772, 7772
K7774, 7774
K7776, 7776

/VARIABLE STORAGE
YMIN, 0
YMAX, 0
XMIN, 0
XMAX, 0
Y, 0 /LATEST Y HIT
X, 0 /LATEST X HIT
CLOCK, 0 /TIME COUNT FOR LOSS OF TRACKING
LINE, 0 /ADDRESS OF CURRENT LINE BLOCK
PTDRAW, 0 /POINT DRAWING SWITCH
DAC, 0 /DISPLAY ADDRESS DURING MODIFICATION

*200
 CLA CMA /PROGRAM STARTS HERE
 TAD DISF
 DCA 10
 TAD K0477
 DCA I 10 /STORE PARAMETERS
 TAD K2010
 DCA I 10 /STORE PJMP
 TAD ABAS
 DCA I 10 /STORE ADDRESS OF BASIC DISPLAY
 TAD K2000
 DCA I 10 /STORE JUMP
 TAD DISF
 DCA I 10 /STORE DISPLAY FILE ADDRESS
 CMA
 TAD LINES
 DCA 11
LA, TAD K1327
 DCA I 11
 DCA I 11
 DCA I 11
 TAD K4001
 DCA I 11
 TAD K4001
 DCA I 11
 TAD K3000
 DCA I 11
 TAD 11
 CMA
 TAD PJ
 SZA CLA /CHECK FOR END OF LINE BLOCK FILE
 JMP LA
 DCA I DSS
 DCA I CSS
 DCA I ESS
 TAD LINES
 DCA 11 /INITIALIZE LINE BLOCK POINTER
 TAD PJ
 6135 /SET PJMP POINTER
 CLA
 TAD K3124
 6145 /ENABLE LIGHT PEN INTERRUPT, DISABLE EDGE FLAGS
 CLA
 TAD K4000
 6155 /SET BREAK FIELD TO 0
 CLA
 TAD DISF
 6165 /START DISPLAY
TIMER, ION
 CLA
 DCA CLOCK
 ISZ CLOCK
 JMP .-1
 ISZ CLOCK
 JMP .-1
 TAD X
 SNA CLA /CHECK FOR SOME HITS SINCE LAST TIME
 JMP .+3
 DCA X
 JMP TIMER
 IOF
 TAD CROSS
 TAD K5000
 SNA CLA /CHECK FOR CROSS ON
 JMP TIMER
 TAD K3000
 DCA CROSS /INHIBIT TRACKING CROSS
 JMP I STOP

/LIGHT PEN PROCESSOR
PENHIT, CLA
 6052 /READ X REGISTER
 DCA X
 6054 /READ Y REGISTER
 DCA Y
 6061 /READ DISPLAY ADDRESS
 TAD AX1
 SZA CLA /CHECK FOR XMIN HIT
 JMP .+4
 TAD X
 DCA XMIN
 JMP RESUME
 6061 /READ DISPLAY ADDRESS
 TAD AX2
 SZA CLA /CHECK FOR XMAX HIT
 JMP .+4
 TAD X
 DCA XMAX
 JMP RESUME
 6061 /READ DISPLAY ADDRESS
 TAD AY1
 SZA CLA /CHECK FOR YMIN HIT
 JMP .+4
 TAD Y
 DCA YMIN
 JMP RESUME
 6061 /READ DISPLAY ADDRESS
 TAD AY2
 SZA CLA /CHECK FOR YMAX HIT
 JMP TRKON
 TAD Y
 DCA YMAX
 JMS I MVPT
 TAD YMIN
 TAD YMAX
 CLL RAR /DIVIDE BY 2
 DCA YT /SET NEW Y COORDINATE
 TAD XMIN
 TAD XMAX
 CLL RAR /DIVIDE BY 2
 TAD K4000
 DCA XT /SET NEW X COORDINATE
RESUME, 6174 /RESUME DISPLAY
 JMP TIMER
TRKON, TAD CROSS
 TAD K5000
 SZA CLA /CHECK FOR INHIBITED TRACKING CROSS
 JMP I FIX
 TAD K1307
 DCA CROSS /TURN TRACKING CROSS ON
 TAD Y
 DCA YT /SET Y COORDINATE
 TAD X
 TAD K4000
 DCA XT /SET X COORDINATE
 JMP I START

/OFF PAGE ADDRESSES
START, HIT /TRACKING INITIATED
FIX, MODIFY /TRACKING IN PROCESS
STOP, LOST /TRACKING LOST
MVPT, MDRAW

*400
/LINE CREATION
HIT, CLA
 TAD I DSS
 SNA CLA /CHECK FOR DRAW STATE
 JMP I RETURN
 TAD YT
 TAD K7640
 SMA CLA /CHECK FOR LIGHT BUTTON HIT
 JMP CREATE
 TAD XT
 TAD K3300
 SMA CLA /CHECK FOR DRAW HIT
 JMP I RETURN
CREATE, TAD LINE
 DCA 12
 ISZ 12
 ISZ 12
 TAD I 12
 TAD K3777
 SZA CLA /CHECK FOR UNIT Y INCREMENT
 JMP NEWL
 TAD I 12
 TAD K3777
 SZA CLA /CHECK FOR UNIT X INCREMENT
 JMP NEWL
 TAD LINE
 JMS I ADEL
NEWL, TAD DISF
 DCA 10
ENDCHK, TAD I 10
 TAD K6000
 SNA CLA /CHECK FOR NO END OF FILE
 JMP EDF
 TAD I 10
 SZA CLA /CHECK FOR NOP
 JMP ENDCHK
 ISZ 10
 ISZ 10
 JMP STORE
EDF, TAD I 10
 DCA 12
 TAD K2000
 DCA I 10
 TAD 12
 DCA I 10
STORE, TAD K7774
 TAD 10
 DCA 10
 TAD K2010
 DCA I 10
 TAD 11
 DCA I 10
 TAD 11
 DCA LINE
 TAD YT
 DCA I 11
 TAD XT
 TAD K4000
 DCA I 11
 TAD K4001
 DCA I 11
 TAD K4001
 DCA I 11
 ISZ 11
 ISZ 11
CHKL, TAD 11
 CIA
 TAD PJ
 SZA CLA /CHECK FOR END OF LINE STORAGE
 JMP OK
 TAD LINES
 DCA 11
OK, TAD I 11
 SZA CLA /CHECK FOR FREE LINE BLOCK
 JMP NEXT
 CMA
 TAD 11
 DCA 11
 TAD YT
 TAD K7640
 SPA CLA /CHECK FOR NO LIGHT BUTTON HIT
 CMA
 DCA PTDRAW /SET POINT DRAWING SWITCH
 JMP I RETURN
NEXT, TAD K0005
 TAD 11
 DCA 11
 JMP CHKL

/LIGHT BUTTON CONTROL
LOST, CLA
 TAD YT
 TAD K7640
 SMA CLA /CHECK FOR LIGHT BUTTON HIT
 JMP I TIME
 TAD XT
 TAD K3300
 SPA /CHECK FOR NO DRAW HIT
 JMP SDRAW /ENTER DRAW STATE
 TAD K7240
 SPA CLA /CHECK FOR ERASE HIT
 JMP SCNCT /ENTER CONNECT STATE
 TAD K6302
 DCA I ESS
 DCA I DSS
 DCA I CSS
 JMP I TIME
SDRAW, CLA
 TAD K6302
 DCA I DSS
 DCA I CSS
 DCA I ESS
 JMP I TIME
SCNCT, TAD K6302
 DCA I CSS
 DCA I DSS
 DCA I ESS
 JMP I TIME

/OFF PAGE ADDRESSES
RETURN, RESUME
TIME, TIMER
ADEL, DELETE

*600
/LINE MODIFICATION
MODIFY, 6061 /READ DISPLAY ADDRESS
 DCA DAC
 TAD I DAC
 TAD K5000
 SNA CLA /CHECK FOR NO POP INSTRUCTION
 IAC
 TAD K7772
 TAD DAC
 DCA DAC /STORE ADDRESS OF LINE HIT
 TAD I DAC
 TAD K6451
 SZA CLA /CHECK FOR VALID LINE ADDRESS
 JMP I RES
 TAD I ESS
 SNA CLA /CHECK FOR ERASE STATE
 JMP NOERAS
 TAD DAC
 JMS I BDEL
 JMP I RES
NOERAS, TAD DAC
 DCA 13
 TAD I 13
 CIA
 TAD YT
 SPA
 CIA
 TAD K7740
 SMA CLA /CHECK FOR START POINT Y COORDINATE
 JMP NSTRT
 TAD I 13
 CIA
 TAD XT
 TAD K4000
 SPA
 CIA
 TAD K7740
 SMA CLA /CHECK FOR START POINT X COORDINATE
 JMP NSTRT
 TAD I CSS
 SNA CLA /CHECK FOR CONNECT STATE
 JMP NSTRT
 TAD DAC
 DCA 12
 TAD 13
 DCA 14
 TAD YT
 JMS I SSP
 TAD XT
 TAD K4000
 JMS I SSP
 TAD DAC
 DCA 12
 TAD YT
 DCA I 12
 TAD XT
 TAD K4000
 DCA I 12
 JMP I RES
NSTRT, TAD I DSS
 SNA CLA /CHECK FOR DRAW STATE
 JMP MEP
 TAD PTDRAW
 SZA CLA /CHECK FOR END POINT NOT ALREADY MOVED
 JMP I RES
 TAD DAC
 CIA
 TAD LINE
 SZA CLA /CHECK FOR CURRENT LINE
 JMP I RES
MEP, TAD DAC
 IAC
 IAC
 DCA 13
 TAD DAC
 DCA 14
 TAD I 14
 CLL RAL
 DCA 12
 TAD I 13
 CLL RAL
 SMA
 JMP .+3
 CIA
 TAD K4000
 TAD 12
 CIA
 TAD YT
 TAD YT
 SPA
 CIA
 TAD K7700
 SMA CLA /CHECK FOR END POINT Y COORDINATE
 JMP I RES
 TAD I 14
 CLL RAL
 DCA 12
 TAD I 13
 CLL RAL
 SMA
 JMP .+3
 CIA
 TAD K4000
 TAD 12
 CIA
 TAD XT
 TAD XT
 SPA
 CIA
 TAD K7700
 SMA CLA /CHECK FOR END POINT X COORDINATE
 JMP I RES
 TAD DAC
 DCA 12
 TAD YT
 JMS I SEP
 TAD XT
 TAD K4000
 JMS I SEP
 JMP I RES

/OFF PAGE ADDRESSES
RES, RESUME
BDEL, DELETE
SSP, SSPV
SEP, SEPV

*1000
/LINE DELETION AND MOVING SUBROUTINES
DELETE, 0 /DELETE LINE WHOSE ADDRESS IS IN AC
 DCA 12
 TAD DISF
 DCA 10
NXTADR, TAD I 10
 TAD K6000
 SNA CLA /CHECK FOR NO END OF DISPLAY FILE
 JMP I DELETE
 TAD I 10
 CIA
 TAD 12
 SZA CLA /CHECK FOR PROPER LINE ADDRESS
 JMP NXTADR
 TAD K7776
 TAD 10
 DCA 10
 DCA I 10
 DCA I 10
 DCA I 12
 JMP I DELETE
SSPV, 0 /SET START POINT VECTOR
 CLL RAL
 CIA
 DCA 15
 TAD I 12
 CLL RAL
 TAD 15
 DCA 15
 TAD I 13
 CLL RAL
 SMA
 JMP .+3
 CIA
 TAD K4000
 TAD 15
 SMA
 JMP .+3
 CIA
 TAD K4000
 CLL RAR
 SNA /CHECK FOR NONZERO INCREMENT
 IAC
 TAD K4000
 DCA I 14
 JMP I SSPV
SEPV, 0 /SET END POINT VECTOR
 CLL RAL
 DCA 15
 TAD I 12
 CLL RAL
 CIA
 TAD 15
 SMA
 JMP .+3
 CIA
 TAD K4000
 CLL RAR
 SNA /CHECK FOR NONZERO INCREMENT
 IAC
 TAD K4000
 DCA I 14
 JMP I SEPV

MDRAW, 0 /MOVE CURRENT LINE IF START POINT MOVABLE
 TAD PTDRAW
 SNA CLA /CHECK FOR MOVABLE START POINT
 JMP I MDRAW
 TAD I DSS
 SNA CLA /CHECK FOR DRAW STATE
 JMP I MDRAW
 TAD LINE
 DCA 12
 TAD YT
 DCA I 12 /SET Y COORDINATE OF CURRENT LINE
 TAD XT
 TAD K4000
 DCA I 12 /SET X COORDINATE OF CURRENT LINE
 JMP I MDRAW

*1200
/PERMANENT DISPLAY FILE
BASIC, 2010
 CROSS /TRACKING CROSS
 0015 /REDUCE INTENSITY TO 5
 2010
 BUTTON /LIGHT BUTTONS
 2010
 SELGI /SEL ADVERTISEMENT
 3000

/LIGHT BUTTON DISPLAY
BUTTON, 1307
 0040
 4140
DRAW, 0 /BLINK OPTION
 2010
 D
 2010
 R
 2010
 A
 2010
 W
 6301 /TURN BLINK OFF
CONNCT, 0 /BLINK OPTION
 1321
 0000
 4240
 2010
 C
 2010
 O
 2010
 N
 2010
 N
 2010
 E
 2010
 C
 2010
 T
 6301 /TURN BLINK OFF
ERASE, 0 /BLINK OPTION
 1321
 0000
 4240
 2010
 E
 2010
 R
 2010
 A
 2010
 S
 2010
 E
 6301 /TURN BLINK OFF
 3000

/SEL LABEL DISPLAY
SELGI, 1307
 1740
 4670
 2010
 CS
 2010
 CE
 2010
 CL
 2010
 CG
 2010
 CI
 2010
 DASH
 2010
 C1
 1301
 1700
 4437
 2010
 CS
 2010
 CY
 2010
 CS
 2010
 CT
 2010
 CE
 2010
 CM
 2010
 CS
 2010
 BLANK
 2010
 CE
 2010
 CN
 2010
 CG
 2010
 CI
 2010
 CN
 2010
 CE
 2010
 CE
 2010
 CR
 2010
 CI
 2010
 CN
 2010
 CG
 2010
 BLANK
 2010
 CL
 2010
 CA
 2010
 CB
 2010
 CO
 2010
 CR
 2010
 CA
 2010
 CT
 2010
 CO
 2010
 CR
 2010
 CY
 3000

/LIGHT BUTTON CHARACTER SET
A, 1321
 4040
 0012
 6040
 0012
 0020
 2006
 4000
 2012
 2020
 4032
 3000
C, 1321
 4040
 0000
 4000
 0024
 2040
 0000
 4000
 2024
 0000
 4040
 3000
D, 1321
 4040
 0000
 4000
 0014
 6010
 0010
 6020
 0000
 6010
 2010
 6000
 2014
 0000
 4040
 3000
E, 1321
 4040
 0000
 4000
 0024
 2020
 2024
 4000
 0012
 2020
 2012
 4000
 0024
 0000
 4016
 3000
N, 1321
 4040
 0000
 6040
 0024
 4040
 0000
 2040
 4014
 3000
O, 1321
 4040
 0000
 4000
 0024
 6040
 0000
 4000
 2024
 0000
 4040
 3000
R, 1321
 4040
 0000
 4000
 0024
 6020
 0000
 4000
 2024
 0000
 0012
 6020
 0012
 0000
 4014
 3000
S, 1321
 4000
 0024
 4020
 0000
 4000
 2024
 4020
 0000
 4000
 0024
 2040
 4014
 3000
T, 1321
 0040
 0000
 4000
 0024
 0000
 2012
 6040
 0000
 0000
 4026
 3000
W, 1321
 0040
 0000
 6040
 0005
 4040
 0005
 6040
 0005
 4040
 0005
 2040
 4014
 3000

/SMALL CHARACTER SET
CA, 1341
 5604
 7604
 0722
 4024
 2755
 3000
CB, 1341
 5600
 4006
 6202
 6300
 6222
 4026
 2700
 4006
 4202
 4300
 4222
 2751
 3000
CE, 1341
 5600
 4010
 2730
 4005
 2725
 4010
 0047
 3000
CG, 1341
 5600
 4010
 3730
 4010
 4500
 4024
 2553
 3000
CI, 1341
 4010
 0024
 5600
 0024
 4010
 3647
 3000
CL, 1341
 1600
 7600
 4010
 0047
 3000
CM, 1341
 5600
 6704
 4704
 7600
 0047
 3000
CN, 1341
 5600
 7610
 5600
 3647
 3000
CO, 1341
 5600
 4010
 7600
 4030
 0057
 3000
CR, 1341
 5600
 4010
 6700
 4030
 0004
 6704
 0047
 3000
CS, 1341
 4010
 4700
 4030
 4700
 4010
 3647
 3000
CT, 1341
 1600
 4010
 0024
 7600
 0053
 3000
CY, 1341
 1600
 6704
 4704
 2724
 6700
 0053
 3000
C1, 1341
 1202
 4402
 7600
 0024
 4010
 0047
 3000
DASH, 1341
 0700
 4010
 2747
 3000
BLANK, 1341
 0057
 3000
$
