





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
Lab 6 of ece 331 spring 2009 course, which focuses on assembly language programming and monitor-level debugging using the axiom manufacturing cml12s-dp256 development board for the motorola 68hc12 microcontroller. Students will learn the process of writing, assembling, downloading, and debugging assembly language programs. The lab covers the use of the mon12 monitor program and the cml12s-dp256 development board.
Typology: Lab Reports
1 / 9
This page cannot be seen from the preview
Don't miss anything!






Lab 6: Assembly Language Programming and Monitor-level Debugging
Summary: Demonstrate the process of writing, assembling, downloading, and monitor-level debugging of assembly language programs using the Axiom Manufacturing CML12S-DP development board for the Motorola 68HC12 microcontroller.
Learning Objectives:
Resources and Supplies:
Important Reminders:
Background:
CML12S-DP256 development board Axiom’s CML12S-DP256 is a development board for the Motorola MC6S12DP microcontroller which is a configuration of the 68HCS12 core with memory and I/O. The CML12S-DP256 and associated software, particularly the MON12 embedded firmware monitor program, provide a user interface to the microcontroller useful to debugging code and testing microcontroller hardware functions. Assembled code in .S19 files can be loaded to the controller through the MON12 program. Additional details can be found as needed in the CML12S-DP256 MON12 manual.
The CML12S-DP256 provides a debug mode in which the debugger software (e.g., MON12) handles CPU initialization, interrupt vectors, and the stack. The memory map for the CML12S-DP256 is shown on page 11 of the manual. The manual suggest using external RAM starting at $4000 for storing user program code in the debug mode of operation. It is suggested that program data be stored in internal RAM between $1000 and $3DFF The MON12 debugger reserves the remaining part of internal RAM between $3E and $3FFD and starts the stack at $3F80.
Determinants
A 2 x 2 matrix m is typically represented like: (^) ⎥. ⎦
⎤ ⎢ ⎣
21 22
11 12 m m
m m m
The determinant of matrix m is computed by det ( m )= m 11 .m 22 -m 21 .m 12. The following assembly/machine language program will calculate the determinant of a 2 x 2 matrix m consisting of 8-bit 2’s complement entries. The program starts from memory location $4000, and the matrix is assumed to be stored in memory locations $1001, $1002, $1003, $1004. A MON12 debugger command, MM (modify memory), can be used to enter matrix data into data memory. Page 10 of the manual lists the MON12 commands.
ORG $ 4000 b6 10 02 LDAA $ 4003 f6 10 03 LDAB $ 4006 12 MUL 4007 7b 10 ff STAB $10FF 400a b6 10 01 LDAA $ 400d f6 10 04 LDAB $ 4010 12 MUL 4011 f0 10 ff SUBB $10FF 4014 7b 10 ff STAB $10FF END
Pre-lab Assignment:
Laboratory Assignment: This lab consists of two parts. A check-off sheet is included at the end of this lab document.
Part 1: Entering, running, and debugging machine language programs. Preparation:
would like to stop execution and observe results. Use the ‘Set/Display user breakpoints’ command ( BR ) to set a breakpoint at address $4017.
Part 2: Assembly Language Programs: Editing, assembling, and removal of syntax errors.
;program code for Lab 6, part 2 org $ ldab #count ldaa #num more adda #num staa result decb bne more swi count equ $ num1 equ $ result rmb $ end Preparation:
stored off of the lab PC’s hard drive. You are responsible for saving all of your programs, and they may get erased from the lab computers. Using any text editor, enter the program above and save it as a .asm file in the directory you just created. Follow the syntax rules for entering assembly code.
Testing:
Due: At the beginning of lab.
Student Name: ___________________________ Lab. Section (time): __________
Make sure you read the lab document before you start the pre-lab, especially the Background section.
a) (^) ⎥ ⎦
b) (^) ⎥ ⎦
c) (^) ⎥ ⎦
d) (^) ⎥ ⎦
b. What is the expected output of the program
Student Name: ___________________________ Lab. Section (time): __________
Complete this sheet as you complete the lab. Remember to have the TA check off each section of the assignment. This sheet must be included in your lab report.
Part 1: Entering, running, and debugging machine language programs
Step 5. The contents of memory in addresses $4000______ $4001______ $4002______ $4003______
Step 10. Record the determinant det(m) = ______ Does the result agree with the expected? Yes or no and if no why?
Step 15. Record the determinant det(m) = ______ Does the result agree with the expected? Yes or no and if no why?
Step 16. Record the determinants det(m) = ______ Does the result agree with the expected? Yes or no and if no why?
Step 17. Record the determinants det(m) = ______ Does the result agree with the expected? Yes or no and if no why?
Part 1: TA sign off Part 1: Entering, running, and debugging machine language programs. Initial________