;*; Updated on 06-Dec-91 at 10:32 AM by Michele Tonti; edit time: 0:00:11
;*************************** AMUS Program Label ******************************
; Filename: LOCKUP.M68                                      Date: 12/6/91
; Category: UTIL         Hash Code: 074-066-474-351      Version:
; Initials: KUNI/AM      Name: RENE S. HOLLAN
; Company: UDISCO LTD.                             Telephone #: 5144818107
; Related Files:
; Min. Op. Sys.:                               Expertise Level:
; Special:
; Description: Locks CPU into single user mode. Prompt changes from dot to
; octathorpe. To release CPU, type a dot at the prompt.
;
;*****************************************************************************
;************************************************************************
;                                                                       *
;                       LOCKUP COMMAND PROGRAM                          *
;                                                                       *
;************************************************************************
;
;                                   NOTICE
;
;All    rights   reserved.  This software is the property of UDISCO LTD.  and
;the material contained herein is  the   proprietary   property   and   trade
;secrets    of    UDISCO  LTD.,  embodying  substantial  creative efforts and
;confidential information, ideas and expressions, no part of  which  may   be
;reproduced   or  transmitted  in  any  form  or  by  any  means, electronic,
;mechanical,  or  otherwise,  including  photocopying  or  input  into    any
;information   storage  or  retrieval  system  without  the  express  written
;permission of UDISCO LTD.
;
;CAUTION: Unauthorized distribution or reproduction  of  this  material   may
;subject you to legal action.
;
;       SYSTAX:         LOCKUP
;
;       This program will lock up the CPU in single user mode. The system
;prompt is changed from a dot to an octathorp. To exit enter a dot in
;response to the prompt.
;
;       Author:         Rene S. Hollan
;
;       Date Written:   Nov. 5, 1984
;
;       COPYRIGHT (C) - 1983 - UDOSCO LTD.
;
;Edit History:
;
; [100] 5 November 1984
;       Coding starts /RSH
;

V.MAJOR =       1                       ; MAJOR VERSION
V.MINOR =       0                       ; MINOR VERSION
V.SUB   =       0                       ; SUB VERSION
V.EDIT  =       100                     ; EDIT LEVEL

       SEARCH  SYS
       SEARCH  SYSSYM
       SEARCH  TRM


LOCKUP: PHDR    -2,PV$RSM,PH$REE!PH$REU ; program header

5$:     MOVL    DDBCHN,D0               ; any pending disk requests?
       BNE     5$                      ; yup, wait

       JLOCK                           ; stop job scheduling
       JOBIDX  A0                      ; A0 --> job control block

10$:    TYPE    #                       ; prompt
       ANDW    #-<J.CCC+1>,JOBSTS(A0)  ; clear ^C check
       KBD     15$                     ; get a line

       LIN                             ; is it empty?
       BEQ     10$                     ; yup

       CMPB    @A2,#'.                 ; is it exit?
       BEQ     20$                     ; yup

       PUSH    A0                      ; save JCB pointer

       AMOS                            ; send command to system
       POP     A0                      ; restore JCB pointer
       BR      10$                     ; and loop

15$:    TYPE    ^C                      ; send ^C to terminal
       CRLF                            ; go to next line
       BR      10$                     ; sand loop

20$:    JUNLOK                          ; allow scheduler to run
       EXIT

       END