From - Mon Aug 25 07:58:16 1997
Path: news.mitre.org!blanket.mitre.org!nntprelay.mathworks.com!europa.clark.net!4.1.16.34!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsxfer3.itd.umich.edu!oleane!weld.news.pipex.net!pipex!gecm.com!usenet
From: Brian Kerse
Newsgroups: comp.os.vms
Subject: VAX macro migrate
Date: 22 Aug 1997 14:12:48 GMT
Organization: GEC-Marconi Avionics, Radar Systems Division
Lines: 75
Message-ID: <5tk6p0$gik@gcsin3.geccs.gecm.com>
Reply-To: brian.kerse@gecm.com
NNTP-Posting-Host: pcpool15.edinbr.gmav.gecm.com
Mime-Version: 1.0
X-Newsreader: WinVN 0.93.11

Hi,

I have two macros I need modified to work on our Alpha.

The are both used within FORTRAN to either find the number of arguments in a call to a 
subroutine or to test a subroutine argument for validity.

F90 does have a routine which would replace first macro,  but we are a long way from changing 
our software.

The two routines are as follows.

	.TITLE 	NARGSINLST
	.IDENT	/V01/

;	PSECTS

	$SSDEF
	.PSECT	$CODE
	.ENTRY	NARGSINLST, ^M<R2>
	MOVL	8(FP),R2
	MOVL	(R2),@4(AP)
	MOVL	#SS$_NORMAL,R0
	RET
	.END

-------------------------------------------

	.TITLE	ARGVALID
	.IDENT	/01/

	arg_off = 4
	length_off = 8

	.psect	$CODE
	.psect	CODE

	.entry	ARGVALID_R,^m<r2,r3,r4>
	movl	8(fp),r2
	movzbl	@arg_off(ap),r3
	movezbl	(r2),r4
	cmpb	r4,r3
	blss	false
	mull2	#4,r3
	addl2	r2,r3
	tstl	(r3)
	beql	false
	prober	#0,@length_off(ap),@(r3)
	beql	false
	brw	true

	.entry	ARGVALID_W,^m<r2,r3,r4>
	movl	8(fp),r2
	movzbl	@arg_off(ap),r3
	movezbl	(r2),r4
	cmpb	r4,r3
	blss	false
	mull2	#4,r3
	addl2	r2,r3
	tstl	(r3)
	beql	false
	probew	#0,@length_off(ap),@(r3)
	beql	false
	brw	true

true:	movl	#1,r0
	ret
false:	movl	#0,r0
	ret
	.end

Many Thanks

Brian Kerse

