Author Topic: Name clashes  (Read 5026 times)

Offline sal55

  • Jr. Member
  • *
  • Posts: 18
Name clashes
« 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.)

Offline Flo

  • Jr. Member
  • *
  • Posts: 3
Re: Name clashes
« Reply #1 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.