Julian Kirsch
Julian Kirsch

Reputation: 744

NASM extern symbols with leading $

The NASM documentation states:

The only characters which may be used as the first character of an identifier are letters, . (with special meaning: see section 3.9), _ and ?.

I need to call an external procedure whose symbol starts with a leading $. Sadly the docs do not specify how to escape the $ or how to deal with the restriction.

Does anyone know how to specify an external symbol with a leading dollar sign?

Upvotes: 2

Views: 386

Answers (1)

Kai Burghardt
Kai Burghardt

Reputation: 1566

I need to call an external procedure whose symbol starts with a leading $. Sadly the docs do not specify how to escape the $ or how to deal with the restriction.

The documentation does not explain that because it is not possible. The extern directive will always ignore a leading $ (there is no ambiguity between register rax vs. label rax, since a register cannot be used in a label declaration). The first actual character of any identifier must be categorized as NCT_IDSTART, otherwise it is invalid.

Upvotes: 2

Related Questions