This is the mail archive of the binutils@sourceware.org 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]

H' hex constants


I've been asked to add H'00 syntax for hex constants to gas, for
compatibility with other assemblers.  The easiest thing to do is to
replace the H' with 0x early on, so I've been looking at
do_scrub_chars() in app.c.  I've got added logic to brute-force all H'
into 0x but it doesn't handle things like FGH't' gracefully.  One
problem is that there isn't a way to peek far enough ahead to see if
the character after the ' is a hex digit (you may not be able to unget
all those characters, and/or you may not be able to PUT() them all
into the output buffer).

However, the current code will take something like H'1234 and replace
the '1 with 0x30 (48), resulting in a symbol called H49234.  I figured
just replacing all H' with 0x wouldn't break any existing valid code,
but I thought I'd ask.  If so, I'll need to work on smarter logic.

Comments?


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