.title default Set terminal characteristics to default .ident /V1.01B/ .sbttl Documentation ; ; This is a short program to allow a user to set his terminal ; characteristics back to the login characteristics of the ; device. This program must be installed with LOG_IO. ; ; To compile: ; $ MACRO DEFAULT ; $ LINK/SYSTEM=200/HEADER DEFAULT ; ; Eric F. Richards ; 05-Sep-86 ; Gould OSD VAXcluster VMS V4.4 ; .sbttl Macros, Constants, misc .enabl suppression ; clean up listing files .dsabl traceback, debug ; and object code .default displacement, byte ; this is a short program $iodef ; define qio function codes $ssdef ; define sys serv errors $dcdef ; define device class codes blksiz = 12 ; size of the char block .sbttl Pure data .psect default quad, exe, pic, shr, nowrt cmd: .ascii /SYS$COMMAND/ ; we connect to this terminal cmd_len = . - cmd ; this is the string length .sbttl Main Code .align quad ; be nice to our code .entry default, ^m ; entry point DEFAULT pushal cmd ; build a descriptor for pushl s^#cmd_len ; ...the terminal name movl sp, r11 ; save a pointer to the descr clrl -(sp) ; make a channel number movl sp, r10 ; save a pointer to it clrq -(sp) ; make an I/O status block movl sp, r9 ; point to the status block subl #blksiz, sp ; make room for terminal chars movl sp, r8 ; save a pointer to char buf assume blksiz ge 1 ; ...so next inst works clrb (sp) ; get a "real" device class $assign_s chan=(r10), - ; assign a channel to the dev devnam=(r11) ; dev name is SYS$COMMAND blbc r0, 30$ ; on error get out $qiow_s chan=(r10), - ; ask the terminal for its func=#io$_sensechar, - ; ... permanent char's iosb=(r9), - ; check iosb for error p1=(r8), - ; store the char's here p2=#blksiz ; this is the buffer length blbc r0, 10$ ; on error fubar out here movzwl (r9), r2 ; look at I/O sb for errors blbc r2, 20$ ; on error here, fubar out ; ; We now have the device characteristics. Let's make "one last check" ; to make sure we have a terminal, before we start changing things. ; movzwl #ss$_nosuchdev, r0 ; assume wrong device type cmpb #dc$_term, (r8) ; do we have a terminal? bneq 10$ ; if not, error out. ; ; Now, we have a terminal -- set its temporary characteristics ; $qiow_s chan=(r10), - ; set the temporary char's func=#io$_setmode, - ; request code iosb=(r9), - ; check iosb for error p1=(r8), - ; get the char's from here p2=#blksiz ; this is the buffer length blbc r0, 10$ ; on error fubar out here movzwl (r9), r0 ; look at I/O sb for errors 10$: movl r0, r2 ; save the error status 20$: $dassgn_s chan=(r10) ; deassign the chennel blbs r2, 30$ ; if no error, don't report it movl r2, r0 ; restore error status 30$: ret ; all done, go home! .end default ; th-th-that's all, folks!