;
; FUNCTION EXORG( VAR VALUE: CHAR): INTEGER;EXTERNAL;
;
; THIS EXTERNAL FUNCTION WILL RETURN THE ADDRESS LOCATION OF THE
; ARGUMENT OF THE FUNCTION. BECAUSE ALL VARIABLES EXCEPT INTEGERS
; HAVE THEIR ORIGIN ADDRESS IN THE SAME LOCATION THIS SAME
; FUNCTION COULD BE USED FOR MANY DIFFERENT ARGUMENT TYPES. FOR
; EXAMPLE:
;
; FUNCTION EXORG( VAR VALUE: REAL): INTEGER;EXTERNAL;
; FUNCTION EXORG( VAR VALUE: STRING255): INTEGER;EXTERNAL;
;
; THIS ROUTINE WILL HOPEFULLY COVER ALL CASES WHERE THE USER
; WANTS THE ADDRESS (OR STARTING ADDRESS) OF A VARIABLE . ALTHOUGH
; ALL THE ABOVE DEFINITIONS PROBABLY WILL NOT BE NEEDED ALL ARE
; AVAILABLE BY JUST CHANGING THE VARIABLE TYPE DEFINITION IN THE EXTERNAL
; FUNCTION DEFINITION, AND THEREBY FOOL THE COMPILER.
;
; THIS PROCEDURE COULD BE ADAPTED TO ACCOMMODATE INTEGERS BY ORGH AND 
; ORGL TO 10 AND 9 RESP.
;
; A TYPICAL APPLICATION FOR THIS FUNCTION WOULD BE TO FIND OUT AN ARRAYS
; STARTING ADDRESS SO YOU COULD DMA DIRECTLY INTO IT.
;
;
ORGH	EQU	9;
ORGL	EQU	8; HIGH AND LOW ORDER ORIGIN ADDR OF THE VARIABLE
FUNCL	EQU	2;
FUNCH	EQU	3;FUNCTION RETURN OFFSET LOCATION
	NAME	ORGEX;	LINKER MODULE NAME
	ENTRY	RLORG
	ENTRY	STRORG
	ENTRY	EXORG; LINKER ENTRY PTS FOR ALL ABOVE FUNCTIONS
RLORG:
STRORG;
EXORG:	ENTR	D,2,0;	MACRO SETUP ROUTINE
	MOV	A,ORGL(IX)
	MOV	FUNCL(IX),A; STORING LOW ORDER BYTE
	MOV	A,ORGH(IX)
	MOV	FUNCH(IX),A;	STORING HIGH ORDER BYTE
	EXIT	D,2; CLEANUP AND WE'RE FINISHED
;
;
