如何在x86中创建多个全局字节数组和多个dword?另外,如何将它们全部初始化为0?这会在_start:或.data中完成吗?要使用的汇编程序是NASM。
答案 0 :(得分:0)
Nasm语法 - 100字节/双字:
section .bss
byte_array resb 100
dword_array resd 100
; or...
section .data
byte_array_2 times 100 db 0
dword_array_2 times 100 dd 0
global _start ; ask Nasm to tell linker about this
section .text
_start:
; do something intelligent...
section .bss
byte_array resb 100
dword_array resd 100
; or...
section .data
byte_array_2 times 100 db 0
dword_array_2 times 100 dd 0
global _start ; ask Nasm to tell linker about this
section .text
_start:
; do something intelligent...
名义上是“未初始化”,但实际上在任何合理的平台上都被初始化为零。 Fasm使用
section .bss
和rb
代替rd
和resb
。你没有说“什么是汇编程序”。