将文本发送到具有变量的存储空间的文件
当我尝试将文本发送到文件时,所有内容都可以正常工作,但是当我更改“ _edit”中的rdx的数字4时,对于具有相同值的变量“计数”,而不是将文本发送给文件时,通过Linux终端将其发送给我。
section .data
file db "2file.asm", 0
hola db 'hola'
counter db 0
section .bss
idfile resd 1
section .text
global _start
_start:
mov rax, 5
mov rbx, file
mov rcx, 0002h
int 0x80
cmp rax, 0
jl _finalize
mov [idfile], rax
_edit:
mov qword[counter], 4
mov rax, 4
mov rbx, [idfile]
mov rcx, hola
mov rdx, counter
int 0x80
_finalize:
mov rax, 1
mov rbx, 0
int 0x80
When I try to send the text to a file everything works correctly, but when I change the number 4 of RDX in "_edit", for the variable "counter" with the same value, instead of sending me the text to a file, it sends it to me through the linux terminal.
section .data
file db "2file.asm", 0
hola db 'hola'
counter db 0
section .bss
idfile resd 1
section .text
global _start
_start:
mov rax, 5
mov rbx, file
mov rcx, 0002h
int 0x80
cmp rax, 0
jl _finalize
mov [idfile], rax
_edit:
mov qword[counter], 4
mov rax, 4
mov rbx, [idfile]
mov rcx, hola
mov rdx, counter
int 0x80
_finalize:
mov rax, 1
mov rbx, 0
int 0x80
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论