I would like to do something like this:
mov al, offset [bx]
while bx
contains an address of a name of another variable. Is there a way to do so in assembly 8086?
CodePudding user response:
There are no variable names anymore at runtime, that is after assembling. You need to put the address of an variable into bx
, not the name. If the address of an variable is in bx
, then the instruction you wrote needs to be written without the offset
keyword and load the contents of that variable pointed to by bx
into al
.