将文本发送到具有变量的存储空间的文件

发布于 2025-02-02 11:44:43 字数 574 浏览 2 评论 0原文

当我尝试将文本发送到文件时,所有内容都可以正常工作,但是当我更改“ _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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文