






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
A lab guide for students to learn 68000 assembly language programming. It includes an introduction to the lab, materials required, a sample problem solution, and procedures for debugging and programming. Students will write, assemble, execute, and debug assembly language programs to solve defined problems.
Typology: Lab Reports
1 / 10
This page cannot be seen from the preview
Don't miss anything!







This lab is an introduction to 68000 assembly language programming. Students will write, assemble, download, execute, debug, and demonstrate assembly language problems that solve specific yet simple programming problems. Concepts from the previous labs are used extensively.
Upon completing this lab, students will be able to do the following:
Prior to the scheduled lab session, read the following chapter from your textbook:
Hardware:
MS-DOS Software:
68000 Programs:
The following programming example demonstrates how problems are stated in this lab.
Problem: Write a 68000 program called EXAMPLE to compute the sum of three 16- bit words of data. The data are stored in memory starting at address $9000, identified by the label NUMBERS. Store the result immediately after the data, in SUM at memory location $9006.
Sample Conditions:
Before:
Address Contents 009000 1234 009002 5678 009004 0ABC 009006 0000
After:
Address Contents 009000 1234 009002 5678 009004 0ABC 009006 7368 Note: $1234 + $5678 + $0ABC = $
Part I: Debugging
Instruction CCR PC Just Finished X N Z V C A0 D0 D
8006
MOVEA.L #NUMBERS,A
Use MON68K's single-step facility (described in lab #3) to verify your work above. If you completed the table without any errors, congratulations: You are ready to undertake problems in assembly language programming. Ask your lab instructor for assistance if you have trouble determining the correct conditions after any instruction.
Problem 2: Write a program called LENSTR to determine the length of a string of characters. The starting address of the string is contained in the 32-bit variable START at location $9000. The end of the string is marked by an ASCII null character. Place the length of the string (excluding the null character) in the variable LENGTH at location $9004.
Sample Conditions:
Before:
Address Contents 009000 0000 009002 9040 009004 5555 009040 4142 009042 4344 009044 4546 009046 4748 009048 00FF
After:
Address Contents 009004 0008
Note: Place the ASCII string in your program by enclosing the characters within single quotes after a DC.B directive.
Problem 3: Write a program called SAME to compare two strings of ASCII characters to see if they are the same. The starting addresses are contained in the longword variables START1 at location $9000 and START2 at location $9004. The first byte of each string contains the string length (in bytes) and is followed by the string. If the two strings match, clear the variable MATCH at location $9008; otherwise set its value to -1.
Sample Conditions:
Before:
Address Contents 009000 0000 009002 9040 009004 0000 009006 9050 009008 5555 009040 0441 009042 4243 009044 44FF 009050 0441 009052 4244 009054 5FDD
After:
009008 FFFF = -1 (Strings are different!)
Note: Test your program with several different string conditions. Place strings in your program in the appropriate way.
Problem 5: Write a program called LOOKUP to convert the contents of the BCD variable DIGIT at location $9000 to a seven-segment code and store it in the variable CODE at location $9001. If DIGIT does not contain a single BCD digit, clear CODE. Assume a standard segment arrangement (e.g., 74LS47) with segment a as bit 0 and segment g as bit 6 (bit 7 = 0, always). This is shown below. Assume a segment is ON for a 1 and OFF for a 0. Hint: begin by constructing a table of BCD-to-CODE mappings.
a
g
b
c d
e
f
Sample Conditions:
Before:
Address Contents 009000 0400
After:
009000 0466
Note: Verify that your program works for any value from 0 to F.
Having completed this lab, students are capable of writing small 68000 programs in assembly language.