如何在x86中进行反向偏移/索引

问题描述

我正在尝试为内存寻址设置负偏移量。这是为了将数字转换为字符串,并确保它不会以相反的顺序打印,因为x86的格式是little endian。这是我想要做的:

 # (b) move the asci number to rbp-8-len (to print in reverse)
 movb %al,-8(%rbp,%r12,-1)

我知道-1的大小无效,但是我已经在上面从概念上展示了我正在尝试做的事情。正确的方法是什么?


目前,我正在这样做:

# (b) move the asci number to rbp-8-len (to print in reverse)
# store offset (8+len) in %r13
mov $-8,%r13
sub %r12,%r13
movb %dl,(%rbp,%r13)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)