        TTL    => Super1

CliDPrompt    =  "CLI$Prompt",0
DefaultPrompt = "*"
        ALIGN

StartSuper ; Start entry for UtilModule
        BL      DEFHAN                  ; set error handler in case spooling
        SWI     OS_WriteS
        =       "Supervisor",10,13,10,13,0
        ALIGN
        B       CLILOP


CLIEXIT BL      DEFHN2                  ; restore all our world

GOSUPV  TEQP    PC, #0
        BL      DEFHAN                  ; including error handler!

CLILOP ROUT

        ADR     R0, CliDPrompt          ; try looking it up
        LDR     R1, =GeneralMOSBuffer
        MOV     R2, #?GeneralMOSBuffer
        MOV     R3, #0
        MOV     R4, #VarType_Expanded
        SWI     XOS_ReadVarVal
        ADRVS   r1, DefaultPrompt       ; gnot gthere or gnaff
        MOVVS   r2, #1
        MOV     r0, r1
        MOV     r1, r2
        SWI     OS_WriteN
        LDR     R0, =GeneralMOSBuffer
        MOV     R1, #?GeneralMOSBuffer-1
        MOV     R2, #" "
        MOV     R3, #255
        SWI     OS_ReadLine
        BCS     ESCAPE
        MOV     lr, pc                  ; construct lr for wallies to return to
        SWI     XOS_CLI
        BVC     CLILOP

        SWI     XOS_NewLine
        BL      PrintError
        B       CLILOP


ESCAPE  MOV     R0, #&7E
        SWI     OS_Byte                 ; May yield error
        SWI     OS_WriteS
        =       10,13, "Escape", 10,13, 0
        B       CLILOP

        LNK    Source.VduDriver
