Hashken
Hashken

Reputation: 4676

Changing label values in NASM

Once we assign a label using RESX or DX commands,(where X can be B, W, D, Q, T) is it possible to later assign a memory location to that label?

For eg, can I do something like,

mov label, X560h

Upvotes: 0

Views: 773

Answers (2)

Jakob Kirsch
Jakob Kirsch

Reputation: 27

Labels aren't in the final code (at least if you have a binary output). It wouldn't make any sense to change constants for the assembler while executing the code.

There are two ways to do it:

  1. Undefine the label with %undef and redefine it
  2. Write self-modifying code which changes all references to the label.

(I think that option 2 doesn't help you)

Upvotes: 0

alkedr
alkedr

Reputation: 784

I think it's not possible. Labels cannot be changed.

Upvotes: 1

Related Questions