Write a subroutine called addabc

Assignment Help Computer Engineering
Reference no: EM131531111

Question: Write a subroutine called, ADDABC, that performs the operation c : A + B. The three variables A, B, and C are all word (i.e., 16-bit) values. Test your program on the 68000 simulator. Your calling code and subroutine should have the following features:

• The parameters A and B should be passed on the stack to the procedure by reference (i.e., by address).

• Since parameters A and B are adjacent in memory, you need to pass only the address of parameter A to the subroutine (because the address of parameter B is 2 bytes on from parameter A).

• Parameter C should be passed back to the calling program on the stack by value.

• Before you call the subroutine, make room on the stack for the returned parameter (i.e., parameter C).

• After calling the subroutine, read the parameter off the stack into data register DO (i.e., DO should end up containing the value of A + B).

• The subroutine ADDABC must not corrupt any registers. Save all working registers on the stack on entry to the subroutine, and restore them before returning from the subroutine.

• When you write your code, preset the stack pointer to a value such as $1500 (by using either MOVEA L 11$ 15 00 , A7 or LEA $1500,10). Doing this will make it easier to follow the movement of the stack while your program is running.

• Make certain that you are operating with the correct operand sizes. Use .w for data values and for addresses and pointers.

Reference no: EM131531111

Questions Cloud

Capm to estimate? thurbinar unlevered cost of capital : Use the unlevered beta and the CAPM to estimate? Thurbinar's unlevered cost of capital.
Why is it good idea to pass parameter to and from subroutine : Write a subroutine to carry out the operation X*(Y + Z), where X, Y, and Z are all wordlength (i.e., 16-bit) values. The three parameters, X, Y, and Z.
Examination of the health education field : HPR231- Examination of the health education field and profession, an analysis of an HIV prevention program, and the creation of a health education website focusing on heart disease.
What are advantages and disadvantages of issuing new equity : What is the weighted average cost of capital for Coogly? What are the advantages and disadvantages of issuing new equity in the capital structure?
Write a subroutine called addabc : Write a subroutine called, ADDABC, that performs the operation c : A + B. The three variables A, B, and C are all word (i.e., 16-bit) values.
What is the firm earnings growth rate : What is the firm's earnings growth rate? What will next year's earnings be?
How virtual teams have changed project management : Discuss how virtual teams have changed project management. Identify the tools needed to effectively manage a virtual team.
What is a preprocessor statement : Why is C so popular as a systems programming language in applications such as embedded microprocessor systems?
Direct effect on employee commitment : Learning Activity 1 Theme One: Leadership style has a direct effect on employee commitment and organizational effectiveness.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Questionassume you were recently hired for a new position

questionassume you were recently hired for a new position as computer forensics specialist at a medium-sized

  Identify the phases in the object-oriented life cycle model

Explain the primary focus of object-oriented methods. Identify the benefits and advantages of obect oriented methods. Identify the phases in the object-oriented life cycle model.

  Comprehensive literature review

Comprehensive literature review. Choose to conduct a project that is technical (i.e. practically based e.g. development of a prototype, simulation, design framework etc) that fall within computing and IT curriculum.

  Create a database design in visio

Creating a Database Design in Visio, the college has provided more information for the database that they want developed.

  Tradeoff between breath first search, depth-fisrt-search

tradeoff between Breath First search, Depth-Fisrt-Search.Directed Acyclic Graphs(DAGs), Topological sorting and Dijkstra.

  Describe sharepoint services and various sharepoint options

discuss sharepoint services and various sharepoint options as well as windows media rights management to handle the

  What is printed by the given program

What is printed by the following program? Suppose the input is the following: Miller 34 340 #include #include using namespace std; const int PRIME_NUM = 11; int main () { const int SECRET = 17; string name

  Questiona i what are the main differences give three for

questiona i. what are the main differences give three for each between message-passing and shared-address-space

  What will do to get deadline to receive a passing grade

What will do to get deadline to receive a passing grade? You have to complete and submit course project previous to the deadline to receive a passing grade for this course.

  Comparative analysis of machine learning algorithms

Comparative Analysis of Machine Learning Algorithms for Audio Signal Classification. It is single paced & five pages.

  Find out if they pass or fail the course

The administration of you local Community College has asked you to write down a VB.NET program that allows students to calculate the sum of their grades and find out if they pass or fail the course.

  How to create an online account

A database would store the student's login name, class list, and number of registered credits. Furthermore, the database will store the administrator's login information and the classes listed in the online catalog. Add error handling to the appli..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd