从 C 到 UAL 汇编的 UAL 汇编
给定 C 代码,在 UAL 汇编中重写以下程序。假设gcd() 和 print() 是计算最大公约数的符合 ABI 的函数 并分别打印变量。确保注释你的汇编代码,
int main() {
uint32_t a=0x5, b, i;
b = 4*a;
while(i<10) {
b = gcd(a, b);
i++;
}
print(b);
}
这是我正在尝试做的预实验......谢谢
Rewrite the following program in UAL assembly, given its C code. Assume that gcd()
and print() are ABI compliant functions that calculate the greatest common divider
and print the variable respectively. Make sure to annotate your assembly code
int main() {
uint32_t a=0x5, b, i;
b = 4*a;
while(i<10) {
b = gcd(a, b);
i++;
}
print(b);
}
this is for a pre-lab that i am trying to do ... thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来不像预实验。然而,它看起来确实像嵌入式系统中刚刚分配的问题 1(值 20 分)。你应该花时间学习汇编和 C 语言中的同等内容。否则你在课堂上会很吃力,因为 Stack Overflow 不会在你即将到来的考试中帮助你......如果你在汇编方面遇到问题,请加入一个学习小组,那里有班上的其他学生正在处理与您相同的问题。实验室里几乎总是有学生。
另外,UAL 是 ARM 汇编语法,请参阅链接:
http://infocenter.arm.com/help/index .jsp?topic=/com.arm.doc.dui0473c/BABJIHGJ.html
This does not look like a prelab. It does however look like problem 1 (worth 20 points) that was just assigned in Embedded Systems. You should take the time to learn assembly and the equivalent in C. You will struggle in the class otherwise, since Stack Overflow wont help you on your upcoming exam.... Join a study group if you are having problems with assembly, there are other student in the class dealing with the same issues as you. There is almost always students in the lab as well.
Also, UAL is a ARM Assembly syntax see link:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/BABJIHGJ.html