.Title Suspend - A program to force any user into suspend mode. ;+ ; ; Written by Kevin Carosso, Nov 24, 1981 ; ; Requires GROUP or WORLD privs... ; ;- .Macro Check ?L blbs r0,L jmp error L: .Endm .Subtitle - Data for the program. .Psect SUSPEND_data, rd, wrt, noshr, noexe, long ; This is stuff for LIB$GET_FOREIGN: Prompt: .ascid /Process Id: / ; Prompt message. Getstr: .long 256 .long string string: .blkb 257 ; Buffer for the string. Pid: .long 0 ; A length return. Hexcnvt:.byte -1[48] ; Translation table to convert chars to digits .byte 0,1,2,3,4,5,6,7,8,9 .byte -1[7] .byte 10,11,12,13,14,15 .byte -1[26] .byte 10,11,12,13,14,15 .byte -1[25] .Subtitle - The program proper. .Psect Code,exe,nowrt,noshr .Entry SUSPEND,0 pushal Getstr ; Length into descriptor. pushal Prompt ; The prompt. pushal Getstr ; Return the command string here. calls #3,LIB$GET_FOREIGN ; and go get the line. check skpc #^A/ /,Getstr,@Getstr+4 ; Skip leading spaces movq r0,Getstr ; Get new length and pointer. movtc Getstr,@Getstr+4,- #0,Hexcnvt,Getstr,- @Getstr+4 ; Translate hex chars to digits. cmpw Getstr,#8 ; No more than 8 digits allowed bleq 10$ movl #SS$_BADPARAM, r0 ; otherwise bad parameter. brb error 10$: clrl r0 ; The index into the string moval @Getstr+4,r1 ; Start of the string clrl r2 ; To receive the value decw Getstr ; Dec the length to keep in step 20$: tstb (r1)[r0] ; Check the character bgeq 30$ ; Skip if ok movl #SS$_IVCHAR, r0 ; Otherwise invalid character brb error 30$: mull2 #16,r2 ; Shift the value movzbl (r1)[r0],r3 ; Get our digit addl2 r3,r2 ; and add in the digit acbl Getstr,#1,r0,20$ ; Loop on the entire string. movl r2,Pid ; Now save the computed PID $SUSPND_S PIDADR = Pid ; Now go nail the sucker. error: ret ; and return. .End SUSPEND