macro's and local variables

Mischa Baars mjbaars1977@gmail.com
Wed Oct 17 18:50:00 GMT 2012


Hi,

Now try to uncomment the '.altmacro' directive if you like.

Best Regards,
Mischa.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: common.h
Type: text/x-chdr
Size: 114 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20121017/8fe9dffb/attachment.bin>
-------------- next part --------------
#include	"common.h"

		.intel_syntax	noprefix

		.code32

		.global		function

//		.altmacro

.macro		A		arg1, arg2

		.set		k, 2

.rept		\arg2 - \arg1 - 2

		.set		k, k + 1

.endr

.endm

function:

		.set		j, 0

.rept		N

		.set		i, 0

.rept		N

		A		i + j, j > 0 ? N + j + 1 : i + 2

		.set		i, i + 1

.endr

		.set		j, j + 1

.endr

		ret




More information about the Binutils mailing list