DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦5ef8ef9cd⟧ TextFile

    Length: 22144 (0x5680)
    Types: TextFile
    Names: »EUSRINT.MAC«

Derivation

└─⟦77f87173f⟧ Bits:30005981/disk3.imd Turn Key Data Entry System/Datenerfassungspaket - Vers. 1.90
    └─⟦this⟧ »EUSRINT.MAC« 

TextFile

;*************************************************
;*                                               *
;*	MODULE : EUSRINT.MAC       (RC-700)      *
;*	DATE   : 01.02.82                        *
;*	BY     : ASE GmbH , 6472 Altenstadt      *
;*	VERSION: 1.90                            *
;*                                               *
;*************************************************
;
; THIS MODULE SERVES AS AN INTERFACE BETWEEN APPLICATION
; PROGRAM (I.E. TKDES) AND THE DEP IN ALL MODES EXCEPT 'FORMAT'
; AND 'FORMAT-UPDATE' MODE.
;
	PUBLIC	USRABT
	PUBLIC	USRINT
	PUBLIC	ENTCPL
	PUBLIC	FRMCPL
	PUBLIC	ILLFRM
	PUBLIC	DELREC
	PUBLIC	XFMT
	PUBLIC	ENTSND
	PUBLIC	ENTHME
	PUBLIC	ENDFRM
	PUBLIC	ILLFNO
	PUBLIC	FLDBWD
	PUBLIC	FLDADV
	PUBLIC	INIT
	PUBLIC	ENT
	PUBLIC	RECADV
	PUBLIC	RECBWD
	PUBLIC	INSRCD
	PUBLIC	VCRPSS
	PUBLIC	PF2FLG
	PUBLIC	USRSVE
;
;	ext	FORMAT
	ext	FMTINT
;	ext	UPFFLG
	ext	BFNO
	ext	CHKBTE
	ext	MSGTAB
	ext	MLNFLG
	ext	DSPMSG
	ext	SOFFBA
	ext	INCCRS
	ext	CHRRD
	ext	SOZ
	ext	FMDFLG
	ext	VFPCTR
	ext	FBFADD
	ext	DEMODE
	ext	INBUFF
	ext	CBFADD
	ext	FRMCHN
	ext	FRMLNG
	ext	SOFFBA
	ext	FFLFLG
	ext	FRMFLG
	ext	SOFCBA
	ext	CONBTA
	ext	ASXDEC
	ext	DGTCNT
	ext	UBFADD
	ext	EFOFLG
	ext	ENTRY
	ext	INITFL
	ext	AUTFLG
	ext	DUPBFF
	ext	FTMFLG
	ext	EERCTR
	ext	VERCTR
	ext	NKECTR
	ext	NKVCTR
	ext	VCRCTR
	ext	NEFCTR
	ext	ECRCTR
	ext	FILCTR
	ext	UPDFLG
	ext	UPDM15
	ext	CAVFLG
	EXT	FPTTAB
	EXT	VFCTR
	ext	R0FLG
	ext	VCRFLG
	ext	CFLAG
	ext	FMFFLG
	ext	BIOSBS
	ext	DUPFLG
	ext	INTFLG
	ext	EFTFLG
	ext	DTEFLG
	ext	RC1FLG
	ext	RC2FLG
	ext	SOFUBA
;
;
CCTRAD	equ	0ffcch		;start of asccii cursor counter on crt
CRTN	equ	0dh		;
STCRT	EQU	0F800H		;START OF CRT-MAP IN MEMORY
;
;all calls from the application program come through here, with
;pointers to the various buffers in the Z-80 registers.
;the transfer of parameters adheres to the microsoft-standard.
;
ENT:
USRINT:	push	bc		;pointer to userbuffer
	push	de		;pointer to the format buffer
	push	hl		;pointer to the control area Z
	ld	hl,0		;
	ld	(FFLFLG),hl	;
	ld	(FRMFLG),hl	;
	ld	(SOFCBA),hl	;
	ld	(SOFFBA),hl	;
	ld	hl,1920		;
	ld	(FRMLNG),hl	;
;
;calculate start-of-format-buffer address
;
	ld	bc,2		;***** offset only for TKDES *******
	pop	de		;
	ld	(USRSVE),de	;
	ld	hl,(USRSVE)	;
	ld	e,(hl)		;
	inc	hl		;
	ld	d,(hl)		;
	ld	h,d		;
	ld	l,e		;
	add	hl,bc		;calc start address of format-buffer
	ld	(FBFADD),hl	;and save it in CCB
;
;
;the following calculates the start address of the control area Z
;
	ld	bc,62		;**** TKDES OFFSET TO Z *****
	pop	hl		;
	ld	e,(hl)		;
	inc	hl		;
	ld	d,(hl)		;
	ld	(USRSVE),de	;
	ld	hl,(USRSVE)	;
	add	hl,bc		;
	ld	(SOZ),hl	;
;
;the following calculates the start address of the user-buffer
;
	ld	bc,0h		;
	pop	hl		;
	ld	e,(hl)		;
	inc	hl		;
	ld	d,(hl)		;
	ld	(USRSV1),de	;
	ld	hl,(USRSV1)	;
	add	hl,bc		;
	ld	(UBFADD),hl	;
;the following sets the physical start adress of the crt-map
;in memory.
;
	ld	hl,STCRT	;load crt buffer
	ld	(CBFADD),hl	;to CCB
;
;
	call	CLRREG		;this will clear all the registerflags
;
;the following will check the clear-z flag and branch off to do it
;if its set.
;
CLRZ:	ld	hl,(SOZ)	;
	ld	bc,6		;
	add	hl,bc		;
	ld	a,(hl)		;
	cp	31h		;flag set?
	jp	z,CLRZ1		;yes
;
;the following will check the form-mod flag .
;
FRMMD:	ld	hl,(SOZ)	;
	ld	bc,7		;
	add	hl,bc		;
	ld	a,(hl)		;
	cp	31h		;
	jp	z,FRMMD1	;
	cp	30h		;
	jp	z,FRMMD2	;clear the flag
;
;the following checks the mode and branches off to the
;respective routine.
;
MDCHK:	ld	hl,(SOZ)	;
	ld	c,(hl)		;
	inc	hl		;
	ld	b,(hl)		;
	ld	hl,3330h	;format-mode
	and	a		;
	sbc	hl,bc		;
	jp	z,SETMDE	;
	ld	hl,3430h	;format-update mode
	and	a		;
	sbc	hl,bc		;
	jp	z,SETFUM	;
	ld	hl,3830h	;display-mode.
	and	a		;
	sbc	hl,bc		;
	jp	z,DMSG		;yes.
	ld	hl,3930h	;
	and	a		;
	sbc	hl,bc		;
	jp	z,DMSGWR	;display with response mode.
;
;the following checks for an initialized format before allowing to
;go on , if no initialized format is available an illegal-entry
;error will be processed .
;
	ld	a,(INTCLL)	;
	cp	0ffh		;
	jp	z,MDCHK1	;
	ld	a,(INITFL)	;
	cp	0ffh		;
	jp	nz,ILLDEP	;illegal entry!
;
MDCHK1:	ld	hl,3030h	;entry-mode
	and	a		;
	sbc	hl,bc		;
	jp	z,SETENT	;
	ld	hl,3230h	;update-mode
	and	a		;
	sbc	hl,bc		;
	jp	z,SETUPD	;branch to set update mode.
	ld	hl,3130h	;verify-mode
	and	a		;
	sbc	hl,bc		;
	jp	z,SETVER	;
	ld	hl,3530h	;format data mode
	and	a		;
	sbc	hl,bc		;
	jp	z,FRMDAT	;
;
;coming here means dealing with an illegal mode error ,
;which involves setting appropriate status in control-area and
;returning to the application-program.
;
	ld	hl,00h		;
	call	MVESTT		;
	jp	ERRCPL		;
;
;upon format complete the format routine will return here
;to set the format complete status and to move the
;format chaining key to the control-area Z..
;
FRMCPL:	ld	hl,06h		;
	call	MVESTT		;
ERRCPL:	call	MVEFCK		;move format chain key to Z
	call	MVEVPC		;move and xlate the # var.pos.to Z
	call	MVECPC		;move cursor counter to Z
	call	MVEALL		;move all counters
	ret			;return to the application program***
;
;the following sets illegal format status
;
ILLFRM:	ld	a,00h		;
	ld	(INITFL),a	;reset the format-initialized flag
	ld	(INTCLL),a	;and init-call flag
	ld	hl,0ch		;
	call	MVESTT		;
	call	MVEFCK		;
	call	MVEVPC		;
	call	MVECPC		;
	call	MVEALL		;
	ret			;
;
;status on format-not-initialized
;
ILLDEP:	ld	a,00h		;
	ld	(INTCLL),a	;clear the int call flag
	ld	(INITFL),a	;clear the format-initialized flag
	ld	hl,12h		;
	call	MVESTT		;
	ret			;
;
;the following moves the format chaining key
;
MVEFCK:	ld	hl,(SOZ)	;
	ld	bc,21		;
	add	hl,bc		;
	ld	d,h		;destination address
	ld	e,l		;in de
	ld	hl,FRMCHN	;source in hl
	ld	bc,3h		;# bytes in bc
	ldir			;move it!
	ld	a,20h		;
	ld	(de),a		;space 4th position of format-chain key
;
;the following restores the original format-chain-key into FRMCHN
;
	ld	bc,FPTTAB	;
	ld	hl,(VFCTR)	;
	dec	hl		;
	add	hl,hl		;
	add	hl,hl		;
	add	hl,bc		;
	ld	c,(hl)		;
	inc	hl		;
	ld	b,(hl)		;
	inc	bc		;
	push	bc		;
	pop	hl		;
	ld	de,FRMCHN	;
	ld	bc,3		;
	ldir			;
	ret			;return to user
;
;the following will set the abort-status in the control-area Z
;and return to the user.
;
USRABT:	ld	a,00h		;
	ld	(INITFL),a	;clear the format-initialized flag
	ld	(INTCLL),a	;and the init-call flag
	ld	(DTEFLG),a	;
	ld	(RC1FLG),a	;
	ld	(RC2FLG),a	;
	ld	a,06h		;
	call	DSPMSG		;set abbort message
	ld	hl,18h		;
	call	MVESTT		;
	call	MVEVPC		;move and xlate the var.pos ctr to Z
	call	MVEFCK		;move the format chain key to Z
	call	MVECPC		;move cursor pos.ctr. to Z
	call	MVEALL		;
	ret			;
;
;status on change format chain key
;
XFMT:	ld	a,0ffh		;
	ld	(EFOFLG),a
	ld	hl,1eh		;
	call	MVESTT		;
	jp	ENDFR1		;
;
;
;status on send-key
;
ENTSND:	ld	a,00h		;
	ld	(DUPFLG),a	;
	ld	(INTFLG),a	;
;	ld	(EFTFLG),a	;
	ld	(CFLAG),a	;
	call	CHKDR		;check for date and range check flags.
	cp	0ffh		;
	jp	z,ENTSN1	;
	ld	hl,24h		;
ENTSN1:	call	MVESTT		;
	ld	a,0ffh		;
	ld	(EFOFLG),a	;
	jp	ENDFR1		;
;
;status on home-key (non-formatting modes)
;
ENTHME:	call	CHKDR		;
	cp	0ffh		;
	jp	z,ENTHM1	;
	ld	hl,2ah		;
ENTHM1:	call	MVESTT		;
	jp	ENDFR1		;
;
;status on end of format , routine also used by the
;3 previous routines to set common status
;
ENDFRM:	ld	hl,30h		;
	call	MVESTT		;
ENDFR1:	ld	hl,01h		;
	ld	(BFNO),hl	;
	call	XFNO		;
	call	MVEVPC		;
	call	MVEFCK		;
	call	MVECPC		;
	call	MVEALL		;
	ld	hl,(UBFADD)	;
	ld	de,DUPBFF	;
	ld	bc,(VFPCTR)	;
	ldir			;move user buffer to dup-buffer
	ld	a,00h		;
	ld	(FTMFLG),a	;reset the first-time flag
	ld	(DTEFLG),a	;
	ld	(RC1FLG),a	;
	ld	(RC2FLG),a	;
	ret			;
;
;status on illegal field number
;
ILLFNO:	ld	hl,36h		;
	call	MVESTT		;
	ret			;
;
;status on field backward , also used by field forward status.
;
FLDBWD:	call	CHKDR		;
	cp	0ffh		;
	jp	z,FLD2		;
	ld	hl,3ch		;
FLD2:	call	MVESTT		;
FLD1:	call	XFNO		;
	call	MVEVPC		;
	call	MVEFCK		;
	call	MVECPC		;
	call	MVEALL		;
	ret			;
;
FLDADV:	call	CHKDR		;
	cp	0ffh		;
	jp	z,FLDAD1	;
	ld	hl,42h		;
FLDAD1:	call	MVESTT		;
	jp	FLD1		;
;
;
;status on end of field
;
ENTCPL:	ld	a,(VCRFLG)	;
	cp	0ffh		;
	jp	nz,ENTCP1	;
	ld	a,(FMFFLG)	;
	cp	0ffh		;field modify flag set?
	jp	nz,ENTCP3	;go if not.
	ld	a,(VCRPSS)	;verify correction pass flag set?
	cp	0ffh		;
	jp	z,ENTCP3	;
	ld	a,0ffh		;
	ld	(VCRPSS),a	;set vcr-pass flag
	jp	SETVER		;
ENTCP3:	ld	a,00h		;
	ld	(VCRFLG),a	;
	ld	(VCRPSS),a	;
	ld	(FMFFLG),a	;
	ld	hl,6ch		;set verify correction status
	jp	ENTCP2		;
ENTCP1:	call	CHKDR		;
	cp	0ffh		;
	jp	z,ENTCP2	;
	ld	hl,48h		;
	ld	a,(PF2FLG)	;
	cp	0ffh		;pf2-function flag set?
	jp	nz,ENTCP2	;go if not
	ld	hl,72h		;
ENTCP2:	call	MVESTT		;
	call	XFNO		;xlate and store working field number
	call	MVEVPC		;
	call	MVEFCK		;
	call	MVECPC		;
	call	MVEALL		;
	ld	a,00h		;
	ld	(CFLAG),a	;
	ret			;
;
PF2FLG:	db	00h		;pf2 function flag (DBB spec.func.)
VCRPSS:	db	00h		;verify correction pass flag
;
;this sets status on delete record (control-d)
;
DELREC:	ld	hl,4eh		;
DELRE1:	call	MVESTT		;
	ld	hl,1h		;
	ld	(BFNO),hl	;set field number to 1
	call	XFNO		;xlate and store the working field #.
	ld	a,0ffh		;
	ld	(EFOFLG),a	;set end of form flag
	jp	ERRCPL		;
;
;the following sets status on insert record and joins the 
;delete record code for completion.
;
INSRCD:	ld	hl,66h		;
	jp	DELRE1		;
;
;the following will handle status on record-advance.
;
RECADV:	ld	a,0ffh		;
	ld	(EFOFLG),a	;set the end-of-format flag
	ld	hl,5ah		;set status-number
	call	MVESTT		;set status in Z
	jp	ENDFR1		;
;
;the following will handle status on record-backward.
;
RECBWD:	ld	a,0ffh		;
	ld	(EFOFLG),a	;set end-of-format flag
	ld	hl,60h		;set status-number
	call	MVESTT		;set Status in Z
	jp	ENDFR1		;
;
;
;the following sets the binary mode on format-mode (03)
;
SETMDE:	ld	a,03h		;
	ld	(DEMODE),a	;
	ld	a,0h		;reset the
;	ld	(UPFFLG),a	;format-update flag
	call	CAUTFL		;check the authorized flag
;	jp	FORMAT		;
	jp	ILLFRM		;***replaces previous statement******
;
;the following sets the binary mode on format-update and
;sets the format-update flag
;
SETFUM:	ld	a,04h		;
	ld	(DEMODE),a	;
	ld	a,0ffh		;set the
;	ld	(UPFFLG),a	;format-update flag
;	jp	FORMAT		;
	jp	ILLFRM		;replaces previous statement****
;
SETENT:	ld	a,0h		;set entry-mode
	ld	(DEMODE),a	;
SETEN2:	ld	a,3h		;
	ld	(DGTCNT),a	;
	ld	ix,(SOZ)	;
	ld	de,2h		;
	add	ix,de		;
	call	ASXDEC		;xlate field number to binary.
	ld	(BFNO),hl	;
	ld	a,0ffh		;
	ld	(INFLG),a	;set the in-flag
	call	MVEALL		;
	ld	a,00h		;
	ld	(INFLG),a	;clear the user-in flag
	call	CAUTFL		;check authorized flag
	ld	a,(INTCLL)	;
	cp	0ffh		;
	jp	z,SETEN3	;go to initialize format
	ld	a,(EFOFLG)	;
	cp	0ffh		;
	jp	z,SETEN1	;
	jp	ENTRY		;
SETEN1:	ld	a,0h		;
	ld	(EFOFLG),a	;
	ld	a,0ffh		;
	ld	(CAVFLG),a	;set the 'clear all variable flds'flag.
	jp	UPDM15		;and jp to updmv to clear it.
;
SETEN3:	ld	a,00h		;
	ld	(INTCLL),a	;
	jp	FMTINT		;
;
;the following moves and xlates the number of variable positions
;to the control-area Z.
;
MVEVPC:	ld	hl,(VFPCTR)	;
	ld	ix,VPCWRK	;
	call	CONBTA		;
	dec	ix		;
	dec	ix		;
	dec	ix		;
	dec	ix		;
	ld	hl,(SOZ)	;
	and	a		;
	ld	bc,17		;
	add	hl,bc		;
	ex	de,hl		;start of # of var.pos in Z now in de
	ld	(IXSVE),ix	;
	ld	hl,(IXSVE)	;
	ld	bc,04h		;
	ldir			;
	ret			;
;
VPCWRK:	ds	6		;
IXSVE:	ds	2		;
;
;
;the following will move the cursor position counter to Z.
;
MVECPC:	ld	hl,(SOFUBA)	;
	ld	de,(UBFADD)	;
	and	a		;
	sbc	hl,de		;
	ld	a,(EFTFLG)	;
	cp	0ffh		;
	jp	nz,MVECP1	;
	inc	hl		;
MVECP1:	ld	ix,XBUFF	;
	call	CONBTA		;
	ld	de,(SOZ)	;
	ld	hl,25		;
	and	a		;
	add	hl,de		;
	ex	de,hl		;
	ld	hl,XBUFF	;
	inc	hl		;
	ld	bc,04h		;
	ldir			;
	ld	a,00h		;
	ld	(EFTFLG),a	;
	ret			;
;
USRSVE:	ds	2	;
USRSV1:	dw	0000h	;
;
;
;the following will xlate the field number from binary to ascci
;and store it into Z . the IXFNO entrance will also increment
;the field number , the XFNO will not.
;
IXFNO:	ld	hl,(BFNO)	;
	inc	hl		;
	ld	(BFNO),hl	;inc the b-field number
XFNO:	ld	hl,(BFNO)	;
	ld	ix,XBUFF	;
	call	CONBTA		;xlate to asccii
	dec	ix		;
	dec	ix		;
	dec	ix		;set pointer to 3-digit fld-number.
	ld	hl,(SOZ)	;
	ld	bc,14		;
	add	hl,bc		;build offset into Z
	ex	de,hl		;
	ld	(IXSVE),ix	;
	ld	hl,(IXSVE)	;
	ld	bc,03h		;
	ldir			;store number into Z
	ret			;
;
XBUFF:	ds	6		;
;
SETUPD:	ld	a,02h		;
	ld	(DEMODE),a	;set update-mode
	jp	SETEN2		;join entry code
;
SETVER:	ld	a,01h		;
	ld	(DEMODE),a	;
	jp	SETEN2		;
;
FRMDAT:	ld	a,05h		;
	ld	(DEMODE),a	;
	jp	SETEN2		;
;
;
INIT:	ld	a,0ffh	;
	ld	(INTCLL),a	;
	ld	(BCSVE),bc	;
	ld	(HLSVE),hl	;
	ld	(DESVE),de	;
	ld	bc,DUPBFF	;
	ld	hl,2048		;
	ld	a,20h		;
	call	INBUFF		;space the dup-buffer
	ld	a,0ffh		;
	ld	(FTMFLG),a	;set first time flag
	ld	hl,02h		;
	ld	a,(hl)		;
	ld	d,a		;
	inc	hl		;
	ld	a,(hl)		;
	ld	e,a		;
	ld	(BIOSBS),de	;save bios base
	ld	bc,(BCSVE)	;restore bc
	ld	hl,(HLSVE)	;restore hl
	ld	de,(DESVE)	;restore de
	jp	ENT		;
;
INTCLL:	db	0h		;init call flag
BCSVE:	dw	0000h		;
HLSVE:	dw	0000h		;
DESVE:	dw	0000h		;
;
;
;the following will check and xlate the authorized flag
;
CAUTFL:	ld	hl,(SOZ)	;
	ld	bc,5h		;
	add	hl,bc		;
	ld	a,(hl)		;
	cp	30h		;clear flag?
	jp	z,CAUTF1	;
	cp	31h		;
	jp	z,CAUTF2	;
	ret			;
;
CAUTF1:	ld	a,0h		;
	ld	(AUTFLG),a	;clear the authorized flag
	ret			;
;
CAUTF2:	ld	a,0ffh		;
	ld	(AUTFLG),a	;set the authorized flag
	ret			;
;
;the following will reset the clear-z flag if it was set and perform
;the clearing of Z.
;on verify-mode the statistic counters will not be cleared.
;
CLRZ1:	ld	a,30h		;
	ld	(hl),a		;
	inc	hl		;
	ld	(hl),a		;
	ld	(CLRZSV),hl	;
	ld	hl,(SOZ)	;
	ld	e,(hl)		;
	inc	hl		;
	ld	d,(hl)		;
	ld	hl,3130h	;
	and	a		;
	sbc	hl,de		;
	jp	z,CLRZ2		;
	ld	hl,(CLRZSV)	;
	ld	bc,7h		;
	add	hl,bc		;
	push	hl		;
	pop	bc		;
	ld	hl,436		;
	call	INBUFF		;
	jp	FRMMD		;
;
CLRZ2:	ld	hl,(CLRZSV)	;
	ld	bc,68		;
	add	hl,bc		;
	push	hl		;
	pop	bc		;
	ld	hl,360		;
	call	INBUFF		;
	jp	FRMMD		;
;
CLRZSV:	dw	0000h		;
;
;
;the following will set the form-mod flag in the ccb
;
FRMMD1:	ld	a,0ffh		;
	ld	(FMDFLG),a	;
	jp	MDCHK		;
;
FRMMD2:	ld	a,00h		;
	ld	(FMDFLG),a	;
	jp	MDCHK		;
;
;the following handles the display mode,with and without
;response.
;
DMSGWR:	ld	a,0ffh		;
	ld	(DWRFLG),a	;set the response-flag.
	ld	a,09h		;
	ld	(DEMODE),a	;set mode
	jp	DMSG7		;
;
DMSG:	ld	a,08h		;
	ld	(DEMODE),a	;set mode
DMSG7:	ld	de,MSGTAB	;
	ld	hl,(FBFADD)	;
	dec	hl		;
	dec	hl		;
	ld	(FBFADD),hl	;**** this compensates the TKDES offset
;of FBFADD which is here used as the Z buffer address*****************
	ld	bc,32		;
	ldir			;move msg from Z to MSGTAB
	ld	a,00h		;
	call	DSPMSG		;and display msg.
	ld	a,(DWRFLG)	;
	cp	0ffh		;
	jp	z,DMSG1		;
	ld	a,00h		;
	ld	(DWRFLG),a	;
	jp	DMSG6		;exit to user
;
DMSG1:	ld	bc,0ffbbh	;response start address on crt
	ld	(SOFCBA),bc	;
	ld	hl,16		;
	ld	a,20h		;
	call	INBUFF		;blank response area
	ld	de,(SOFCBA)	;
	ld	(SOFFBA),de	;
DMSG4:	ld	a,00h		;
	ld	(DMSCNT),a	;clear the counter
DMSG5:	ld	a,0ffh		;
	ld	(MLNFLG),a	;
	call	INCCRS		;
DMSG8:	call	CHRRD		;get chararcter from keyboard
	ld	c,a		;
	cp	CRTN		;carriage return?
	jp	z,DMSG3		;yes
	ld	a,c		;
	call	CHKBTE		;check the character
	cp	00h		;special character?
	jp	z,DMSG9		;yes
	cp	01h		;numeric character?
	jp	z,DMSG9		;yes
	cp	02h		;alpha character?
	jp	z,DMSG9		;yes
	jp	DMSG8		;must be illegal character,ignore it
DMSG9:	ld	hl,(SOFCBA)	;
	ld	(hl),c		;
	ld	a,128		;
	ld	hl,0ff98h	;
	ld	(hl),a		;reset the blink/inverted of msg
	ld	a,(DMSCNT)	;
	inc	a		;
	ld	(DMSCNT),a	;inc the byte count
	cp	16		;
	jp	z,DMSG2		;go to start of entry area.
	ld	hl,(SOFCBA)	;
	inc	hl		;
	ld	(SOFCBA),hl	;
	jp	DMSG5		;
;
DMSG2:	ld	hl,0ffbbh	;
	ld	(SOFCBA),hl	;
	jp	DMSG4		;
;
DMSG3:	ld	hl,(FBFADD)	;
	ld	bc,32		;
	add	hl,bc		;
	ex	de,hl		;
	ld	hl,0ffbbh	;
	ld	bc,16		;
	ldir			;xfer msg to Z
	ld	a,0h		;
	ld	(DWRFLG),a	;
DMSG6:	ld	hl,54h		;
	call	MVESTT		;
	ret			;ret to user.
;
DWRFLG:	db	00h		;
DMSCNT:	db	00h		;
;
;
;the following will move and xlate all counters.
;
MVEALL:	call	MVEFIL		;move field length
	call	MVEEEC		;entry error counter
	call	MVEVEC		;verify error counter
	call	MVENKE		;number of keys entered
	call	MVENKV		;number of keys verified
	call	MVENEF		;number of error flags
	call	MVEECR		;number of error flag corrections
	call	MVEVCR		;number of verify corrections
	ret			;
;
;the following will move and xlate the field length counter
;
MVEFIL:	ld	a,4		;load number of digits
	ld	(MVESV3),a	;
	ld	hl,(FILCTR)	;get binary field length
	ld	(MVESV1),hl	;
	ld	hl,29		;offset into Z
	ld	(MVESV2),hl	;
	ld	hl,FILCTR	;
	ld	(MVESV4),hl	;
	call	MVEXLT		;xlate and move it
	ret			;
;
;
;the following will move and xlate the entry-error counter
;
MVEEEC:	ld	a,6		;
	ld	(MVESV3),a	;
	ld	hl,(EERCTR)	;
	ld	(MVESV1),hl	;
	ld	hl,EERCTR	;
	ld	(MVESV4),hl	;
	ld	hl,33		;
	ld	(MVESV2),hl	;
	call	MVEXLT		;
	ret			;
;
;the following will move and xlate the verify error ctr.
;
MVEVEC:	ld	a,6		;
	ld	(MVESV3),a	;
	ld	hl,(VERCTR)	;
	ld	(MVESV1),hl	;
	ld	hl,VERCTR	;
	ld	(MVESV4),hl	;
	ld	hl,39		;
	ld	(MVESV2),hl	;
	call	MVEXLT		;
	ret			;
;
;the following will move and xlate the number of entered keys
;
MVENKE:	ld	a,6		;
	ld	(MVESV3),a	;
	ld	hl,(NKECTR)	;
	ld	(MVESV1),hl	;
	ld	hl,NKECTR	;
	ld	(MVESV4),hl	;
	ld	hl ,45		;
	ld	(MVESV2),hl	;
	call	MVEXLT		;
	ret			;
;
;the following will move and xlate the number of keys verified.
;
MVENKV:	ld	a,6		;
	ld	(MVESV3),a	;
	ld	hl,(NKVCTR)	;
	ld	(MVESV1),hl	;
	ld	hl,NKVCTR	;
	ld	(MVESV4),hl	;
	ld	hl,51		;
	ld	(MVESV2),hl	;
	call	MVEXLT		;
	ret			;
;
;the following will move and xlate the number of keys corrected during
;verify.
;
MVEVCR:	ld	a,6		;
	ld	(MVESV3),a	;
	ld	hl,(VCRCTR)	;
	ld	(MVESV1),hl	;
	ld	hl,VCRCTR	;
	ld	(MVESV4),hl	;
	ld	hl,69		;
	ld	(MVESV2),hl	;
	call	MVEXLT		;
	ret			;
;
;the following will move and xlate the number of error flags.
;
MVENEF:	ld	a,6		;
	ld	(MVESV3),a	;
	ld	hl,(NEFCTR)	;
	ld	(MVESV1),hl	;
	ld	hl,NEFCTR	;
	ld	(MVESV4),hl	;
	ld	hl,57		;
	ld	(MVESV2),hl	;
	call	MVEXLT		;
	ret			;
;
;the following will move and xlate the number of corrected error flags.
;
MVEECR:	ld	a,6		;
	ld	(MVESV3),a	;
	ld	hl,(ECRCTR)	;
	ld	(MVESV1),hl	;
	ld	hl,ECRCTR	;
	ld	(MVESV4),hl	;
	ld	hl,63		;
	ld	(MVESV2),hl	;
	call	MVEXLT		;
	ret			;
;
;
;the following will do the actual xlation and move that the previous 
;routines call for.
;
MVEXLT:	ld	a,(INFLG)	;
	cp	0ffh		;is user coming IN?
	jp	z,MVEXL3	;yes.
	ld	hl,(MVESV1)	;get binary-number
	ld	ix,MVEWRK	;load work-area
	call	CONBTA		;and xlate binary to ascci
	ld	a,(MVESV3)	;get byte count.
MVEXL1:	cp	00h		;zero bytes to go?
	jp	z,MVEXL2	;yes.
	dec	ix		;
	dec	a		;
	jp	MVEXL1		;keep looping
MVEXL2:	ld	hl,(SOZ)	;
	and	a		;
	ld	bc,(MVESV2)	;get offset into Z
	add	hl,bc		;
	ex	de,hl		;
	ld	(IXSVE),ix	;
	ld	hl,(IXSVE)	;
	ld	a,(MVESV3)	;
	ld	c,a		;
	ld	b,00h		;
	ldir			;move the ascci to Z
	ret			;
;
MVEXL3:	ld	ix,(MVESV2)	;
	ld	de,(SOZ)	;
	add	ix,de		;
	ld	a,(MVESV3)	;
	cp	06h		;
	jp	nz,MVEXL4	;
	dec	a		;on 6 digits take only
	inc	ix		;5 digits,for the time being*****
MVEXL4:	ld	(DGTCNT),a	;
	call	ASXDEC		;ascii to binary
	ex	de,hl		;
	ld	hl,(MVESV4)	;
	ld	(hl),e		;
	inc	hl		;
	ld	(hl),d		;
	ret			;
;
;
MVEFLL:	db	30h		;this is just to fill up to 6 digits.
MVEWRK:	ds	6		;
MVESV1:	dw	0000h		;
MVESV2:	dw	0000h		;
MVESV3:	db	00h		;
MVESV4:	dw	0000h		;
INFLG:	db	00h		;
;
;the following will clear the register flags in the ccb 
;
CLRREG:	ld	a,00h		;
	ld	bc,R0FLG	;
	ld	hl,27		;
	call	INBUFF		;
	ret			;
;
;
;the following will set the appropriate ascci status in Z
;
MVESTT:	ld	de,STTAB	;get status table
	add	hl,de		;add given offset to it
	ex	de,hl		;save result in de
	ld	bc,(SOZ)	;get start of Z
	ld	hl,8h		;get offset to status
	add	hl,bc		;
	ex	de,hl		;move it to de
	ld	bc,6h		;set byte count
	ldir			;and move it to Z
	ret			;
;
;
;the following is the status-table 
;
STTAB:	db	"020800"	;mode-error
	db	"010300"	;format complete
	db	"070800"	;illegal format
	db	"040800"	;format not initialized
	db	"010800"	;legal abort (user cancelled)
	db	"010900"	;form.chain key modified
	db	"010300"	;send key
	db	"011300"	;home key
	db	"010200"	;end of format reached
	db	"030800"	;illegal field number
	db	"011200"	;field backward
	db	"011100"	;field forward
	db	"010100"	;end of field
	db	"010600"	;delete record
	db	"011408"	;display mode complete
	db	"010400"	;record advance
	db	"010500"	;record backward
	db	"010700"	;insert record
	db	"011402"	;verify- or field correction
	db	"011409"	;date-field status
	db	"011410"	;range check 1 field
	db	"011411"	;range check 2 field
;
;the following checks the date/range check 1/range check 2 - flags
;and sets the appropriate status offset in hl-reg.
;
CHKDR:	ld	a,(DTEFLG)	;
	cp	0ffh		;
	jp	z,CHKDR1	;go on date flag set.
	ld	a,(RC1FLG)	;
	cp	0ffh		;
	jp	z,CHKDR2	;go on range check 1 flag set.
	ld	a,(RC2FLG)	;
	cp	0ffh		;
	jp	z,CHKDR3	;go on range check 2 flag set.
	ld	a,00h		;
	ret			;return if none of the flags are set.
CHKDR1:	ld	hl,114		;set date field status offset
	jp	CHKDR4		;
CHKDR2:	ld	hl,120		;set range 1 status offset
	jp	CHKDR4		;
CHKDR3:	ld	hl,126		;set range 2 status offset
CHKDR4:	ld	a,00h		;
	ld	(DTEFLG),a	;
	ld	(RC1FLG),a	;
	ld	(RC2FLG),a	;
	ld	a,0ffh		;
	ret			;return if one of the flags was set.
;
;
;
	end
;
«eof»