This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Is it possible to do this using GAS
- To: "Robert-Margaret Hunt"<robert-margaret_hunt at sil dot org>
- Subject: Re: Is it possible to do this using GAS
- From: Nick Clifton <nickc at redhat dot com>
- Date: 23 Mar 2001 14:42:36 -0800
- Cc: <binutils at sources dot redhat dot com>
- References: <0103229853.AA985315520@router-8.camnet.com>
Hi Robert-Margaret,
> .macro test2 regpair
>
> ldi \regpairL, 0x0a
> ldi \regpairH, 0x0a
> .endm
>
> ; This doesn't work
> test2 abc
> ; I can't find a way to combine a parameter
> ; without adding whitespace
> ; ie I want \regpairL to end up as
> ; abcL which would be equated to 16.
You need to use nested macros, like this:
.macro test-sub regpair letter1 letter2
ldi \regpair\letter1, 0x0a
ldi \regpair\letter2, 0x0a
.endm
.macro test2 regpair
test-sub \regpair L H
.endm
test2 abc
Cheers
Nick