Listing 1.  Source code for the test program that
incorporates an internal ENV/TCAP for when the program
is run under standard CP/M.

; PROGRAM:	ZTEST.Z80
; AUTHOR:	Jay Sage
; DATE:		June 16, 1991

; This is a program to test the technique of including
; an internal ENV and TCAP.

; ---------- External References

	maclib		cpmenv.lib

	.request	vlib,syslib0

	extrn		z3vinit,cls,at	; VLIB routines
	extrn		vprint

; ---------- Standard Z-System program header

; To make the code work transparently with CP/M, the header
; is initialized to point to the internal ENV.  When the
; program is run under ZCPR33 or later, the address of the
; external Z-System ENV will be poked into the code by the
; command processor at run time.

	jp	start

	db	'Z3ENV'		; Signature
	db	1		; ENV type
envptr::
	dw	intenv		; Pointer to ENV

; Material for use with ZCNFG can be included here.

; ---------- Internal ENV and TCAP placed here

intenv:	cpmenv			; Use macro

; ---------- Actual Program Code

start:
	ld	hl,(envptr)	; Initialize
	call	z3vinit

	call	cls		; Clear screen
	call	at		; Position cursor
	db	10,10
	call	vprint		; Display a message
	db	'This is '
	db	1		; Highlighting on
	db	'highlighted'
	db	2		; Highlighting off
	db	' video!'
	db	0
	call	at		; Put cursor at bottom
	db	22,1

	ret

	end
                                               