.TITLE DOTPLT--DOT PLOT INTERFACE FOR Q .SBTTL DOCUMENTATION .IDENT /25MAR0/ ;+ ; - D O T P L T ;****NAME: SUBROUTINE DOTPLT ; FILE: DP1:[22,221]DOTPLT.ALX ; TKB: -- ; ;****PURPOSE: ; ; THIS MODULE IS THE DOTPLOT INTERFACE FOR TASKS. IT RECEIVES COMMANDS ; AND INFORMATION FROM THE HDO KEYBOARD INTERFACE AND DOES THE ACTUAL ; PLOTTING. THERE MAY BE UP TO 4 ACTIVE PLOTS AT A TIME. ; ;****RESTRICTIONS: THE PLOTTING TASK MUST NOT USE LUN 3 FOR ANY PURPOSE. ; ; SYSTEM: RSX11D V6.2 ONLY; WHEN 11M MAILBOX HANDLER WORKS, CAN GET ; GOING ON 11M BY REPLACING VRCD$ AND SDRQ$S ; BY MAILBOX ; LANGUAGE: ALECS/MACRO 11 ; AUTHOR: M. OOTHOUDT BASED ON CODE WRITTEN BY R. JEPPERSON, ; M. KELLOGG AND N. SPENCER. ; DATE: 18-DEC-78 ; REVISIONS: ; 12-JAN-79 (MAO) RECEIVE DATA ONLY FROM ...HDO SO USER RECEIV'S WILL ; WORK (USER SDRA$ STILL WON'T WORK) ; 13-JUN-79 (MAO) OUT OF BOUNDS POINTS AT 3 OUT, NOT 5. ; 14-JUN-79 (MAO) SET UP FOR DATA VALUE RANGE OF +-32K ; 25-MAR-80 (MAO) CONVERT FROM ASSEMBLY LANGUAGE TO ALECS ; ;****CALLING SEQUENCE: ; ; THERE ARE 2 EXTERNAL ENTRY POINTS IN THIS PACKAGE: ; DOTMGE INITIALIZES THE DOTPLOTTING ROUTINES. THIS ROUTINE ; SHOULD BE CALLED ONCE BY THE DOTPLOTTING TASK. IN A Q ; ANALYZER THE CALL WOULD BE DONE IN THE BACKGROUND. THIS ; ROUTINE SPECIFIES A RECEIVE AST. ; DOTOUT PUTS OUT DOTS ON ACTIVE PLOTS FOR PLOTTING TASK. ; ; INPUT: NONE ; ; OUTPUT: NONE ; ; CMN BLOCK I/O: NONE ; ;****DIALOG: NONE ; ; RESOURCES: ; LIBRARIES: [22,221]MDLIB:F4010:TPLOT ; OTHER SUBR: NONE ; DISK FILES: NONE ; DEVICES: TTN:3 ; SGAS: NONE ; EVENT FLAGS: NONE ; SYSTEM DIR: DIR$,VRCD$,SDRQ$S,ASTX$S,SRDA$S,ALUN$S,IHAR$S,ENAR$S ; LENGTH/PAR: ; ;****NOTES: ; 1. THIS MODULE ONLY WORKS UNDER 11D DUE TO VRCD$ & SDRQ$ USAGE. ; REASON USED IS THAT HDO NEEDS TO SEND >13 WORDS TO DOTINI TO DEFINE A ; NEW PLOT. THERE IS NO FAST, SAFE WAY TO DO THIS THAT IS 11M/11D ; COMPATIBLE. SINCE WE ARE NOT CURRENTLY SUPPORTING AN 11M SYSTEM, I ; DO IT THIS WAY. WHEN WE DO GET UP 11M WE WILL HAVE A MAILBOX HANDLER ; THAT CAN PERFORM THIS FUNCTION. AT THAT TIME CODE CAN BE MADE D/M ; COMPATIBLE. NOTE THAT THE OLD VERSION OF DOTPLT USED SELECTIVE ; CANCEL MARK TIMES & WAS THEREFORE NOT 11M COMPATIBLE EITHER!! ; ;- .SBTTL MACRO DEFINITIONS ; ; .MCALL DIR$,VRCD$,SDRQ$S,ASTX$S,SRDA$S,ALUN$S ;SYSTEM DIRECTIVES .MCALL IHAR$S,ENAR$S ; ; DEFINE PUSH, POP MACROS--NOTE THAT THESE 2 MACROS ARE IN PREFIX ; FILE MD.MAC. HOWEVER, WE CANNOT USE THAT FILE HERE DUE TO USE ; OF VRCD$ & SDRQ$ (SEE NOTE 1). WHEN THAT IS FIXED, GET RID ; OF DEFINITION HERE. NOTE ALSO THAT THE CALLS TO F4010 & TPLOT ; MAY USE "CALL" MACRO FROM MD.MAC WHEN IT IS USED. ; .MACRO PUSH X .IRP Y, MOV Y,-(SP) .ENDM .ENDM PUSH ; .MACRO POP X .IRP Y, MOV (SP)+,Y .ENDM .ENDM POP ; ; MACRO TO ALLOCATE & ZERO LEN BYTES ; .MACRO BYALOC LEN .REPT LEN .BYTE 0 .ENDM .ENDM BYALOC .SBTTL DATA BASE ; ; LOCAL DATA FOR ALL PLOTS ; TTN: .BYTE 0 ;TERMINAL UNIT # FOR PLOT DOTEV: .BYTE 0 ;EVENT # FROM DOTOUT CALL DWDADR: .WORD 0 ;ADDR OF DWD ARRAY FOR DOTOUT CALL LUN=3 ;LOGICAL UNIT # FOR PLOT F0=%0 ;FLOATING POINT REGISTER USED F1=%1 ; ; THE FOLLOWING ARE BYTE OFFSETS INTO THE PLOT PARAMETER BLOCKS (PPB) ; FOR EACH PLOT ; EVT=0 ;EVENT # FOR PLOT PTT=1 ;PLOTTING TT--COULD DIFFER FROM TTN PLTNAM=2 ;PLOT NAME IN RAD50 FORMAT TEST=6. ;ALLTST TEST TO GATE PLOT WITH NUMPNT=8. ;MAX # POINTS TO PLOT (.LE.0-->INFINITE #) ;X PARAMETERS INDEXX=10. ;X DATA BYTE OFFSET IXXMIN=12. ;MIN X DATA VALUE TO PLOT IXXMAX=14. ;MAX X DATA VALUE TO PLOT MASKX=16. ;BIC MASK FOR X DATA VALUE SHIFTX=18. ;#BITS TO ASH TO ALIGN DATA WITH MASK XSCALE=20. ;X SCALE FACTOR IX0=24. ;MIN X SCREEN COORDINATE FOR PLOT IX1=26. ;MAX X SCREEN COORDINATE FOR PLOT ;Y PARAMETERS INDEXY=28. ;Y DATA BYTE OFFSET IYYMIN=30. ;MIN Y DATA VALUE TO PLOT IYYMAX=32. ;MAX Y DATA VALUE TO PLOT MASKY=34. ;BIC MASK FOR Y DATA VALUE SHIFTY=36. ;#BITS TO ASH TO ALIGN DATA WITH MASK YSCALE=38. ;Y SCALE FACTOR IY0=42. ;MIN Y SCREEN COORDINATE FOR PLOT IY1=44. ;MAX Y SCREEN COORDINATE FOR PLOT ;PLOT CONTROL PNTPLT=46. ;# OF POINTS TO PLOT FOR THIS PLOT PLTSTS=48. ;PLOT STATUS= -1-->SUSPENDED ; 0-->ABORTED ; +1-->ACTIVE ; ; OFFSETS INTO X OR Y PARAMETERS ; INDEX=0 ;DATA WORD BYTE OFFSET MINDV=IXXMIN-INDEXX ;MIN DATA VALUE IN PLOT MAXDV=IXXMAX-INDEXX ;MAX DATA VALUE IN PLOT MASK=MASKX-INDEXX ;BIC MASK FOR DATA VALUE SHIFT=SHIFTX-INDEXX ;ASH SHIFT TO ALIGN DATA WITH MASK SCALE=XSCALE-INDEXX ;SCALING FACTOR, DATA VALUE-->SCREEN COORD MINSC=IX0-INDEXX ;MIN SCREEN COORD IN PLOT MAXSC=IX1-INDEXX ;MAX SCREEN COORD IN PLOT ; TBLLEN=PLTSTS+2 ;BYTE LENG OF PLOT PARAMETER BLOCK (PPB) ;****MUST BE EVEN**** ; ; PLOT PARAMETER BLOCKS (PPB), 1 FOR EACH POSSIBLE ACTIVE PLOT ; .EVEN PLOT1: BYALOC TBLLEN PLOT2: BYALOC TBLLEN PLOT3: BYALOC TBLLEN PLOT4: BYALOC TBLLEN PLOTE: ;LABEL FOR END OF TABLE ; ; PLTACT: .BYTE 0 ;# OF ACTIVE PLOTS (EXCLUDES SUSPENDED ; PLOTS) PLTDFN: .BYTE 0 ;# OF DEFINED PLOTS=ACTIVE+SUSPENDED BUFLEN=TBLLEN-4/2+1 ;WORD LENGTH OF VRCD$ BUFFER ;GET ALL BUT 2 WORDS OF PPB +1 EXTRA .EVEN RSBUF: ;BUFFER FOR VRCD$ .WORD 0,0 ;SENDER TASK NAME FCT: .WORD 0 ;FUNCTION TO PERFORM MSG: .BLKW BUFLEN-1 ;MESSAGE ; ; RSBUF IS ALSO USED TO SEND MESSAGES BACK TO HDO. IN THAT CASE ; FCT=AN ERROR CODE ; =0-->NO ERRORS ; =1-->ILLEGAL FUNCTION CODE ; =2-->SINGLE PLOT TO /AB NOT DEFINED ; =3-->/AB,/SU,/RE FAILED--NO PLOTS DEFINED/ACTIVE/SUSPENDED ; =5-->/SH FAILED--4 PLOTS ALREADY DEFINED ; =6-->PLOT TO /SH ALREADY ACTIVE OR SUSPENDED ; MSG=INFO TO BE RETURNED (ONLY 1ST 12 WORDS USED) ; ; ; DATA FOR TPLOT CALL IN SUBR DOTOUT ; PNT: .WORD -1 ;POINT PLOT X: .WORD 0 ;X SCREEN COORDINATE OF PLOTTED POINT Y: .WORD 0 ;Y SCREEN COORDINATE OF PLOTTED POINT ; TARGS: .BYTE 3,0 ;ARGUEMENT LIST FOR TPLOT CALL .WORD 0 ;POINT PLOT (SET AT DOTMGE TIME) .WORD 0 ;ADDR OF X COORD (SET AT DOTMGE TIME) .WORD 0 ;ADDR OF Y COORD (SET AT DOTMGE TIME) ; ; DATA FOR F4010 CALLS ; ARGS: .BYTE 0,0 .SBTTL DOTOUT: PLOT POINTS FOR DOTPLOTTING TASK ;+ ; D O T O U T ; ; DOTOUT IS CALLED BY THE DOTPLOTTING TASK. IF DOT PLOTTING IS ; ENABLED (BY ...HDO) FOR THE GIVEN EVENT, IT OUTPUTS A DOT AT THE ; APPROPRIATE PLACE. ; ; F4P CALL: CALL DOTOUT(EVN,EVBUF) ; WHERE EVN=(I*2) EVENT # ; EVBUF=(I*2)EVENT BUFFER START ADDR ; ; EG. COMMON/DWD9/IHEAD9,IDATA(20) ; IEVENT=9 ; CALL DOTOUT(IEVENT,IHEAD9) ; ; MACRO CALL: CALL DOTOUT ; ; TIMING: IN F4P ON 11/70 THE FOLLOWING LOOP WAS TIMED: ; (Q SYSTEM INSTALLED, BUT COMPUTER QUIET AND STATUS CANCELLED) ; ; T1=SECNDS(0.0) ; DO 500 I=1,1000 (10000 FOR FAST STUFF, RESULTS BELOW SCALED ; TO 1000) ; CALL DOTOUT(IEVN,IHEAD) ; 500 CONTINUE ; DT=SECNDS(T1) ; ; DT= 0.012 SEC FOR NO PLOTS ACTIVE ; 0.065 SEC FOR 1 ACTIVE PLOT WITH EVENT #.NE.IEVN ; 12.95 SEC FOR 1 ACTIVE PLOT WITH EVENT #=IEVN, POINT IN OR ; OUT OF BOUNDS ; 0.128 SEC IF LINE "JSR PC,TPLOT" COMMENTED OUT OF CODE ; FOR SAME PLOT THAT-->12.95 SEC ; ; CONCLUSION: MOST TIME IN DOTOUT IS SPENT IN TPLOT DOING QIO TO 4010! ; ; (NOTE THAT EXACT TIMES DEPENDED ON STATUS OF MACHINES. EG. IF ABOVE ; TESTS DONE WITHOUT Q SYSTEM INSTALLED, 12.95 SEC-->11 SEC. HOWEVER, ; RATIO OF TIMES WAS APPROX CONSTANT.) ;- DOTOUT:: ; ; REGISTER USAGE BY DOTOUT AND SCL: ; R0=ADDR OF PPB ; R1,R2=NOT USED ; R3,R4=SCRATCH ; R5=ARGUEMENT POINTER FOR DOTOUT AND TPLOT CALL ; F0,F1=FP CALC ; F2-F5=NOT USED ; IF(PLTACT:NE_B:#0) ;ANY PLOTS ACTIVE? ; PUSH ;YES, SAVE REGISTERS STFPS -(SP) ;SAVE FP STATUS SETD ;SET DOUBLE FOR NEXT OP STD F0,-(SP) ;SAVE FP ACC 0 STD F1,-(SP) ;SAVE FP ACC 1 LDFPS #40000 ;SET FP STATUS TO ;NO INTERRUPT ON ERR (BIT 14 SET) ;SINGLE PRECISION FP (BIT 7 CLEAR) ;16 BIT INTEGERS (BIT 6 CLEAR) ; MOVB @2(R5),DOTEV ;GET GIVEN EVENT # MOV 4(R5),DWDADR ;GET ADDR OF DWD ARRAY MOV #PLOT1,R0 ;ADDR OF FIRST PPB ; WHILE( R0:LT_U:#PLOTE ) ;TRY EACH PPB ; IF( PLTSTS(R0):GT:#0 :AND: EVT(R0):EQ_B:DOTEV ) ; ; PLOT IS ACTIVE AND OF RIGHT EVENT. CALC SCREEN COORDS OF POINT. ; MOV #INDEXX,R3 ;R3=PPB OFFSET TO X PARAMETERS SCALE-COORDINATE ;DO X SCALING MOV R3,X ;STORE X SCREEN COORD MOV #INDEXY,R3 ;R3=PPB OFFSET TO Y PARAMETERS SCALE-COORDINATE ;DO Y SCALING MOV R3,Y ;STORE Y SCREEN COORD ; PUSH ;SAVE NECESSARY REGISTERS MOV #TARGS,R5 ;SET ARGUEMENT POINTER JSR PC,TPLOT ;CALL TPLOT POP ;RESTORE NECESSARY REGISTERS ; IF(NUMPNT(R0):GT:#0) ;IS THERE A COUNT LIMIT? DEC PNTPLT(R0) ;YES, REDUCE COUNTER IF(:Z.SET:) ;IF SET, LAST POINT IHAR$S ;YES, MAKE SURE HDO DOESN'T INTERFERE CLR PLTSTS(R0) ;ABORT PLOT DECB PLTDFN ; 1 LESS DEFINED PLOT DECB PLTACT ; 1 LESS ACTIVE PLOT ENAR$S ;REENABLE AST'S INVOKE-A-F4010-CALL FIN FIN FIN ADD #TBLLEN,R0 ;POINT TO NEXT PPB FIN SETD ;DONE, SET DOUBLE LDD (SP)+,F1 ;RESTORE FP ACC 1 LDD (SP)+,F0 ;RESTORE FP ACC 0 LDFPS (SP)+ ;RESTORE FP STATUS POP ;RESTORE REGISTERS FIN ; RTS PC ;RETURN TO CALLER .SBTTL DOTMGE--PLOT INITIALIZATION ;+ ; ; D O T M G E ; ; DOTMGE: INITIALIZE DOT PLOTTING SYSTEM ; ; DOTMGE SHOULD BE CALLED ONCE & ONLY ONCE BY THE DOTPLOTTING TASK. ; IN A Q ANALYZER THE CALL SHOULD BE FROM THE ANALYZERS BACKGROUND. ; DOTMGE SPECIFIES A RECEIVE AST, FLUSHES ALL MESSAGES SENT BEFORE ; THE RECEIVE AST WAS SPECIFIED & RETURNS TO THE CALLER. ; ; CALL DOTMGE !FORTRAN CALLABLE ; ;- ; ; RECEIVE DATA ONLY FROM ...HDO. THUS DATA RECEIVED FROM OTHER TASKS ; WILL CAUSE AN AST, BUT THE AST WILL BE DEQUED AND THROWN AWAY. THE ; USER CAN THEN DO HIS OWN RECEIVE TO GET THE DATA (ONLY THE AST IS ; THROWN AWAY, NOT THE MESSAGE NODE). ; VREC: VRCD$ ...HDO,RSBUF,BUFLEN ; DOTMGE:: SRDA$S #DOTINI ;SPECIFY THE RECEIVE AST SERVICE ROUTINE. ; ; NODES SENT BEFORE THE SRDA$ WILL NOT CAUSE AN AST. SINCE THEY WERE ; SENT BEFORE WE WERE READY FOR THEM, THEY ARE PROBABLY GARBAGE: FLUSH ; THEM. ; REPEAT UNTIL (:C.SET:) DIR$ #VREC ;FLUSH RECEIVE QUE ; MOV #PNT,TARGS+2 ;SET UP ARG LIST FOR TPLOT CALL MOV #X,TARGS+4 MOV #Y,TARGS+6 RTS PC ;RETURN TO CALLER .SBTTL DOTINI--DOTPLOT CONTROL ; ; ; D O T I N I ; ; DOTINI: CONTROL DOTPLOTS ; ; THIS CODE STARTS, ABORTS, SUSPENDS & RESUMES PLOTS IN RESPONSE ; TO A MESSAGE FROM HDO. IT WILL ALSO ANSWER A QUERY FROM HDO ABOUT ; CURRENT PLOTS. AFTER COMPLETION OF THE FUNCTION, A MESSAGE IS SENT ; BACK TO HDO WITH AN ERROR/SUCCESS CODE. IT IS CALLED AS AN AST ; SERVICE ROUTINE FOR A RECEIVE AST. ; ; DOTINI: PUSH ;AST ROUTINE MUST SAVE ALL REGS USED ; DIR$ #VREC ;GET A MESSAGE FROM ...HDO WHILE(:C.CLR:) SELECT(FCT) ;FCT IS IN RECEIVE BUFFER (#1) SHOW-PLOT (#2) RESUME-SUSPENDED-PLOTS (#3) ANSWER-QUERY (#4) SUSPEND-ACTIVE-PLOTS (#5) ABORT-ONE-OR-ALL-PLOTS (OTHERWISE) MOV #1,FCT ;ILLEGAL FUNCTION CODE FIN ; SDRQ$S #RSBUF,,,,,#FCT ;SEND MSG BACK TO TASK NAMED ;AT RSBUF AND RESUME IT DIR$ #VREC ;GET NEXT MESSAGE FIN ; POP ;RESTORE REGISTERS ASTX$S ;EXIT AST TO ABORT-ONE-OR-ALL-PLOTS .SBTTL DOTINI: ABORT FUNCTION ; ; ABORT PLOTS. MSG CONTAINS NAME OF PLOT OR -1 TO ABORT ALL PLOTS. ; CLR FCT ;ASSUME SUCCESS WHEN(MSG:NE:#-1) ; ; ABORT A SINGLE NAMED PLOT ; FIND-PLOT-IN-LIST WHEN(R0:EQ:#0)MOV #2,FCT ;PLOT TO ABORT NOT DEFINED ELSE CLR @R0 ;MARK IT ABORTED DECB PLTDFN ;ONE LESS DFN PLOT IF(R1:GT:#0) DECB PLTACT ;ONE LESS ACTIVE PLOT INVOKE-A-F4010-CALL FIN FIN ELSE ; ; ABORT ALL ACTIVE/SUSPENDED PLOTS ; WHEN(PLTDFN:EQ_B:#0) MOV #3,FCT ;NO PLOTS TO ABORT ELSE MOV #PLOT1,R0 ;ADDR OF 1ST PPB WHILE(R0:LT_U:#PLOTE) CLR PLTSTS(R0) ADD #TBLLEN,R0 FIN CLRB PLTACT ;0 ACTIVE PLOTS CLRB PLTDFN ;0 DEFINED PLOTS INVOKE-A-F4010-CALL FIN FIN FIN TO ANSWER-QUERY .SBTTL DOTINI: QUERY FUNCTION; RETURN MESSAGE TO HDO ; ; ANSWER QUERY--RETURN PLOT STATUS FOR ALL PLOTS ; MOV #PLOT1,R0 ;ADDR OF 1ST PPB MOV #MSG,R2 ;ADDR OF RETURN MSG WHILE(R0:LT_U:#PLOTE) MOV PLTNAM(R0),(R2)+ ;PLOT NAME, 1ST HALF MOV PLTNAM+2(R0),(R2)+ ;PLOT NAME, 2ND HALF MOV PLTSTS(R0),(R2)+ ;PLOT STATUS ADD #TBLLEN,R0 ;POINT TO NEXT PPB FIN FIN TO FIND-PLOT-IN-LIST .SBTTL DOTINI: GENERAL FUNCTIONS USED ; ; THIS FUNCTION LOCATES A PLOT NAME IN A MESSAGE AT LOCATION MSG ; (OR MSG+2 FOR /SH) AND RETURNS R0=0 IF NAMED PLOT NOT DEFINED. ; OTHERWISE RETURNS R0=ADDR OF PLOT STATUS WORD AND R1=OLD PLOT ; STATUS. ; CLR R0 ;ASSUME FAILURE ; WHEN(FCT:EQ:#1)MOV #MSG+2,R2 ;SHOW FUNCTION ELSE MOV #MSG,R2 ;OTHER FUNCTION IF(@R2:NE:#0) ;=0-->NO PLOT NAME GIVEN IN MSG! MOV #PLOT1,R1 ;1ST PPB ADDR REPEAT UNTIL (R1:GE_U:#PLOTE) IF(PLTSTS(R1):NE:#0 :AND: PLTNAM(R1):EQ:@R2) IF(PLTNAM+2(R1):EQ:2(R2)) MOV R1,R0 ;SAVE THE ADDR ADD #PLTSTS,R0 ;ADDR OF PLOT STATUS MOV #PLOTE,R1 ;FORCE SEARCH TO END FIN FIN ADD #TBLLEN,R1 ;POINT TO NEXT PPB FIN IF(R0:NE:#0)MOV @R0,R1 ;OLD PLOT STATUS FIN FIN TO INVOKE-A-F4010-CALL ; ; FUNCTION TO INVOKE A F4010 CALL ; ; PUSH ;SAVE REGISTERS (WHO KNOWS WHAT ;F4010 WILL DO TO THEM) MOV #ARGS,R5 ;SET UP F4P COMPATIBLE CALL JSR PC,F4010 ;CALL F4010 POP ;RESTORE REGISTERS FIN TO RESUME-SUSPENDED-PLOTS .SBTTL DOTINI: RESUME FUNCTION ; ; RESUME ALL SUSPENDED PLOTS. ; CLR FCT ;ASSUME SUCCESS WHEN(PLTACT:EQ_B:PLTDFN) MOV #3,FCT ;4 PLOTS ALREADY ACTIVE ELSE MOV #PLOT1,R0 ;ADDR 1ST PPB WHILE(R0:LT_U:#PLOTE) IF(PLTSTS(R0):LT:#0)MOV #1,PLTSTS(R0) ;ACTIVATE SUSPENDED PLOTS ADD #TBLLEN,R0 ;POINT TO NEXT PPB FIN MOVB PLTDFN,PLTACT ;ALL DEFINED PLOTS NOW ACTIVE FIN FIN TO SCALE-COORDINATE ; ; SCALE DATA VALUE TO SCREEN COORD. ; INPUT: R0=PPB ADDR ; R3=OFFSET INTO PPB TO X OR Y SCALING PARAM ; OUTPUT: R3=SCREEN COORD [R4,F0,F1 DESTROYED, OTHER REG UNMODIFIED] ; MOV R0,R4 ;R4 POINTS TO PPB ADD R3,R4 ;R4 POINTS TO X OR Y SCALING PARAM MOV INDEX(R4),R3 ;R3=BYTE OFFSET TO DATA VALUE ADD DWDADR,R3 ;R3=ADDR OF DATA VALUE MOV (R3),R3 ;R3=DATA VALUE BIC MASK(R4),R3 ;MASK DATA VALUE ASH SHIFT(R4),R3 ;SHIFT TO ALIGN WITH MASK ; CONDITIONAL (R3:LT:MINDV(R4)) ; MAX DATA VALUE IN PLOT MOV MAXSC(R4),R3 ;PLOT AT BOUNDRY ADD #3,R3 ; +3 FIN (OTHERWISE) ;POINT IS IN BOUNDS LDCIF R3,F0 ;CONVERT DATA VALUE (W=X OR Y) TO REAL LDCIF MINDV(R4),F1 ;CONVERT OFFSET (W0) TO REAL SUBF F1,F0 ;W-W0 (NOTE THIS MUST BE FLOATING CALC ; W & W0 ARE ON RANGE +-32K SO W-W0 IS ; ON RANGE +-64K) MULF SCALE(R4),F0 ;MULT BY SCALING FACTOR STCFI F0,R3 ;CONVERT TO INTEGER ADD MINSC(R4),R3 ; R3=WSCALE*(W-WMIN)+IW0=SCREEN COORD FIN FIN FIN TO SHOW-PLOT .SBTTL DOTINI: SHOW FUNCTION ; ; SHOW A NEW PLOT ; CLR FCT ;ASSUME SUCCESS WHEN(PLTDFN:GE_BU:#4) MOV #5,FCT ;4 PLOTS ALREADY DEFINED! ELSE FIND-PLOT-IN-LIST WHEN(R0:NE:#0)MOV #6,FCT ;PLOT ALREADY DEFINED ELSE MOV #PLOT1,R0 ;ADDR OF 1ST PPB ; WHILE(PLTSTS(R0):NE:#0 :AND: R0:LT_U:#PLOTE) ADD #TBLLEN,R0 ; WHEN(R0:GE_U:#PLOTE)MOV #5,FCT ;NO SPACE IN PPB FOR NEW PLOT! ELSE MOV R0,R3 ;SAVE PPB ADDR MOV #MSG,R1 ;ADDR MSG BUFFER MOV #BUFLEN-1,R2 ;# OF WORDS TO TRANSFER UNTIL(R2:LE:#0) MOV (R1)+,(R0)+ ;TRANSFER MSG TO PPB DEC R2 FIN ; MOV NUMPNT(R3),PNTPLT(R3) ;# OF POINTS TO PLOT MOV #-1,PLTSTS(R3) ;PLOT STATUS=SUSPENDED INCB PLTDFN IF(TTN:NE_B:PTT(R3)) ;GIVEN TT # DIFFERENT? MOVB PTT(R3),TTN ;YES, SAVE NEW TT# MOVB TTN,R0 ;FOR ALUN CALL ALUN$S #LUN,#"TT,R0 ;ASSIGN NEW TT FIN ; ; HDO HAS SUSPENDED ALL PLOTS TO DRAW A FRAME & LABEL ; THE NEW PLOT. THUS MUST NOW RESUME ALL PLOTS. ; RESUME-SUSPENDED-PLOTS FIN FIN FIN FIN TO SUSPEND-ACTIVE-PLOTS .SBTTL DOTINI: SUSPEND FUNCTION ; ; SUSPEND ALL ACTIVE PLOTS. ; CLR FCT ;ASSUME SUCCESS WHEN(PLTACT:EQ_B:#0)MOV #3,FCT ;NO ACTIVE PLOTS ELSE MOV #PLOT1,R0 ;ADDR 1ST PPB WHILE(R0:LT_U:#PLOTE) IF(PLTSTS(R0):GT:#0)MOV #-1,PLTSTS(R0) ; ADD #TBLLEN,R0 FIN CLRB PLTACT ;0 ACTIVE PLOTS INVOKE-A-F4010-CALL ANSWER-QUERY ;RETURN STATUS OF PLOTS FIN FIN .END