Implement macros getstring and displaystring

Assignment Help Computer Engineering
Reference no: EM132084652

Objectives (using MASM/Assembly Language):

1) Designing, implementing, and calling low-level I/O procedures

2) Implementing and using a macro

Problem Definition:

• Implement and test your own ReadVal and WriteVal procedures for unsigned integers.

• Implement macros getString and displayString. The macros may use Irvine's ReadString to get input from the user, and WriteString to display output.

o getString should display a prompt, then get the user's keyboard input into a memory location

o displayString should the string stored in a specified memory location.

o readVal should invoke the getString macro to get the user's string of digits. It should then convert the digit string to numeric, while validating the user's input.

o writeVal should convert a numeric value to a string of digits, and invoke the displayString macro to produce the output.

• Write a small test program that gets 10 valid integers from the user and stores the numeric values in an array. The program then displays the integers, their sum, and their average.

Requirements:

1) User's numeric input must be validated the hard way: Read the user's input as a string, and convert the string to numeric form. If the user enters non-digits or the number is too large for 32-bit registers, an error message should be displayed and the number should be discarded.

2) Conversion routines must appropriately use the lodsb and/or stosb operators.

3) All procedure parameters must be passed on the system stack.

4) Addresses of prompts, identifying strings, and other memory locations should be passed by address to the macros.

5) Used registers must be saved and restored by the called procedures and macros.

6) The stack must be "cleaned up" by the called procedure.

7) The usual requirements regarding documentation, readability, user-friendliness, etc., apply.

8) Submit your text code file (.asm) to Canvas by the due date.

Notes:

1) For this assignment you are allowed to assume that the total sum of the numbers will fit inside a 32 bit register.

2) When displaying the average, you may round down to the nearest integer. For example if the sum of the 10 numbers is 3568 you may display the average as 356.

Reference no: EM132084652

Questions Cloud

Write a program which reads user input using scanner : Write a program which reads User Input using Scanner. Print formatted output using printf or DecimalFormat
What evolutionary theories were proposed prior to darwin : What evolutionary theories were proposed prior to Darwin? How were these theories different from Darwin's theory:
What kind of experiments did mendel perform : What kind of experiments did Mendel perform, and why did he postulate the existence of an inherited "unit" that could not be seen?
Period of the industrial revolution : What are the similarities/differences in the uses of power in the medieval era, the period of the Industrial Revolution, and our own era?
Implement macros getstring and displaystring : Implement macros getString and displayString. The macros may use Irvine's ReadString to get input from the user, and WriteString to display output.
What do the nuremberg egg : What do the Nuremberg Egg and the smartphone have in common? How are they both the culminations and/or representations of the eras that produced them?
Colleagues reflect on the scientific culture of the time : How does her treatment by her colleagues reflect on the scientific culture of the time?
Income statement and balance sheet for gerrard construction : Income statement and balance sheet for Gerrard Construction Co. What other financial statements are required
Design a calendar using a skin : Design a calendar using a skin. Create a web page called Calendar.aspx in your Pages folder.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is the main goal of parallel processing

what is the main goal of parallel processing

  Define the project schedule when outsourcing critical tasks

Suggest at least three (3) potential challenges of controlling the project schedule when outsourcing critical tasks

  What type of light rays does each type provide

Describe the elements of a digital rendering scene. List the five types of lights that SolidWorks uses. What type of light rays does each type provide?

  How to utilize javascript to collect and manipulate data

This assignment is to demonstrate an understanding of how to utilize Javascript to collect, persist, and manipulate data, and to respond.

  Distinguish between types of asymmetric algorithms

Please outline how you used the knowledge gained in the course(s) listed within this position (if this is the only position you have held this term).

  How concepts using the osi model as a framework

Your manager has asked you to describe the frame format of a typical Ethernet packet. Prepare a written report. Be sure to discuss Manchester encoding, 4B/5B encoding, 8B/10B encoding, the cable grades required for different speeds of Ethernet, an..

  What were the problems that arise during the project

What were the problems that arise during the project? Include both internal problems directly related to the implementation and external problem. Explain the sources of the problems.

  What is the future of the software

The current practice of a mainly part of water resources engineering is supported by various of commercial software. Pick a specific domain within water resources engineering. What is the software.

  After initial review of the existing systems you have

within the discussion board area write 600-800 words that respond to the following questions with your thoughts ideas

  Calculate the sum of the numbers from one to n

Write an assignment statement to calculate the sum of the numbers from 1 to N using Gauss's formula

  Explain how this storage space works where it is located in

ram is a temporary storage space that is used to store program instructions and data. but accessing ram is inefficient

  What can be done to reduce the risk that these threats pose

What can be done to reduce the risk that these threats pose. Discuss your thoughts on if and how the Clark-Wilson security model could be used to help protect data, or would a different security model be more appropriate? If so, which one

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