CS-280 Lab 1: Assembler Introduction

Overview

The purpose of this lab is to acquaint you with the embedded software development tools that you will be using throughout the quarter. You may work in pairs and submit a group report.

Lab activity

In this lab, you will assemble, link, simulate, download, and run a program.

Begin by getting the assembly source file from this web site: lab1.s. The .s filename extension signifies human-readable assembly language.

Tools

Since you will need them for this and future labs, install the tools available from the tools page. Skip section V, since it applies to the MSOE briefcase, which we are not using.

Next, assemble the program from a command prompt (be sure to see the tools page for instructions on how to open a properly configured command prompt window) by entering:
as -o lab1.o lab1.s

The options (text that follows the “as” assembler command) tell the assembler to:

The following commands will tell you some interesting information about the object file. You don’t need to know what all of this means yet, but be sure the examine the output to see what you can learn. Check with your instructor if you have any questions.

Next, run the linker with the command:
ld -T ../fox11w.x -o lab1.elf lab1.o

The options mean:

fox11w.x sets up memory as follows…

Create a human-readable listing of your ELF executable with the command
objdump -d lab1.elf > lab1.rst

Question: Where does the data area end up? (Hint: Inspect the .rst file and see if you can figure this out – feel free to ask the professor for help.)

Create an S19 format executable for use by Wookie and WBUG11. S19 is a simple format that specifies which values to store at which addresses and little else. It is not easy for a human to read (take a look and ask your instructor if you are curious about the details), but is conveniently formatted for loading into the HC11’s memory by a program like WBUG11.

objcopy -O srec lab1.elf lab1.s19

Now you are ready to use the executable (lab1.s19). Run the executable on both the Wookie Simulator and the actual Fox11 hardware.

Wookie

Skim Dr. Sebern’s Introduction to the Wookie 68HC11 Simulator.

Fox11 (hardware)

Report (due by the beginning of the week 2 lab)

Be sure that you answer the following questions in your report. Find the answers in your .rst file and by inspecting memory in Wookie and/or your Fox11 via AsmIDE/WBUG11.