Compucolor.org – Virtual Media

Listing of file='RUNLNK.MAC;02' on disk='vmedia/taylor_8-sector.ccvf'

;********************************************************
;*							*
;*	PRELUDE FOR A BASIC PROGRAM			*
;*							*
;*	WHEN RUN, THIS ROUTINE SETS UP LINKAGES FOR	*
;*	USE BY A BASIC PROGRAM, AND ADJUSTS THE TOP	*
;*	OF MEMORY. SET UP ARE:				*
;
	EXT	CALLRTN,TIM2RTN
;
;*	THE ADDRESSES OF THE USER'S CALLED ROUTINE,	*
;*	AND THE TIMER 2 ROUTINE. OTHER PROGRAMS MUST	*
;*	DECLARE THES NAMES AS PUBLIC.			*
;*							*
;********************************************************
;
CALLVECT EQU	33282
TIM2VECT EQU	33224
MEMTOP	EQU	32940
;
START:	PUSH	PSW
	PUSH	H
	LXI	H,CALLRTN
	SHLD	CALLVECT+1	;SET LINK TO USER'S CALL ROUTINE
	LXI	H,TIM2RTN
	SHLD	TIM2VECT+1	;SET LINK TO USER'S TIMER 2 RTN
	MVI	A,(JMP)		;LITERALLY JUMP
	STA	CALLVECT
	STA	TIM2VECT
	LXI	H,START-1		;POINT TO BEG OF PGM, MINUS 1
	SHLD	MEMTOP		;ESTABLISH AS TOP OF MEMORY
	POP	H		;BASIC PGM MUST DO A CLEAR
	POP	PSW
	MVI	B,0		;INDICATE NO ERRORS TO FCS
	RET
	END	START