0
votes

I'm looking for assembler examples for ARM. I'm in need of ARM assembly for copy routines (32, 16, and 8 bit) and memset routines (32, 16, and 8 bit) specifically for now. I'm not having much luck with Google, sf.net, Google code, or github. Anyone have anything like this laying around, or know where I can look?

I know I just need to buy a book on ARM assembler, but thought I would start with these. Any tips on how I can accomplish writing these routines myself are appreciated as well.

Edit: Oh yes, the documentation at arm.com really helps. This page alone tells me a lot about mem* functions. http://infocenter.arm.com/help/topic/com.arm.doc.faqs/ka3934.html

Thanks for all the suggestions.

3
The arm arm, arm architectural reference manuals are available for free from arm. infocenter.arm.com Architectural Reference then figure out what family you want. I have lots of mixed C and asm github.com/dwelch67 on arm platforms, some thumb some ARM. I s this a homework assignment? You want to look at the ldm/stm instructions. typical arm copy, etc routines use ldm or stm or both four registers at a time. Depending on the chip aligning on 64 bit boundaries are better (if it has a 64 bus internally)old_timer
the fastest routines will be found in C libraries, look at the gnu sources like gcc, or just do a memset in C using a C compiler then disassemble.old_timer
This is not for homework. I'm working on a music visualization app for Android. Anyway, I just found this page. It covers 3 memcpy algorithms in detail. eetimes.com/design/embedded/4024961/…Scott
I looked at the other page similar to this, but it wasn't very helpful.Scott

3 Answers

1
votes

Several suggestions:

... AND ...

  • Install a Gnu CC ARM cross-compiler, and run "gcc -S" to get assembler output from your C programs
1
votes

You could disassemble some iphone, android or windows mobile binaries.

In arm libraries you will usually find quite large optimized versions of memcpy, where depending on the lowest 2 bits of source and destination a different method of copying is used.

I uploaded a disassembly of the htc herald bootloader here: http://nah6.com/~itsme/spl-5.04.0000.lst.gz

btw, no need to buy a book, ARM has put everything online: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0100i/index.html

0
votes

If you want to study highly optimized arm assembly memcpy and memset routines, I would recommend downloading the linux kernel source or the android source (the bionic part). They may be slighly hard to study, but you will learn a lot about writing REALLY optimized arm assembly code.