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

问题描述 投票:-1回答:1
input: .asciz "%ld"...

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

我想存储从scanf给定的输入并进行修改,然后使用]打印它>

call printf

我该如何解决这个问题?

input:.asciz“%ld” ... subq $ 8,%rsp eaq -8(%rbp),%rsi movq $ input,%rdi movq $ 0,%rax call scanf我想存储从给出的输入scanf并对其进行修改,然后使用调用printf ...

linux assembly att
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.