最短的 GAS ARM (linux) 程序? [英] Shortest possible GAS ARM (linux) program?

查看:29
本文介绍了最短的 GAS ARM (linux) 程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我萌生了学习汇编语言的念头,并决定尝试一下 ARM.我决定使用 GNU 汇编器,主要是因为它可以在我手机的存储库中找到,这样我就可以在任何地方玩汇编,如果我感到无聊.

I've toyed with the idea of learning an assembly language, and have decided to give ARM a try. I've decided to go with the GNU assembler, mostly because it's available in my cellphone's repository, so that I could play around with assembly anywhere, if I'm bored.

无论如何,我已经在网上搜索过,但找不到任何有关如何正确退出 ARM Linux 二进制文件的参考资料.我了解到 x86 等效项基本上将 eax 寄存器设置为指定系统调用的数字,然后调用系统中断 0x80 以实际执行系统调用,正确退出程序;现在我想为 ARM 做一些类似的事情(显然相同的代码不起作用,因为它使用 x86 特定寄存器等等).

Anyway, I've searched the web, but I can't find any kind of reference for how to properly exit an ARM Linux binary. I've understood that the x86 equivalent basically sets the eax register to a number specifying the system call, and then calls system interrupt 0x80 to actually perform the system call, properly exiting the program; now I want to do something similar for ARM (and obviously the same code doesn't work, since it uses x86 specific registers and whatnot).

所以,是的,基本上,我将如何编写最小的 GAS ARM 可执行文件,只需以退出值 0 正常退出?

So yeah, basically, how would I write a minimal GAS ARM executable, simply exiting normally with exit value 0?

推荐答案

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=3105/4.您还可以查看 http://isec.pl/papers/into_my_arms_dsls.pdf 的第 5 页.

There is some information on system calls at http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=3105/4. You can also look at page 5 of http://isec.pl/papers/into_my_arms_dsls.pdf.

这篇关于最短的 GAS ARM (linux) 程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆