![]() |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
It is very easy.
- Just install Binutils in N900 - Open texteditor (I use nano) and write code - Assemble with as-command - Link with ld-command - set execute rights with chmod - run (remember put ./ before your program name) But I have question why mov r7,#4 looks with hexeditor like this: hex 0407A0E3=bin 0000 0100 0000 0111 1010 0000 1110 0001 but If I look ARM instructions manual, it should look like 1111 0i10 0100 imm4 0imm3 Rd imm8 or 1111 0i00 010s 1111 0imm3 Rd imm8? And why there is in executable file 74 bytes before first command come? And lot bytes after commands and data? |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
@teroyk,
Normally executable programs have a format. Linux uses ELF. |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
Quote:
http://www.kernel.org/doc/man-pages/...an5/elf.5.html |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
Quote:
So there's no way a human could possibly beat a good compiler (and we have good compilers) in optimizing code. I also used to hand-optimize my programs (mostly 286 and 486). I stopped with the first Pentium. Quote:
Quote:
Most (all?) services and daemons running in your N900 are also open-source. Quote:
|
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
+1
I also stopped doing hand-optimized assembler code with 486. With one exception - stupid M$ compiler did't optimize well for Duron's pipelines, so I hand-optimized some mmx code (video decoder), but that was just an exception. Using assembler makes absolutely no sense for general programming, especially now we have gcc 4.7.X. You may use assembler for some specific piece of code, but still, you won't beat compiler if you don't have a sh*tload of emulators, so you can trace pipelines, branches, caches, instruction dependencies, whatnot. @Reinob - "smooth transitions" falls in the same category as "ecosystem" if you ask me :D |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
S0urcerr0r, take a look at asm source of my elf:
https://dl.dropbox.com/u/28532483/lo...mpress.v.1.1.s And the same, but some updated at C: https://dl.dropbox.com/u/28532483/lo...ress.v.1.2.cpp Asm source can be compiled with: Code:
gcc logo_compress.v.1.1.s -o logo_compress.elf |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
ELF is actually ARMs executable and linkable file.
it's not just for linux, elfs can be loaded with symbian and with WinCE oses too. FASMARM is one great assembler and it's opesource so it can be tweaked up too. i think that writing includes for both maemo5 and maemo6 shouldn't be so hard. i will try to do some contribution for harmattan at least +1 for this thread |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
@wook_sf,
ELF existed before ARM. It's used by most Linux/Unix operating systems, and is architecture-independent, meaning it can be used for x86, ARM, or whatever. Originally it was used for x86. AFAIK Symbian used an ELF-like (or ELF-derived) format, but not quite ELF. I'm not aware of any Windows (CE or not) versions using ELF natively. Windows (including CE) uses PE (portable executable). |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
Quote:
ELF is officially supported by arm and that format is used for this processor. there was one really really good book about arm asm that explains lot about assembly, in my opinion far better for students than any other book i've read :D and i will try to link it here. about symbian - i wasn't talking about EPOC, but about ELF ;) basicly, elfs should be runnable on every arm machine :) |
Re: [ASSEMBLER] How easy is it to get started asm coding on Maemo5?
@wook_sf,
OK, this is getting off-topic, but: PE does not and cannot have an ELF header. PE is a different format than ELF. An ARM processor can run ARM instructions. The format of the executable file is of no concern for the processor, but for the operating system (dynamic linker), which needs to be able to identify the code sections so that they can be executed by the processor. Symbian uses the E32Image format. During compilation with the standard tools a PE or ELF executable is generated. This executable must be then converted to E32Image so that Symbian can use it. (see http://www.antonypranata.com/node/9). As for "ELFs should be runnable on every arm machine". The statement is obviously true, as long as the operating system can make sense of (use the) ELF format. That's like saying "ZIPs should be extractable on every ARM machine". Yes, but you need the unzip tool for that machine. Same as x86, mips or any other CPU architecture. Now we can go back on-topic :) .. unless, that is, you have some references supporting your assertions.. :) |
All times are GMT. The time now is 15:47. |
vBulletin® Version 3.8.8