CPTR-215 Assembly Language Programming HW#6 for Monday 10/15/12



If you have not already done so, finish reading chapter 4 of the text. Sections 4.6, 4.7, 4.8, and 4.9 contain information about writing an assembly program and using the development software. Note that we will be using the Keil company's RealView assembler and uVision simulator software and thus you can ignore comments about the IAR development system (section 4.7.3) and the ADS development system (section 4.7.2) and any mention of GNU assembly language. As mentioned earlier, the Keil software is loaded and available on the KRH PC lab computers.

New reading for Monday: chapter 5.

Problem: Write a program what will add the numbers 15 and 32 (base 10) and place the result into register zero and then subract 16 and place the result in register 1. Load 0x0f45 into r2 and then execute the instruction RSB r5,r2, #209. Look at the contents of memory to see the results of these instructions.

You can begin writing your program by using a copy of the shell.s file that I have placed on the class webpage. Copy the program to a folder you wish to use for this lab and change its name from shell to say hw6_name where name is your last name. Place your instructions in the file starting at the label Main.

The principle steps to creating this program are:


When you have finished creating the assembly language program file (i.e. the .s file), assemble the program by doing a Build Target on the Projects tab, start the debugger via the Debug tab, and then single step through the program watching the contents of the registers to see if the program is doing what you expect. For this program the only "output" is looking at the register contents. Print out a copy of your .s file to hand in as homework #6. Write on it the results of your effort and any observations you wish. Fold the printout and put your name etc. on the outside.

Larry Aamodt PhD, PE
Professor of Engineering and Computer Science
Walla Walla College
Contact:
via email: AamoLa (at) wallawalla.edu
via phone: x2058