1 SUB VISOPN 2 ! will open visual 500 on lun=.VIS5LUN% with ALUN$ & IOATT directive. 3 ! assumes visual 500 is device VI0: 4 ! ERR$ is a 4-byte IO status block. 5 ! inspect ERR$ in COMMON (VIS500) to find if open of visual 500 worked. 6 COMMON (VIS500) VIS5LUN%, QIOW$=2%, ERR$=4%, VIS5EFN%, ERRADR%, CHARMASK$=32%, CMADR% 7 .DEFINE .VIS5LUN% = 29% ! visual 500 lives on this lun 8 .DEFINE .VIS5EFN% = 32% ! an event flag number for waiting on visual 500 9 VIS5LUN% = .VIS5LUN% \ VIS5EFN% = .VIS5EFN% 10 .DEFINE .ALUN% = 1031% ! ALUN DIR$ code 11 .DEFINE .IOATT%=768% ! IO.ATT QIOW$ code 12 .DEFINE .VISD$="VI" 13 .DEFINE .MCU%=0% 14 LSET CHARMASK$ = STRING$(32%,255%) 15 CALL ADR BY REF (CHARMASK$,CMADR%) ! know address of character mask for input 100 CALL DIR BY REF (.ALUN%,VIS5LUN%,.VISD$,.MCU%) ! attach visual 500 110 CALL ADR BY REF (ERR$,ERRADR%) ! know IO status block address 120 LSET QIOW$ = CHR$(3%)+CHR$(12%) ! know QIOW$ constant 130 CALL DIR BY REF (QIOW$,.IOATT%,VIS5LUN%,VIS5EFN%,ERRADR%,0%,0%,0%,0%,0%,0%,0%) ! open visual 500 140 ! ERR$ contains on return: 150 ! byte#1: directive status (should be 1% for sucess) 160 ! 2: further details code 170 ! 3: ? 180 ! 4: ? 190 SUBEND