This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gas: macro to define string constant


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]