This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
gas: macro to define string constant
- From: Massimiliano Cialdi <cialdi at firenze dot net>
- To: binutils ML <binutils at sources dot redhat dot com>
- Date: Wed, 1 Sep 2004 12:48:20 +0200
- Subject: gas: macro to define string constant
- Organization: Starfleet
I have:
str_first:
.ascii "first string\r\n"
sizeof_str_first = .-str_first
.size str_first, sizeof_str_first
str_second:
.ascii "second string\r\n"
sizeof_str_second = .-str_second
.size str_second, sizeof_str_second
s_error:
.ascii "error string\r\n"
sizeof_s_error = .-s_error
.size s_error, sizeof_s_error
so I wont to do something like:
.macro def_str name, value
\nome:
.ascii \value "\r\n"
sizeof_\name = .-\name
.size \name, sizeof_\name
.endm
def_str str_first, "first string"
def_str str_second, "error string"
def_str s_error, "error string"
but assembler gives me a warning:
rest of line ignored; first ignored character is 'f'
I cannot understand.
how to define this macro?
thanks
--
Massimiliano Cialdi
cialdi@firenze.net
m.cialdi@oksys.it