Assigning value to variable in x86 (NASM)

后端 未结 2 1968
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-14 11:37

I have decided to learn assembler for fun. I have been coding in C for many years.

I followed some online tutorials that print \"Hello world\" and dug around a bit i

2条回答
  •  执笔经年
    2021-01-14 12:22

    I think it has to be in brackets. Try [iter].

    See the NASM docs whenever you have questions like this.

    In this case, the section on Effective Addresses:

    An effective address is any operand to an instruction which references memory. Effective addresses, in NASM, have a very simple syntax: they consist of an expression evaluating to the desired address, enclosed in square brackets. For example:

    wordvar dw 123
    mov ax,[wordvar]
    mov ax,[wordvar+1]
    mov ax,[es:wordvar+bx]
    

提交回复
热议问题