Re: examples of arm assem.

May 13, 2021 8 Replies



> Anyone know where on the internet files of programs, or portions
> of such, written an Arm assembley can be found? I'm in need
> of examples of arm assembly to serve as test code for a just
> written assembler.

ARM has at least 4 instruction sets:


  1. The classic 32-bit ISA (32-bit instructions operating on 32 bit data)
  2. Thumb compressed 16-bit instructions (operating on 32 bit data)
  3. Thumb-2 compressed 16-bit instructions (not strictly a separate ISA but a way to mix #1 and #2 in a single instruction stream)
  4. AArch64 32-bit wide instructions operating on 64-bit data (completely different from all the above)

There are then classic ARM 32-bit mnemonics, Thumb mnemonics and UAL 'unified assembly language' intend to cover both with one syntax.



Plus armasm and gas have different ways of writing assembly code.


Choose your poison...



Theo


Good point about the different instruction sets !

I just use the regular Cortex M3 M4 and old non Cortex M versions myself.

I get comfused on the actual "versions" or ARM code though...

I used the older NXP/Philips parts with no Cortex M, the LPC2368 series. Not sure if that is V4 or V7 ? Or something else ?

boB

It's unclear whether his tool targets one dialect, all, or can be commanded (command line switch) to address a specific one.

One assumes that having the knowledge to craft such a tool would imply knowledge of the problem he's solving! (?)

Bob - I'm not too sure either. I'll probably find out though. The version 7 arckitecture reference is the current source.

Hul

boB wrote:

Don, the objective is a small assembler for in-house use and to be included with some equipment with arm processors. Some list files for checking the immediate and branching calculations and placements would be handy.

Hul

D> > Hul Tytus wrote:

You didn't really clarify your requirements, but I'll point you at one big 'classic' 32-bit ARM codebase:

formatting link

specifically

formatting link

This is targeting the assembly format used by armasm (using an older fork of that called objasm). Newer parts are in C but you can find lots of assembly in the 's' folders.

There's no Thumb and little VFP or NEON, but some FPA (the original 1980s ARM FPU). There's substantial use of macros as well.

Theo

Thanks Theo. The thumb (1 and/or 2) codes are needed though.

Hul

Theo wrote:

Jonathon - I'm in the testing phase now but, thankfully, strictly 32 bit code. One trick I've found that's been helpful is "fasmarm", which is an offshoot of a 386 et.al. assembler. The name is, if memory serves, flat assembler or fasm. I've got it on a Microsoft xp msdos directory. The fasmarm handles the 64 bit codes which might make it useful for you.

Hul

J> > Anyone know where on the internet files of programs, or portions

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required