2 / F4 LIBRARY P L O T . R A
4 / PLOT.RA RELEASE 22-MAY-74 ON S8-LFTNA-C-VAV
8 / CLRPLT: INSERTS THE DISPLY TASK ONLY ONCE INTO THE IDLE QUEUE.
12 / CLRPLT: THERE IS AN OPTIONAL THIRD PARAMETER. IT SPECIFIES THE NUMBER
13 / OF (X,Y) POINTS ALREADY PRESENT IN THE BUFFER TO BE DISPLAYED.
14 / EACH (X,Y) PAIR CONSITS OF TWO SIGNED 10 BIT INTEGERS STORED IN ONE
17 / EXAMPLE: CALL CLRPLT (BUFFER,LENGTH)
18 / CALL CLRPLT (SAMPLE,LENGHT,SAMCNT) DISPLAYES SAMCNT POINTS
26 COMMZ #PAGE0 /STANDARD PAGE 0
28 0 /ALPHA REG FOR PDP-12
29 ENTRY #DISP /THIS IS SO #PAGE0 CAN BE LOADED
32 TAD BUFADR+2 /GET BUFFER ADDRESS
34 TAD DBFLD /SET UP CHANGABLE CDF
36 DBFLD, HLT /GO TO FIRST FIELD OF BUFFER
37 TAD PLTXR+4 /NUMBER OF POINTS
40 JMP ENDDL /BEGIN DISPLAY
41 DSPLUP, /START OF DISPLAY LOOP
43 TAD% BUFADR /GET X VALUE
44 6053 /LOAD X DISPLACEMENT
46 ISZ BUFADR /BUMP ADDRESS
50 6054 /LOAD Y DISPLACEMENT
52 ISZ BUFADR /INCR ADDRESS
55 6052 /SKIP ON BEAM POSITIONED
60 TAD% BUFADR /GET X DISPLACEMENT
61 DCAZ 17 /INTO ALPHA REG
62 ISZ BUFADR /INCREMENT ADDRESS
64 JMS BUMPF /INCREMENT DATA FIELD
65 TAD% BUFADR /GET Y DISPLACEMENT
71 ISZ BUFADR /INCR BUFFER POINTER
75 ENDDL, ISZ NPTS /INCREMENT COUNTER
78 JMP% DISPLY /RETURN TO IDLE Q
79 BUMPF, 0 /FIELD CHANGER
83 FLDDB, HLT /CHANGE IT NOW
85 PUTONQ, 0 /PUT DISPLY ONTO BACKROUND Q
86 TAD BUFADR+1 /CREATE CDF FOR DISPLAY LOOP
93 6050 /CLEAR DISPLAY LOGIC
103 JMP% PUTONQ /CALLED VIA TRAP4
155 FLDA% PLTBAS,1 /GET ARG ADDRESSES
162 FLDA% N /NUMBER OF POINTS TO PLOT
165 LDX -1,2 /XR 2 IS THE INDEXER
166 PLTLUP, JXN PLOOP,3+ /ANY MORE ROOM IN PLOT BUFFER ?
167 LDX -1,3 /NO, FIX COUNT
169 PLOOP, FLDA% Y,2+ /GET Y VALUE
170 FMUL YSCALE /SCALE IT
171 FSUB YZERO /SUBTRACT LOWER LIMIT
174 FLDA% X,2 /GET X VALUE OF PAIR
175 FMUL XSCALE /SCALE IT
176 FSUB XZERO /SUBTRACT LOWER LIMIT
179 FSTA XYPAIR,0 /XYPAIR+1,+2 CONTAINS THE POINT
180 FLDA XYPAIR /STORE THIS DOUBLE WORD INTO PLOT BUFFER
182 ADDX 1,4 /TROUBLE IS, WE WANT POST INCREMENT
184 JXN PLTLUP,1+ /LOOP IF MORE POINTS
189 FLDA 30 /GET RETURN ADDRESS
191 FLDA 0 /GET ARG POINTER
201 FLDA% PLTBAS,1 /GET ARG ADDRESSES
212 FLDA% N /NUMBER OF POINTS TO PLOT
215 LDX -1,2 /XR 2 IS THE INDEXER
216 PLOTRL, FLDA% Y,2+ /GET Y VALUE
217 FMUL YSCALE /SCALE IT
218 FSUB YZERO /SUBTRACT LOWER LIMIT
221 FLDA% X,2 /GET X VALUE OF PAIR
222 FMUL XSCALE /SCALE IT
223 FSUB XZERO /SUBTRACT LOWER LIMIT
226 FSTA XYPAIR,0 /XYPAIR+1,+2 CONTAINS THE POINT
227 FLDA XYPAIR /STORE THIS DOUBLE WORD INTO PLOT BUFFER
229 ADDX 1,5 /TROUBLE IS, WE WANT POST INCREMENT
231 JXN PLOTRL,1+ /LOOP IF MORE POINTS
236 LDX 0,4 /DISABLE DISPLAY LOOP
238 FLDA% PLTBAS,1 /GET ARG POINTERS
244 FLDA% N /SIZE OF BUFFER
245 FMUL L1P5 /NUMBER OF 2 WORD PAIRS
247 ATX 3 /INTO SOME CHOICE XRS
249 FLDA% PLTBAS,0 / LOAD RETURN ADR. --> FAC
250 FSUB PLTBAS / SUBTRACT PARAMETER LIST ADR.
251 FSUB LC6 / FAC=0 <==> TWO PARAM. ELSE FAC=2 <==> THREE PAR.
252 JEQ CTRP0 / CONTINUE AT CTRP0 IF THERE ARE TWO PARA. ONLY
253 FLDA% PLTBAS,1+ / LOAD ADR. OF THIRD PARAMETER
254 FSTA TEMP / LOAD CONTENTS OF THIRD PARAMETER
256 FLDA% TEMP / NUMBER OF POINTS ALREADY TO DISPLAY
257 ATX 4 / INSERT IT INTO X4 THE WORD COUNT REGISTER
260 CTRP, TRAP4 PUTONQ /PUTISPLY ONTO IDLE Q
261 STARTD / BUT PUT DISPLY ONLY ONCE ONTO THE IDLE LOOP
263 FSTA CTRP / CLEAR TRAP4 INTO FNOP
265 LFNOP, FNOP / TWO FNOP INSTRUCTION MUST FOLLOW HERE!
269 \f SECT SCALE /SET SCALING FACTORS
273 FLDA% PLTBAS,1 /GET ARGS
282 FLDA% XHI /COMPUTE X RANGE
285 FLDA% YHI /NOW Y RANGE
288 FLDA RANGE /COMPUTE XSCALE
291 FLDA RANGE /NOW Y SCALE
294 FLDA% XLO /COMPUTE XZERO