; Routine zur Ermittlung der CP/M-Version und deren Anzeige am Bildschirm

; NAME:         CPMVERSION
; DATE:         07.11.1987
; LAST UPDATE:  07.11.1987
; LANGUAGE:     ASSEMBLER ZMAC/ZLINK
;		ZMAC  CPMVERS=CPMVERS.ZSM
;		ZLINK CPMVERS=CPMVERS
; AUTHOR:       Assemblergruppe SCUG

base		=	0
wboot		=	base
bdos		=	base+5
tpa		=	base+100h

; BDOS-Funktionen

conout		=	2
strout		=	9
cpmvers		=	12

; allgemeine Konstanten

lf		=	10
cr		=	13
strende		=	'$'

	global	cpmversion

cpmversion:
	ld	de,versionstxt
	ld	c,strout
	call	bdos
	ld	c,cpmvers
	call	bdos
	ld	a,l
	push	af
	rrca
	rrca
	rrca
	rrca
	and	0fh
	add	a,'0'
	ld	e,a
	ld	c,conout
	call	bdos
	ld	e,'.'
	ld	c,conout
	call	bdos
	pop	af
	and	0fh
	add	a,'0'
	ld	e,a
	ld	c,conout
   call	bdos
	ld	de,vers2txt
	ld	c,strout
	call	bdos
	ret

versionstxt:
	db	'Auf diesem Rechner ist momentan das Betriebssystem '
	db	'CP/M ',strende
vers2txt:
	db	' installiert!',cr,lf,strende

	end
