; [LOMASKY.SYS.NUSER]SET_UIC.MAR
;
; This routine accepts one parameter which is the address of the longword
; with the new UIC and will replace it with the former UIC so that the
; user can reset it back to what it was.

        .library        /sys$library:lib.mlb/
        .link           /sys$system:sys.stb/
        $pcbdef
        $ipldef

        .entry  set_uic,^m<R2,R3,R4,R5,R6>
        tstl    (ap)                    ;must be non_zero
        beql    stop_short              ;if so, stop short
        movl    4(ap),R5                ;get the address of the argument
        lock    lockname=sched, -       ;synch w/schedule db
                savipl=-(sp)

        movl    (R5),R3                 ;save new UIC
        movl    pcb$l_uic(R4),(R5)      ;move old UIC to the variable
        movl    R3,pcb$l_uic(R4)        ;modify the UIC in the pcb

        unlock  lockname=sched, -       ;return to normal ipl
                newipl=(sp)+
        movl    #1,R0                   ;return ss$_normal
        ret
 stop_short:
        movl    #18,R0                  ;bad parameter value
        ret
        .end
