【发布时间】:2021-06-05 16:25:18
【问题描述】:
我必须在这里遗漏一些非常基本的东西。搜索 SO 但找不到这个特定问题的答案。这是我的 NASM 代码:
%include "io64.inc"
section .text
myvar db "This is not working", 0
global CMAIN
CMAIN:
mov rbp, rsp; for correct debugging
;write your code here
xor rax, rax
mov [myvar], rax
ret
它在带有 SIGSEGV 的 move [myvar], rax 行上崩溃。我只是想在那个地址存储一些零。
谢谢!
PS:在 Windows 10 64 位上使用 SASM 构建/运行/调试并勾选 64 位选项(否则为默认设置)。
【问题讨论】:
标签: memory segmentation-fault nasm cpu-registers mov