NEW
  AUTO 3,1
*--------------------------------------
ERRORX.GetErrMsg
				ldx #ERRORX.MSG
				stx ZPPtr1
				ldx /ERRORX.MSG
				stx ZPPtr1+1
				
				ldx #0
				
				pha
				
.1				pla
				cmp	ERRORX.ID,x
				beq .4

				pha
				ldy #0
				
.2				iny
				lda (ZPPtr1),y
				bpl .2
				
				jsr SHARED.AddYp12P1

				inx
				cpx #ERRORX.CNT
				bne .1
				
				pla
				
.4				ldy #$ff

				sta CLRWRITEAUX

.5				iny
				lda (ZPPtr1),y
				pha
				and #$7F
				sta (ZPPtr2),y
				pla
				bpl .5
				
				iny
				lda #0
				sta (ZPPtr2),y

				clc
				rts
*--------------------------------------	MLI
ERRORX.ID		.DA #MLI.E.BADCALL
				.DA #MLI.E.IO
				.DA #MLI.E.NODEV
				.DA #MLI.E.WRTPROT
				.DA #MLI.E.DSKSWIT
				.DA #MLI.E.OFFLINE
				.DA #MLI.E.INVPATH
				.DA #MLI.E.PNOTFND
				.DA #MLI.E.VNOTFND
				.DA #MLI.E.FNOTFND
				.DA #MLI.E.DUPFILE
				.DA #MLI.E.VOLFULL
				.DA #MLI.E.DIRFULL
				.DA #MLI.E.UNSUPST
				.DA #MLI.E.EOF
				.DA #MLI.E.LOCKED
				.DA #MLI.E.OPEN
				.DA #MLI.E.BADBUF
*--------------------------------------	KERNEL
				.DA #E.OOM
				.DA #E.OOH
				.DA #E.INVH
				.DA #E.BUF
				.DA #E.BADPATH
				.DA #E.BADARG
				.DA #E.NSP
				.DA #E.SYN
				.DA #E.ENVF
				.DA #E.IBIN
				.DA #E.FTB
				.DA #E.INUM
				.DA #3					Ctrl-C
*--------------------------------------	PARSER
				.DA #E.CSYN
				.DA #E.ESYN
				.DA #E.STACKERROR
				.DA #E.STKOVERFLOW
				.DA #E.NOWHILE
				.DA #E.NOFOR
				.DA #E.NOIF
				.DA #E.BADFTYPE
				.DA #E.FUNDEF
				.DA #E.UNEXPEOF
				.DA #E.NODO
				.DA #E.TMISMATCH
*--------------------------------------
ERRORX.CNT		.EQ *-ERRORX.ID
*--------------------------------------
ERRORX.MSG		.AT "Bad MLI Call"
				.AT "I/O Error"
				.AT "No Device"
				.AT "Disk Write-Prot."
				.AT "Disk Switched"
				.AT "Offline Device"
				.AT "Invalid Path"
				.AT "Path Not Found"
				.AT "Vol Not Found"
				.AT "File Not Found"
				.AT "Dup. Filename"
				.AT "Vol Is Full"
				.AT "Dir Is Full"
				.AT "Unsupp. Storage"
				.AT "End Of File"
				.AT "File Locked"
				.AT "File Opened"
				.AT "Bad Buffer"
*--------------------------------------
				.AT "Out Of Memory"
				.AT "Out Of Handle"
				.AT "Invalid Handle"
				.AT "Buffer Overflow"
				.AT "Bad Path"
				.AT "Bad API Argument"
				.AT "No Such Process"
				.AT "Syntax Error"
				.AT "Env Is Full"
				.AT "Invalid BIN"
				.AT "File Too Big"
				.AT "Invalid Numerical"
				.AT "User Interrupt"
*--------------------------------------
				.AT "Cmd Syntax Error"
				.AT "Exp. Syntax Error"
				.AT "Stack Error"
				.AT "Stack Overflow"
				.AT "LOOP Without WHILE"
				.AT "NEXT Without FOR"
				.AT "FI/ELSE Without IF"
				.AT "Bad File Type"
				.AT "Undef. Function"
				.AT "Unexp. EOF"
				.AT "LOOP Without DO"
				.AT "Type Mismatch"
*--------------------------------------
				.AT "Unknown Error"
*--------------------------------------
MAN
SAVE usr/src/sys/kernel.s.errorx
LOAD usr/src/sys/kernel.s
ASM
