	title	Module from library BASE_1 : INCASC
	name	('INCASC')
	maclib	baselib.lib

; Increment an ASCII coded number

; Copyright (C)	Werner Cirsovius
;		Hohe Weide 44
;		D-20253 Hamburg
;		Tel.: +49-40-4223247

;		Version 1.0 September 1991

; ENTRY	Reg pair <HL> points to LSDigit of numeric string
;	Reg B holds length of number

; EXIT	ASCII number incremented

	entry	incasc

more.asc:
	ld	a,(hl)		; Get character
	cp	'0'		; Test digit
	jr	c,asc.1
	cp	'9'+1
	jr	c,incasc
asc.1:
	ld	(hl),'0'	; Init digit
incasc:
	inc	(hl)		; Bump digit
	ld	a,(hl)
	cp	'9'+1		; Test overflow
	ret	nz		; .. no
	ld	(hl),'0'	; Init digit
	dec	hl
	djnz	more.asc
	ret

	end

