Assembly Programming with Miniide - Laboratory 1 | ECE 3120, Lab Reports of Microcomputers

Material Type: Lab; Professor: He; Class: Microcomputer Systems; Subject: ECE Elect & Computer Engr; University: Tennessee Tech University; Term: Fall 2008;

Typology: Lab Reports

Pre 2010

Uploaded on 07/30/2009

koofers-user-3d1
koofers-user-3d1 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECEโ€3120๎˜ƒ๎˜ƒ
Fall๎˜ƒ2008๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒ๎˜ƒPage๎˜ƒ1๎˜ƒ
L A B 1 โ€“ Introduction
ASSEMBLY PROGRAMMING WITH MINIIDE
The purpose of this lab is to introduce you to the layout and structure of Assembly
Language programs and their format. You will write your own programs later on in the semester
with similar structure. All code should be capitalized. Comments should not be capitalized.
From left to right, you will notice four columns. The first column contains label names.
The second column contains instruction/assembler keywords. The third column contains data or
operands. The fourth column is used for comments. Your programs should always be in this
format.
INTRODUCTION TO MiniIDE
MiniIDE is a windows based program, which allows assembly programmer to assemble,
debug, and download a program onto the 68HCS12 board. This lab familiarizes the student with
all the steps involved in loading, running, and debugging assembly language programs using
MiniIDE. The student will be required to remember all the steps to load programs in future labs.
Please use your U: drive for all your lab work.
READ ALL INSTRUCTIONS CAREFULLY!!
PROCEDURE:
I) USING MINIIDE
1. Start โ†’ All Programs โ†’ Engineering โ†’ ECE CAD Lab โ†’ MGTEK MiniIDE
2. Click on the File โ†’ New. This is where you will write your program.
Type the following program into the edit window
pf3
pf4
pf5

Partial preview of the text

Download Assembly Programming with Miniide - Laboratory 1 | ECE 3120 and more Lab Reports Microcomputers in PDF only on Docsity!

L A B 1 โ€“ Introduction

A S S E M B L Y P R O G R A M M I N G W I T H M I N I I D E

The purpose of this lab is to introduce you to the layout and structure of Assembly Language programs and their format. You will write your own programs later on in the semester with similar structure. All code should be capitalized. Comments should not be capitalized.

From left to right, you will notice four columns. The first column contains label names. The second column contains instruction/assembler keywords. The third column contains data or operands. The fourth column is used for comments. Your programs should always be in this format.

I N T R O D U C T I O N T O MiniIDE

MiniIDE is a windows based program, which allows assembly programmer to assemble, debug, and download a program onto the 68HCS12 board. This lab familiarizes the student with all the steps involved in loading, running, and debugging assembly language programs using MiniIDE. The student will be required to remember all the steps to load programs in future labs.

Please use your U: drive for all your lab work.

READ ALL INSTRUCTIONS CAREFULLY!!

P R O C E D U R E :

I) USING MINIIDE

  1. Start โ†’ All Programs โ†’ Engineering โ†’ ECE CAD Lab โ†’ MGTEK MiniIDE
  2. Click on the File โ†’ New. This is where you will write your program.

Type the following program into the edit window


  • LAB1.ASM Student Name*
  • Introduction *

DATA EQU $2100 ;label Data equals hex 2100 NUM EQU $AC ;label NUM equals hex AC ORG $ NUM_ONE DC.B $8F ;define Constant Byte with label NUM_ONE & ;value hex 8F NUM_TWO RMB 1 ;reserve ONE Memory Byte ORG $2000 ;start at memory location 2000 CLR NUM_TWO ;clear reserved memory location, $ LDAA #NUM ;load the value of label NUM into Accumulator A LDX #DATA ;load register X with the value of label DATA LDAB $0,X ;load Accumulator B with content of memory ;location pointed to by register X incremented ;by 0 (2100) STAB NUM_ONE ;store the content of Accumulator B into ;NUM_ONE STAA NUM_TWO ;store the content of Accumulator A into ;NUM_TWO LDAA #$80 ;load Accumulator A with value $80 (immediate ;addressing mode ABA ;add the content of A & B and store result in A SWI ;Software Interrupt Command. Makes ;microcontroller Stop executing till further ;instructions

II) RUNNING A PROGRAM

1. First, make sure you can communicate with the 68HCS12 board. Go to Terminal โ†’ Optionsโ€ฆ. Here you should see a window that has the COM settings. Make sure the COM port that is selected is COM1. Also, make sure the HCS12 board is plugged in! 2. Hit the RESET button on the 68HCS12 board. This is located in the middle of the bottom edge of the board. You should get the following text in the Terminal Window:

D-Bug12 4.0.0b Copyright 1996 - 2005 Freescale Semiconductor For Commands type "Help"

  1. In the Terminal Window , at the prompt, type LOADโ†’ Enter. The terminal window commands are not case sensitive.
  2. Go to Build --> Build Current
  3. Click the F8 button. A window will pop up. Select the LAB1.s19 file. Click OPEN.

Note: Each memory display line holds the 16 byte block associated with the beginning address. The $2200 block displays $2200 - $220F for example on one line. Using the command md $220A will display the entire 16 byte block associated with it; therefore it will display $2200 - $220F.

3. Now letโ€™s look at modifying memory contents from the terminal window. Type mm 2110 โ†’ Enter.

Make the following addresses hold these values by typing in the value corresponding to the memory location and pressing enter (note that the 20xx will be displayed as a prompt): 2110 86 2111 9A 2112 25. At 2113 type the following: 12 / โ†’ Enter. You will see the results of changing $2113 to 12. Type Enter โ†’ 55 ^ โ†’ Enter โ†’ 44. โ†’ Enter. Lastly, display the memory contents of $2110 using md 2110 and record the final values below (assume these are hex. values): 2110 _____________ 2111 _____________ 2112 _____________ 2113 _____________

4. To modify the registers, type the register name, space, and then the value. Examples below to type are: A: 99 B: EB X: 569A

Approved: Lab TA _____________________ Date ____________

What to turn in during the next lab session

(in this order please with a cover sheet):

  1. A print-out of LAB1.asm and Lab1.lst (*.lst in landscape). Use Programmerโ€™s File Editor available in the Engineering portion of the start menu. DO NOT USE MINI_IDE TO PRINT THE LISTING IN LANDSCAPE! IT WILL TRUNCATE THE FILE.
  2. A print-out from the terminal screen (highlight, type ctrl+c, and paste into MS Word โ€“ use Courier New as the font) that includes the following:
  • Results of entering t
  • Results of Section III, Parts 3 and 4

Comment the print-out to indicate what each portion is displaying

  1. Answers to the following questions about the code:
    • What was the original content of the memory location 2100?
    • What is the final content of memory locations 2100 & 2101? (use md )
    • When you added Accumulator A and B, what was the answer you got? What was the answer supposed to be? Why didnโ€™t you get that answer?