Starting ARM Asm : Part 00

BACK CONTENTS NEXT
Introduction:

Where we Come From To Get Here:

Back in 2012 I had began writing a series of tutorials for ARM assembly Language programming on RISC OS. At that time I was posting each only to a public forum. Do to different opinions from people that do not like Assembly Language an argument insued. I later wrote a more complete series with the intent of posting them to a forum, though when I asked certain questions around this, the feedback was too mixed.

So here we are more than 9 years after those first tutorials were posted, and I still love ARM Assembly Language Programming, and would still like to help others that are interested in this language. Those that were interested in learning ARM Assembly on RISC OS asked me to continue, even back then. I am guessing I was on the correct track to help some, so it is time to begin again

As much as possible the code presented here will run on any RISC OS machine. When there are limits, do to using newer instructions or OS features that are not in earlier versions, etc it will be noted in the text. Most of this should run on an ARMv2 Archimedes on through a ARMv8.1 Raspberry Pi 400, and everything in between.

Originally I was going to modify my existing tutorials to fit this format. I decided instead to write a new series, in the same spirit as what I wrote the others.

Prerequisites:

This tutorial assumes you use RISC OS, and have some experience with programming. It need not be much, so long as you have a grasp of the basic concepts used in programming, such as variables, loops, procedures, arrays, etc.

This will fail you if you have never programmed before. Though it is fun to learn to program in an HLL (like BASIC V, or C), and increases the joy of learning ARM Assembly.

A bit on ARM Asm and How I Teach:

ARM Assembly language is fairly simple, and represents a truly great instruction set. The ARM has 16 user registers, one of which is the program counter (R15), thus reducing the need for strange branching instruction (we can write directly into R15 just like any other). There are almost no restrictions on the usage of registers in the ARM CPU. Do not worry if this is a bit above head at this point, as you go through the series you will learn what all this is.

The particular instruction set that is worked with in these tutorials is the 32-bit instruction set that has been around since 1985 on the ARM, sometimes called AARCH32 to keep it separate from the newer ones. We will cover things that require newer versions of the ARM, though always the 32-bit instruction set encoded in a 32-bit word per instruction.

The ARM has a huge advantage in avoiding unneeded branching, in that almost all ARM instructions are conditional, not just branches like many others. So skipping one instruction conditionally often is more efficient than branching.

I will be teaching by using actual working code, and dissecting that code to explain what is going on in each step of this series. This is the method that I have found most effective to teach Assembly Language to those that are new to it. This also means that every step (except this one) will have working code.

In this series we will be using the Assembler built into BASIC V. This is a much more powerful assembler than many give it credit for being. There will be some examples of how to use asasm (Open Source compatible with objasm).

BACK CONTENTS NEXT

This site created on RISC OS using !Zap and !SrcEdit.
Hosting for this site provided by David F
This page viewable with Any Browser
LAST UPDATED: Nov 10th 2022