; VHLP - Help processor for VTAM ; ; Copyright [c] Noel Alaska Systems Technology, 1983. SEARCH SYS ; AMOSL libraries SEARCH SYSSYM SEARCH TRM SEARCH VTAMEQ ; VTAM library INTERN VHLP,VHLP5 AUTOEXTERN VHLP: SAVE A0-A5,D0-D5 ; save regs MOV JME(A4),A5 ; use utility DDB BITL #INHELP,JSTAT(A4) ; in help already? BEQ 0$ ; NO PUSH JDDB+D.DDB+4(A5) ; YES - branch to correct routine RTN 0$: USRFRE A0 ; save end of memory MOVB #3,JDDB+D.FLG(A5) ; setup DDB MOV A0,JDDB+D.DDB(A5) ; stash end of memory after DDB BYP ; pass up spaces, tabs, ... LIN ; default file requested? BNE VHLP0 ; NO LEA A2,HELPR ; YES - use default VHLP0: FSPEC JDDB(A5),HLP ; spec the DDB JNE VHLP8 ; bad spec??? INIT JDDB(A5) ; get a buffer JNE VHLP7 ; - no storage - LOOKUP JDDB(A5) ; find the file BEQ VHLP1 ; - got it CLRB JDDB+D.PPN(A5) ; try library account LOOKUP JDDB(A5) BEQ VHLP1 ; - got it MOVW #^H0701,JDDB+D.PPN(A5) ; try DSK0:[7,1] MOVW #[DSK],JDDB+D.DEV(A5) CLRW JDDB+D.DRV(A5) CLR JDDB+D.DVR(A5) LOOKUP JDDB(A5) JNE VHLP8 ; - I give up! VHLP1: OPENI JDDB(A5) ; open help file CRT 255.,0 ; clear screen CRT 255.,132. CRT 255.,36. CALL VCLKOF ; tell HPO not in STATUS CRLF BR VHLP2A VHLP2: CRT 255.,0 CRT 255.,132. CRT 255.,36. MOV JTRM(A4),A0 0$: SLEEP #2 BITW #T$OIP,@A0 BNE 0$ TST T.OQX(A0) BNE 0$ CLRW T.POO(A0) VHLP2A: CLR JDDB+D.DDB+4(A5) ; say no lines on screen yet VHLP3: CALL BYTIN ; get byte from file JEQ VHLP5 ; - end of file CMP D1,#11 ; is this a TAB? BNE 2$ ; NO PUSH D1 PUSH D0 0$: SLEEP #2 MOV JTRM(A4),A6 ; point to my TRMDEF BITW #T$OIP,@A6 ; is it still busy? BNE 0$ ; YES - wait for it TST T.OQX(A6) ; is output queued? BNE 0$ ; YES - wait for it CLR D0 MOVW T.POO(A6),D0 ; get correct position MOV D0,D1 ; save position in R1 BISL #7,D0 ; move out to mod 8 position INC D0 SUB D1,D0 ; compute # spaces to output 1$: MOVB #40,D1 ; write em out TOUT SOB D0,1$ POP D0 POP D1 BR VHLP3 2$: CMPB D1,#15 ; Carriage Return? BEQ VHLP3 ; YES - ignore CMPB D1,#12 ; Line Feed? BEQ 3$ ; YES - special TOUT ; NO - send it BR VHLP3 3$: CRLF INC JDDB+D.DDB+4(A5) ; increment # lines CMM #21.,JDDB+D.DDB+4(A5) ; enough on screen yet? BHI VHLP3 ; NO VHLP4: ; CRT 255.,13. ; YES - bottom line ; CRT 24.,80. ; CRT 255.,32. ; CRT 255.,14. CRT 24.,1 CRT 255.,128. TTYI ASCII / Carriage Return to continue HELP, or/ ASCII / ESCAPE to return to Status screen. / BYTE 0 EVEN CRT 255.,129. CRT 255.,29. CRT 255.,37. BISL #INHELP,JSTAT(A4) ; set flag LEA A1,VHLP4A ; next to input analysis MOV A1,JDDB+D.DDB+4(A5) ; stash address REST A0-A5,D0-D5 RTN VHLP4A: CMPB D1,#3 ; is this a ^C? BNE 1$ ; NO - try next one MOVB #7,D1 ; YES - sound bell TOUT ; - handle as ESCAPE JMP VHLP6 1$: CMPB D1,#15 ; is this CR? JEQ VHLP2 ; YES - next screen CMPB D1,#33 ; is this ESCAPE? JNE VHLP4 ; NO JMP VHLP6 ; YES VHLP5: CRT 23.,1 CRT 255.,10. ; CRT 255.,13. ; CRT 24.,80. ; CRT 255.,32. ; CRT 255.,14. CRT 24.,1 CRT 255.,128. TTYI ASCII / that's all: type any character to return/ ASCII / to Status screen. / BYTE 0 EVEN CRT 255.,129. CRT 255.,29. CRT 255.,37. BISL #INHELP,JSTAT(A4) ; set flag LEA A1,VHLP6 ; go to exit routine next MOV A1,JDDB+D.DDB+4(A5) ; stash address REST A0-A5,D0-D5 RTN VHLP6: MOV JDDB+D.DDB(A5),A0 ; recover memory pointer CLR -4(A0) ; remove all our junk BICL #INHELP,JSTAT(A4) ; say not in help now... CALL VSTATI ; restore status screen REST A0-A5,D0-D5 RTN ; goback to VCMD VHLP7: CRT 23.,1 ; no storage error TYPE CRT 255.,9. BR VHLP9 VHLP8: CRT 23.,1 ; cant find help error TYPE CRT 255.,9. VHLP9: MOV JDDB+D.DDB(A5),A0 ; recover memory pointer CLR -4(A0) ; remove all our junk BICL #INHELP,JSTAT(A4) ; never leave flag on REST A0-A5,D0-D5 RTN ; goback to VCMD HELPR: ASCII /VTAM/ BYTE 15,0 EVEN END