This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GAS macro formals as expression


Ian Lance Taylor <ian@airs.com> writes:

> I think gas is more flexible than you give it credit for.  Try this
> version.  It probably needs some tweaks, but I think the general
> approach should be workable.
> 
> .macro	ldCachePentium2 addr,byteCnt
> 	NN = 0
> 	.rept	(\byteCnt + 63) / 64
> 		.ifeq	NN
> 			mov \addr,%eax
> 		.else
> 			mov	NN \addr,%eax
> 		.endif
> 		.if	(NN + 32) < \byteCnt
> 			mov NN + 36 \addr,%eax
> 		.endif
> 		NN = NN + 64
> 	.endr
> 	.endm

Oh yeah, I should mention that a sample call is
	ldCachePentium2 (%esp),0x2c0
and that `NN' should probably be replaced by `NN\@'.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]