0% found this document useful (0 votes)
37 views

Prog 4

This document outlines programming assignment #4 for a microprocessors and interfacing course. It instructs students to write a simple calculator program that can perform addition and subtraction using inputs stored in memory locations 9000H-9002H. The program must call subroutines to perform the operations and store the result in location 9003H, setting 9004H to FFH if an error occurs. Students are also asked to calculate the total delay of the program assuming a 2MHz clock frequency.

Uploaded by

api-3724082
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Prog 4

This document outlines programming assignment #4 for a microprocessors and interfacing course. It instructs students to write a simple calculator program that can perform addition and subtraction using inputs stored in memory locations 9000H-9002H. The program must call subroutines to perform the operations and store the result in location 9003H, setting 9004H to FFH if an error occurs. Students are also asked to calculate the total delay of the program assuming a 2MHz clock frequency.

Uploaded by

api-3724082
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Microprocessors & Interfacing

Fall 2001
Programming Assignment #4

Name:________________ Student ID: ____________________

1. Write a simple calculator program:


- The program is capable of only addition and subtraction.
- There should be at least two subroutines, one to perform the addition
and the other to perform the subtraction.
- The inputs to the program are as follows:
o Location 9000H contains the first 8-bit number
o Location 9001H contains the second 8-bit number
o Location 9002H contains the ASCII code for the operation to be
performed.
- The main program must read the data from the memory locations and
then based on the operation specified, call one of the subroutines and
perform the operation.
- If the user has entered the wrong ASCII code in location 9002H, the
program should set location 9004H to FFH to indicate that there is an
error.
- After completing the operation, the main program must save the result
in location 9003H.

You can use the simulator and the trainer in the lab to test your program.

2. Calculate the total delay of your entire program assuming a 2 MHz clock
frequency. (Ignore the HLT instruction at the end).

Microprocessors & Interfacing Fall 2001 Dr. Bassel Soudan 1

You might also like