This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Getting the character out of the .irpc directive
- From: mccoards at netscape dot net
- To: binutils at sources dot redhat dot com
- Date: Tue, 30 Dec 2003 14:20:49 -0500
- Subject: Re: Getting the character out of the .irpc directive
Ian Lance Taylor <ian@wasabisystems.com> wrote:
>mccoards@netscape.net writes:
>
>> In as version 2.9.1 I get the error message "Error: unexpected end of file in irp or irpc" when trying to use the .irpc directive/macro to generate a character value. Is there a work around to calculate the caracter value in the repeat character directive? Actually I really just want val = "cat" since "cat" will fit in a 4-byte wide integer.
>>
>> .set val,0
>> .irpc arg,cat
>> .set val,val<<8
>> .set val,val+'\arg'
>> .endr
>
>The single quote character in assembler input doesn't mean what you
>think it does.
>
>http://sources.redhat.com/binutils/docs-2.12/as.info/Chars.html#Chars
>
>I don't really understand what you are trying to do.
>
>Ian
>
I want to set a variable equal to a small string (no more that 4 chars). For the m68k I would like to be able to do this:
.set item,"ABCD"
dc.l foo
I know that I could use the .string directive, but I am more interested in setting the variable "item" to a small string.
I thought that I could do this with a macro using the irpc directive, but it appears that the character substitution is a lower priority then the single quote chararacter. A simpler example would be:
.irpc arg,c
.set item,'\arg
.endr
I would have thought that the irpc argument substitution would have been made first so that irpc would generate .set item,'c , but this doesnt work and I cant find a work around.
Thanks
Bart
__________________________________________________________________
New! Unlimited Access from the Netscape Internet Service.
Beta test the new Netscape Internet Service for only $1.00 per month until 3/1/04.
Sign up today at http://isp.netscape.com/register
Act now to get a personalized email address!
Netscape. Just the Net You Need.