	.title	rmser3	overlay 3 of 3 for rms error text
	.psect



	.macro	save	list
	.if b , <list>
	.ift
	 save	<r0,r1,r2,r3,r4,r5>
	.iff
	.irp	x,<list>
	 mov	x,-(sp)
		.endr
	.endc
	.endm	save


	.macro	unsave	list
	.if b , <list>
	.ift
	unsave	<r5,r4,r3,r2,r1,r0>
	.iff
	.irp	x,<list>
	 mov	(sp)+,x
		.endr
	.endc
	.endm	unsave



rmser3::save	<r0,r1,r2>		; be nice to our caller
	mov	4(r5)	,r1		; return buffer address
	mov	r1	,r2		; save buffer address
	clrb	(r1)+			; make first char .asciz
	mov	#77	,r0		; clear it out first
10$:	movb	#40	,(r1)+		; fill rest of buffer with spaces
	sob	r0	,10$		; next please
	mov	#dsp	,r0		; get the index table for errors
20$:	tst	@r0			; hit the end yet ?
	beq	100$			; yes, exit with no text
	cmp	@2(r5)	,@r0		; type indexentry = record
	beq	30$			;       errnum: integer
	cmp	(r0)+	,(r0)+		;	errtxt: textaddress
	br	20$			;      end ;

30$:	mov	2(r0)	,r0		; get the error text address
	call	rmserx

100$:	unsave	<r2,r1,r0>		; pop our registers and exit
	return


	.globl	rmserx


	.psect	dsp	,ro,d,lcl,rel,con
dsp:
	.psect	msgtxt	,ro,d,lcl,rel,con
	.macro	$ioer$	nam,code,txt

	.psect	msgtxt
	$$ 	= .
	$$x 	= 0
	.irpc	$$c,<nam>
	$$x =	$$x + 1
	.iif ge	,$$x-4, .byte ''$$c
	.endr
	.asciz	#txt#
	.psect	dsp
	.word	code,$$
	nam	=	code
	.psect
	.endm



$IOER$	ER$NPK,-1184.,<INDEXED FILE-NO PRIMARY KEY DEFINED>
$IOER$	ER$OPN,-1200.,<RSTS/E OPEN FUNCTION FAILED(STV=SYS ERR CODE)>
$IOER$	ER$ORD,-1216.,<XAB'S NOT IN CORRECT ORDER>
$IOER$	ER$ORG,-1232.,<INVALID FILE ORGANIZATION VALUE>
$IOER$	ER$PLG,-1248.,<ERROR IN FILE'S PROLOGUE(RECONSTRUCT FILE)>
$IOER$	ER$PLV,-1256.,<FILE PROLOGUE VERSION LEVEL UNSUPPORTED>
$IOER$	ER$POS,-1264.,<"POS" FIELD INVALID(POS GT MRS,STV=@XAB)>
$IOER$	ER$PRM,-1280.,<BAD FILE DATE FIELD RETRIEVED(STV=@XAB)>
$IOER$	ER$PRV,-1296.,<PRIVILEGE VIOLATION(OS DENIES ACCESS)>
$IOER$	ER$RAB,-1312.,<NOT A VALID RAB>
$IOER$	ER$RAC,-1328.,<ILLEGAL RAC VALUE>
$IOER$	ER$RAT,-1344.,<ILLEGAL RECORD ATTRIBUTES>
$IOER$	ER$RBF,-1360.,<INVALID RECORD BUFFER ADDR>
$IOER$	ER$RER,-1376.,<FILE READ ERROR(STV=SYS ERR CODE)>
$IOER$	ER$REX,-1392.,<RECORD ALREADY EXISTS>
$IOER$	ER$RFA,-1408.,<BAD RFA VALUE>
$IOER$	ER$RFM,-1424.,<INVALID RECORD FORMAT>
$IOER$	ER$RLK,-1440.,<TARGET BUCKET LOCKED BY ANOTHER ACCESSOR>
$IOER$	ER$RMV,-1456.,<RSX-F11ACP REMOVE FUNCTION FAILED(STV=SYS ERR CODE)>
$IOER$	ER$RNF,-1472.,<RECORD NOT FOUND(STV=0/ER$IDX)>
$IOER$	ER$RNL,-1488.,<RECORD NOT LOCKED>
$IOER$	ER$ROP,-1504.,<INVALID RECORD OPTIONS>
$IOER$	ER$RPL,-1520.,<ERROR WHILE READING PROLOGUE(STV=SYS ERR CODE)>
$IOER$	ER$RRV,-1536.,<INVALID RRV RECORD ENCOUNTERED>
$IOER$	ER$RSA,-1552.,<THIS ERROR CODE NO LONGER USED>
$IOER$	ER$RSL,-1556.,<NO RESULTANT STRING IN RESULTANT STRING AREA>
$IOER$	ER$RSS,-1560.,<INVALID RESULTANT STRING SIZE>
$IOER$	ER$RST,-1564.,<INVALID RESULTANT STRING ADDRESS>
$IOER$	ER$RSZ,-1568.,<BAD RECORD SIZE>
$IOER$	ER$RTB,-1584.,<RECORD TOO BIG FOR USER'S BUFFER(STV=ACTUAL REC SIZE)>
$IOER$	ER$RVU,-1592.,<RRV UPDATE ERROR ON INSERT>
$IOER$	ER$SEQ,-1600.,<PRIMARY KEY OUT OF SEQUENCE(RAC=RB$SEQ FOR $PUT)>
$IOER$	ER$SHR,-1616.,<UNRECOGNIZABLE VALUE IN FAB SHR FIELD>
$IOER$	ER$SIZ,-1632.,<"SIZ" FIELD INVALID(STV=@XAB)>
$IOER$	ER$STK,-1648.,<THIS ERROR CODE NO LONGER USED>
$IOER$	ER$SUP,-1656.,<OPERATION UNSUPPORTED OVER NETWORK>
$IOER$	ER$SYS,-1664.,<SYSTEM DIRECTIVE ERROR(STV=SYS ERR CODE)>
$IOER$	ER$TRE,-1680.,<INDEX TREE ERROR>
$IOER$	ER$TYP,-1696.,<ERROR IN FILE TYPE EXTENSION>
$IOER$	ER$UBF,-1712.,<INVALID USER BUFFER ADDR>
$IOER$	ER$UIN,-1720.,<FAL REJECTED SOME FIELD (STV TELLS WHICH)>
$IOER$	ER$USZ,-1728.,<INVALID USER BUFFER SIZE(USZ=0)>
$IOER$	ER$VER,-1744.,<ERROR IN VERSION NUMBER>
$IOER$	ER$VOL,-1760.,<INVALID VOLUME NUMBER(STV=@XAB)>
$IOER$	ER$WCD,-1768.,<WILD CARD ENCOUNTERED DURING FNA/DNA STRING PARSE>
$IOER$	ER$WER,-1776.,<FILE WRITE ERROR(STV=SYS ERR CODE)>
$IOER$	ER$WLK,-1784.,<DEVICE IS WRITE-LOCKED>
$IOER$	ER$WPL,-1792.,<ERROR WHILE WRITING PROLOGUE(STV=SYS ERR CODE)>
$IOER$	ER$XAB,-1808.,<NOT A VALID XAB(@XAB=ODD,STV=@XAB)>
$IOER$	ER$XTR,-1824.,<EXTRANEOUS FIELD DETECTED DURING PARSE>

	.psect	dsp
	.word	0,0			; mark end of text

	.end
