I need to learn ARM assembly, and I use Linux.
http://ubuntuforums.org/archive/index.php/t-2010979.html
阅读(519) | 评论(0) | 转发(0) |
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
View Full Version : [SOLVED] ARM assembly under Linux
chuchi
June 26th, 2012, 04:53 PM
Hi there!!
I need to learn ARM assembly, and I use Linux. Please, could you give me any starting point about how to install it?? I do not pretend that you teach me ARM assembly. Just a link.
thank you very much!!!
I need to learn ARM assembly, and I use Linux. Please, could you give me any starting point about how to install it?? I do not pretend that you teach me ARM assembly. Just a link.
thank you very much!!!
youknowme
June 27th, 2012, 05:03 AM
Hi there!!
I need to learn ARM assembly, and I use Linux. Please, could you give me any starting point about how to install it?? I do not pretend that you teach me ARM assembly. Just a link.
thank you very much!!!
This might be useful to start you off
http://www.coranac.com/tonc/text/asm.htm
I need to learn ARM assembly, and I use Linux. Please, could you give me any starting point about how to install it?? I do not pretend that you teach me ARM assembly. Just a link.
thank you very much!!!
This might be useful to start you off
http://www.coranac.com/tonc/text/asm.htm
SevenMachines
June 27th, 2012, 08:11 AM
Been
a year or so, but i think this works? Although personally I recommend
setting up a chroot or pbuilder arm environment, its less hassle with
more complicated programs, or at least was in my previous experience.
cat hello.s
.data
msg:
.ascii "Hello, ARM World!\n"
len = . - msg
.text
.globl _start
_start:
/* write syscall */
mov %r0, 4
swi 0
mov %r7, 0
arm-linux-gnueabi-ld -o hello hello.o
./hello
Hello, ARM World!
cat hello.s
.data
msg:
.ascii "Hello, ARM World!\n"
len = . - msg
.text
.globl _start
_start:
/* write syscall */
mov %r0, 4
swi 0
mov %r7, 0
arm-linux-gnueabi-ld -o hello hello.o
./hello
Hello, ARM World!
chuchi
June 27th, 2012, 06:35 PM
Hi!!
thank you very much for reply. But that type of instructions is of the
form: Mov source,dest. The syntax instructions on ARM is : Mov
dest,source. This is what I need
Thank you very much!
Thank you very much!
chuchi
June 27th, 2012, 06:49 PM
Ok I was wrong, your code is right!! I am very sorry!!
Everything is ok, except when I type ./hello I get
bash: ./hello: cannot execute binary file
Why??
Thank you very much!
Everything is ok, except when I type ./hello I get
bash: ./hello: cannot execute binary file
Why??
Thank you very much!
SevenMachines
June 27th, 2012, 07:17 PM
Yes. its just at&t syntax versus intel.
Sorry, obviously the binary is arm and not x86 so wont run, I just forgot I had qemu emulation enabled. Try,
sudo apt-get install qemu-user-static
$ ./hello
Hello, ARM World!
Sorry, obviously the binary is arm and not x86 so wont run, I just forgot I had qemu emulation enabled. Try,
sudo apt-get install qemu-user-static
$ ./hello
Hello, ARM World!
chuchi
June 27th, 2012, 07:25 PM
HI!! now it works!! thank you very very much!!
chuchi
June 28th, 2012, 09:48 AM
Hi again!!
Do you know any way of debugging in qemu?
Surfing the net they say you have to install and configure a new kernel. Is there any other way??
thank you very much!!
Do you know any way of debugging in qemu?
Surfing the net they say you have to install and configure a new kernel. Is there any other way??
thank you very much!!
SevenMachines
June 28th, 2012, 11:21 PM
You can set qemu to wait on a gdb connection
# In a terminal
sudo apt-get install gdb-multiarch
Then start gdb-multiarch, load symbols, and connect gdb to qemu, eg
1
14 ldr %r1, =msg
15 ldr %r2, =len
16 mov %r7, 0
(gdb) b 16
Breakpoint 1 at 0x8080: file hello.s, line 16.
(gdb) target remote :10101
Remote debugging using :10101
[New Remote target]
[Switching to Remote target]
_start () at hello.s:13
13 mov %r0, 4
(gdb) n
17 swi 0
(gdb) c
Continuing.
[Inferior 1 (Remote target) exited normally]
[EDIT] You'll want debugging information ie
$ arm-linux-gnueabi-as -gstabs -o hello.o hello.s
# In a terminal
sudo apt-get install gdb-multiarch
Then start gdb-multiarch, load symbols, and connect gdb to qemu, eg
1
14 ldr %r1, =msg
15 ldr %r2, =len
16 mov %r7, 0
(gdb) b 16
Breakpoint 1 at 0x8080: file hello.s, line 16.
(gdb) target remote :10101
Remote debugging using :10101
[New Remote target]
[Switching to Remote target]
_start () at hello.s:13
13 mov %r0, 4
(gdb) n
17 swi 0
(gdb) c
Continuing.
[Inferior 1 (Remote target) exited normally]
[EDIT] You'll want debugging information ie
$ arm-linux-gnueabi-as -gstabs -o hello.o hello.s
相关热门文章
给主人留下些什么吧!~~
评论热议
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通