macro's and local variables

Jan Beulich JBeulich@suse.com
Wed Oct 17 06:52:00 GMT 2012


>>> On 17.10.12 at 00:55, Ian Lance Taylor <iant@google.com> wrote:
> On Tue, Oct 16, 2012 at 11:37 AM, Mischa Baars <mjbaars1977@gmail.com> wrote:
>> However, I do not understand. Do you have an example?
> 
> 		.intel_syntax	noprefix
> 		.global		function
> 		.code64
> .macro		A		arg1
> 		.set		i\@, 0
> .rept		\arg1	
> 		mov		ax, i\@
> 		.set		i\@, i\@ + 1
> .endr
> .endm
> 
> .macro		C
> 		.set		i\@, 0
> .rept		4	
> 		A		i\@
> 		.set		i\@, i\@ + 1
> .endr
> .endm
> function:
> 		C	
> 		ret

Another option here is to use "local" (requiring .altmacro to be
in effect).

Jan



More information about the Binutils mailing list