Companion CD-ROM: examples/intro directory

The examples/intro directory contains sample files that you can use to learn about the GNU Assembler and the GNU Debugger. You should look at these files in conjunction with reading [PDF] An Introduction to the GNU Assembler and [PDF] An Introduction to the GNU Debugger. Please note that you will need to have Adobe Acrobat Reader (or another PDF viewer) installed on your computer to read these documents.

Using the Introductory Files

You use the files in this directory by reading through each of them in the order presented below (in the Directory Contents section), then copying the files into your own directory, compiling them and running them through the GNU Debugger. You would do this by typing something like the following at the Linux shell prompt:

mkdir ~/intro # Create a directory to hold the files
cp /mnt/cdrom/examples/intro/* ~/intro # Copy all of the files from the CD-ROM
cd ~/intro # Change to the new directory
chmod 644 * # Make all of the files read/writable
make all # Create the executable files
arm-elf-insight simple.elf & # Use the GNU Debugger to run "simple.elf"
…and so on.

Please note that the “$” indicates the Linux shell prompt: you don’t type it in. This set of commands also assumes that you have already mounted this CD-ROM on your computer, and that the mount point (where the CD-ROM can be found within the file system) is /mnt/cdrom; see the instructions for mounting the CD-ROM for more details.

Directory Contents

[Root] CD-ROM Root Directory
[Dir] examples: Example files and templates
[Dir] intro: Sample projects used in the introductions to the assembler and debugger   This is the current directory
[File] README.html: The file you are currently reading
[File] Makefile: Makefile for the Introductory files
[File] simple.s: A simple ARM assembly language program
[File] subr.s: Simple subroutines (function calls)
[File] values.s: Load constant values into registers, with ldr =
[File] pseudo.s: More information about pseudo-instructions for the ARM
[File] jumptbl.s: Multi-way branches and pointers to functions
[File] wordcopy.s: Copy an array of words stored in the .data section
[File] blockcopy.s: Copy an array en-masse, with stack pointer initialisation
[File] copy.s: Copy a NUL-terminated string to a buffer (assembler module)
[File] strcopy-a.s: String copy using multiple source files, using copy.s
[File] strcopy-c.c: Mixing C and assembler for string copy, using copy.s