SFU - CMPT 150 - Labs - 7

SFU - CMPT 150 - Labs - 7 - c A.H.Dixon Laboratory Exercise...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: c A.H.Dixon Laboratory Exercise 7 1 ASSEMBLY LANGUAGE PROGRAMMING 1. Launch CodeWarrior by clicking on the CodeWarrior IDE icon. 2. Open the file “main.asm” and enter the following program exactly as indicated. The second column is two tab positions to the right, and the third column is one further tab position to the right: (a) In the “Data Declarations” area place the following declarations: C1 dc.b ’C’ C2 dc.b ’M’ C3 dc.b ’P’ C4 dc.b ’T’ displ dc.b 32 A “space” has been deliberately placed before the label displ . (b) In the “Main Program” area place the following instructions: ldaa C0 adda displ staa C1 ldxx C2 adda displ staa C2 ldaa C3 adda displ staa C3 ldaa C4 adda displ staa C4 3. Attempt to assemble this program. If there are any syntax errors the simulator will not open. Instead a window will open titled “Errors & Warnings”. A message may be displayed and that part of your program where the error occurred will be displayed. The instruction in question will be flagged with a red “arrow” to the left of the line that includes the instruction. 4. The declaration for displ should be flagged. This is because all the labels of a program (i.e., C1 , C2 , C3 , C4 , and displ ) must begin in the leftmost position of the line; that is, there should be no blank characters preceding these labels. Fix this instruction by removing the blank that precedes ” displ ”....
View Full Document

This note was uploaded on 06/20/2010 for the course CMPT 150 taught by Professor Dr.anthonydixon during the Spring '08 term at Simon Fraser.

Page1 / 3

SFU - CMPT 150 - Labs - 7 - c A.H.Dixon Laboratory Exercise...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online