gpt4 book ai didi

linux - 在汇编中,如何存储 scanf 调用的输入?

转载 作者:太空宇宙 更新时间:2023-11-04 05:08:58 26 4
gpt4 key购买 nike

input: .asciz "%ld"...

subq $8, %rsp
eaq -8(%rbp), %rsi
movq $input, %rdi
movq $0, %rax
call scanf

我想存储 scanf 给出的输入并修改它,然后使用

打印它
call printf

我该如何解决这个问题?

最佳答案

您可以将输入存储在leaq -8(%rbp), %rsi处,然后打印出值

leaq -8(%rbp), %rsi
pushl %rsi // or %rdi if i'm wrong
pushl $input
call printf

我认为eaq的意思是leaq

关于linux - 在汇编中,如何存储 scanf 调用的输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57981333/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com