Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经声明了一个变量:
section .bss var resb 1
我想在我的程序中将它初始化为 value 255。
255
mov [var], 255 ;error on this line
编译时出现以下错误:
program.asm:123: error: invalid size for operand 1
我在这里做错了什么?
它以这种方式工作,您必须使用寄存器将数据分配给符号 [myVar] 寻址的位置:
mov eax,255 mov [myVar],eax PRINT_DEC 2,myVar