NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: sal55 on June 03, 2017, 10:52:40 AM

Title: Name clashes
Post by: sal55 on June 03, 2017, 10:52:40 AM
I'm using Nasm as a target language from a language translator.

But sometimes, an identifier in the source language clashes with a reserved word in Nasm.

For example, "abs", or "ch". (The latter is a register name, I'm not sure about the former, but it causes problems)

Is there any way around this within Nasm? (Perhaps overrides for being able to use "ch" as an identifier, and alternate ways to denote ch as the register name.)

(One solution is for the translator to have a list of all such names, to look up every identifier, and to 'decorate' the name before writing the Nasm code. But this is rather heavyweight, and won't work for global names that are imported from elsewhere.)
Title: Re: Name clashes
Post by: Flo on June 11, 2017, 09:25:15 AM
You will most likely have to put a prefix on all your generated symbol names if you run in trouble. You could use _abs instead abs.