


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions for assembling and debugging assembly language programs using miniide, a windows-based development tool. Students will learn the layout and structure of assembly programs and how to load, run, and debug them using miniide. The lab covers creating a new project, writing and saving the source code, assembling the code, and running the program step-by-step using the d-bug12 monitor.
Typology: Lab Reports
1 / 4
This page cannot be seen from the preview
Don't miss anything!



The purpose of this lab is to introduce you to the layout and structure of assembly language programs and their format, as well as to the use of the MiniIDE development tool. You will write your own programs later on in the semester with similar structure.
In the following example source code, 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.
MiniIDE (available on the Huang book CD) is a windows based program, which allows assembly programmer to assemble, debug, and download a program onto the 68HC12 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 understand and remember all the steps to download and debug programs in future labs.
After logon in the CadLab, click on the start menu as follows: Start Æ Programs Æ Programming Æ MiniIDE Æ MiniIDE
;--------------------------------------- ;Lab# ;Assemble and Trace ;(Put your name and date here) ;--------------------------------------- org $900 ;Memory data starts at address hex 900 num_1 dc.b $6C ;Define Constant Byte with value hex 6C stored ; in memory at label num_ num_2 ds.b 1 ;Define Storage Byte to reserve ONE Memory Byte ; at label num_
data1 equ num_1 ;Symbol data1 equals hex 900 num equ $72 ;Symbol num equals hex 72
org $800 ;Start at memory location hex 800 LDAA #num ;Load the value of label NUM into Accumulator A LDX #data1 ;Load register X with the value of symbol data LDAB $0,X ;Load Accumulator B with content of memory ; location pointed to by register X plus 0 STAB num_2 ;Store the content of Accumulator B into mem num_ STAA num_1 ;Store the content of Accumulator A into mem num_ ABA ;Add the content of A & B and store result in A LDX #255 ;Load reg X with decimal value 255 (IMM addr) EXG D,X ;Exchange registers D and X SWI ;Software Interrupt Command. Makes ; Microcontroller Stop executing
Now you have assembled the program and created a lab1.s19 file (machine or object code) and a lab1.lst file (source/object listing). These files are located in the same directory as your Lab1.asm file. The object code is what you will download onto the 68HC12 board’s memory next. The listing file is a text file that is helpful in debugging the program.
_Approved: Lab TA _____________________ Date _____________
Perform Lab Exercises L3.1 through L3.4 in Huang and show to the Lab TA.
_Approved: Lab TA _____________________ Date _____________