string concatenation in gas

Geoff Berry geoffb@bops.com
Thu Apr 13 12:09:00 GMT 2000


Is there any way to get string concatenation in gas?  Let's say I want to
write a macro that saves a range of registers (assuming push is a valid
instruction that takes a single register argument):

.MACRO	pushRegs	From,To
	push		r\From
	.IF \To-\From
	pushRegs	"(\From+1)",\To
	.ENDIF
.ENDM

This doesn't work because the \From value is not evaluated and I end up
with:

push	r(0+1)
push	r((0+1) + 1)
...

instead of

push	r1
push	r2
...

This kind of thing works in gasp, but I would like to avoid using gasp if
possible.

-- 
Geoff Berry


More information about the Binutils mailing list