



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
Material Type: Lab; Professor: He; Class: Microcomputer Systems; Subject: ECE Elect & Computer Engr; University: Tennessee Tech University; Term: Fall 2008;
Typology: Lab Reports
1 / 5
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. 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.
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!!
Type the following program into the edit window
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"
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 ____________
Comment the print-out to indicate what each portion is displaying