<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">; Version 1.01 02.12.88
; Testversion zum dump'en des kompletten Speichers

	cseg

	public	dump
	extrn	?cono,?conin,?const,?pmsg
	extrn	@cbnk
;	extrn	conout,prmmsg

	maclib	ports
	maclib	z80

;	Copyright (C) 1975, 1976, 1977, 1978, 1979, 1980, 1981
;	Digital Research
;	Box 579, Pacific Grove
;	California, 93950
;
;	and
;
;	Copyright (C) 1988
;	Sebastian Simon
;	Haendel-Haus Halle
;	Gr. Nikolaistr. 5-6
;	Halle
;	4020
;
;	non graphic characters
cr	equ	0dh	;carriage return
lf	equ	0ah	;line feed
;
;	file control block definitions
;
dump:
;	set up stack
;	set sp to local stack area (restored at finis)
	lxi	sp,stktop
;	print signon message
	lxi	h,signon
	call	?pmsg

;	call	prmmsg
	
;
; set initial condition
	lxi	h,sypaa
	call	?pmsg


;	call	prmmsg

	call	crlf
	mvi	a,0FFH
	sta	@cbnk
memlop:
	lxi	h,sypaa
	call	?pmsg

;	call	prmmsg

	lda	@CBNK
	INR	A
	STA	@CBNK
	out	07h

	call	phex
	call	crlf
	lxi	h,0
zeilop:
	mov	a,h
	call	phex
	mov	a,l
	call	phex
	mvi	a,':'
	call	pchar
absta:
	mvi	a,' '
	call	pchar
	push	h
	mvi	b,10h
hexlop:
	mov	a,m
	call	phex
	mvi	a,' '
	call	pchar
	inx	h
	djnz	hexlop

	pop	h
	push	h
ascout:				;output ascii code of line
	mvi a,' '! call pchar
	mvi a,' '! call pchar
	mvi a,' '! call pchar
	mvi	b,10h
nexasc:
	mov	a,m
	cpi	20h
	jc	nonasc
	cpi	7fh
	jc	ascou
nonasc:
	mvi	a,'.'
ascou:
	call	pchar
	inx	h
	djnz	nexasc

; test auf break
	call	break
	CALL	CRLF	
	pop	h
	lxi	b,10h
	dad	b
	mov	a,h
	ora	l
	jnz	zeilop
	jmp	memlop


;	subroutines
;
break:	;check break key (actually any key will do)
	push h! push d! push b; environment saved
	call	?const
	ora	a
	jrz	breake
	call	?conin
conw:

;	in	06h
;	cpi	30h
;	jrz	conw

	call	?conin
	cpi	3
	jrnz	conw
breake:
	pop b! pop d! pop h; environment restored
	ret
;
pchar:	;print a character
	push h! push d! push b! push psw; saved
	mov	c,a
	call	?cono

;	call	conout

	pop psw! pop b! pop d! pop h; restored
	ret
;
crlf:
	mvi	a,cr
	call	pchar
	mvi	a,lf
	call	pchar
	ret
;
;
pnib:	;print nibble in reg a
	ani	0fh	;low 4 bits
	cpi	10
	jnc	p10
;	less than or equal to 9
	adi	'0'
	jmp	prn
;
;	greater or equal to 10
p10:	adi	'A' - 10
prn:	call	pchar
	ret
;
phex:	;print hex char in reg a
	push	psw
	rrc
	rrc
	rrc
	rrc
	call	pnib	;print nibble
	pop	psw
	call	pnib
	ret
;
;
;	fixed message area
signon:
	db	'CP/M DUMP V2.1',cr,lf,0
sypaa:	db	'Speicherseite: ',0
;
;	variable area

;	stack area
	ds	64	;reserve 32 level stack
stktop:
;
	end
</pre></body></html>