ASM编译问题 [英] asm compile issue
问题描述
:96: Error: `(%rax,%edx,4)' is not a valid base/index expression
:97: Error: `-4(%rax,%edx,4)' is not a valid base/index expression
101: Error: `(%rax,%edx,4)' is not a valid base/index expression
102: Error: `-4(%rax,%edx,4)' is not a valid base/index expression
我得到这些错误消息不知道如何解决它,这是我的code
i get these error messages not sure how to fix it this is my code
"movl $0, %6\n"
line96 "start: \n\t"
line97 "movl (%1,%3,4),%4\n\t"
"movl -4(%1, %3, 4), %5\n\t"
"cmpl %4, %5\n\t"
line 101 "jle next\n\t"
line102 xchgl %4, %5\n\t"
"movl %4, (%1, %3, 4)\n\t"
"movl %5, -4(%1, %3, 4)\n\t"
"movl $1, %6\n\t"
...我的code是长,所以我没有要发布整个code,但我在做ASM冒泡排序,,我编译时出现上述错误信息不太清楚如何解决它......如果任何人能对什么是错,将有助于解释..感谢..对不起,如果格式是有点乱糟糟的是新来这个..
... my code is long so i did not want to post the whole code but i am doing a bubble sort in asm ,, when i compile i get the above error messages am not quite sure how to fix it ... if any one could explain to what is wrong will be helpful .. thanks .. sorry if the format is a bit untidy am new to this ..
推荐答案
您已经错误地使用间接寻址。
You've incorrectly use indirect addressing.
这是错误地使用斧头:DX对同排量基地指针。参阅这并的这个的例子。
It is incorrectly use ax:dx pair as base pointers with displacement. Refer to this and this for examples.
这篇关于ASM编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!