;++ ; Program to enable Control V as a 'toggle verify command' ; ; The program creates a process permanent channel to your ; terminal (assigned in Exec mode) and uses the QIO ; io$_setchar io$m_outband function to place an Ast on this channel. ; The Ast's are enabled for Cntl V and point to a routine ; loaded in your P1 space. ; This routine is loaded in the P1 common area CTL$A_COMMON ; ; The routine that is woken by a Control V just toggles the ; bit in your P1 space that control the verify state. ; ; This code should be considered as a hack and could crash your ; system...(if BUGCHECKFATAL=1...) ; ; You need the CMEXEC priv to use it ;-- ;+ ; Link with the system & DCl symbol tables ;- .link /sys$system:dcldef.stb/ .link /sys$system:sys.stb/ .library /sys$library:lib/ ;+ ; Definations for Access mode (PSL) & Breakthrough ;- $psldef $brkdef iosb: .blkl 2 ; IO status buffer for $BRKTHU mask: .blkl 2 ; Mask specifying what control character ; to act on item: .word 10 ; $getjpi item list to get .word jpi$_terminal ; our terminal name .long device+8 .long device ; .long 0 ;+ ; Very silly macro to test returned status ;- .macro check ar0,aerror,?label blbs ar0,label brw aerror label: nop .endm check .entry toggle,0 ; code starts here $getjpiw_s itmlst=item ; get our terminal name bbcs #22,mask+4,5$ ; set bit 22 (Cntl V) in the Qio mask 5$: nop $cmexec_s routin=doit ; get into exec mode for the rest ret ;+ ; Exec mode routine that loads the Ast code into the P1 common ; area (exits with Vector inuse if the first longword is not zero) ; and sets up an exec mode Ast that will run this code on Cntl V ;- .entry doit,0 ;+ ; Test the common area, if the first long word is not zero then ; we will exit with Vector In Use ;- tstl g^ctl$a_common beql 10$ movl #ss$_vecinuse,r0 ret 10$: nop ;+ ; Assign an exec (process permanent) channel to our terminal ;- $assign_s chan=chan,- devnam=device,- acmode=#psl$c_exec check r0,error ;+ ; Move the ast code to the common P1 space so it is Process Permanent ;- movc3 #code_len,code,g^ctl$a_common ;+ ; Setup an Ast to point to the code in the P1 space, to act on Cntl V ;- $qiow_s chan=chan,- func=#io$_setchar!io$m_outband,- iosb=iosb,- p1=@#CTL$A_COMMON,- p2=#mask,- p3=#psl$c_exec check r0,error movw iosb,r0 check r0,error ;+ ; That's all... ;- error: ret ;+ ; All the code from here down will be loaded into the P1 common area ; so it is PP ;- .entry code,0 pushr #^m ; save all ;+ ; Make all the descriptors will will use PIC ;- movab von+8,von+4 movab voff+8,voff+4 movab ctr+8,ctr+4 movab out+8,out+4 movab device+8,device+4 ;+ ; Get pointer to the process PRC area ;- movl @#ctl$ag_clidata+ppd$l_prc,r6 ;+ ; Toggle the verify bit ;- xorw #prc_m_verify,prc_w_flags(r6) ;+ ; Test the verify bit so we can write the correct message to sys$output ;- bitl #prc_m_verify,prc_w_flags(r6) beql 5$ ; write a 'Verify off' message movaq von,r6 brw 10$ 5$: nop movaq voff,r6 10$: nop ;+ ; Use FAO to format the message ;- movl #100,out $fao_s ctrstr=ctr,outbuf=out,outlen=out,- p1=r6 ;+ ; Broadcast it to the terminal ;- $brkthru_s msgbuf=out,- sendto=device,- sndtyp=#brk$c_device,- reqid=#brk$c_dcl ;+ ; Restore all ;- popr #^m ret ;+ ; FAO format control string to turn reverse vid on/off ;- ESC = 27 ctr: .ascid /[0;7m !AS //[0m/ ;+ ; FAO output string ;- out: .long 100 .long out+8 .blkb 100 ;+ ; Terminal channel ;- chan: .blkw 1 ;+ ; Our terminal device name ;- device: .ascid / / ;+ ; Verify on/off messages ;- von: .ascid /Verify is ON/ voff: .ascid /Verify is OFF/ code_len=.-code ; length of code to be loaded into the P1 common area .end toggle