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

  Why has shared virtual memory become a necessity

Why has shared virtual memory become a necessity in building a scalable system with memories physically distributed over a large number of processing nodes?

  System analysis and design

In the System Analysis and Design: Mixing Techniques – The question “Whether the structured techniques and object-oriented techniques can be mixed.

  Define difference between eprom and ram

Repeat Problem to obtain the memory map shown in Table P4.13 using a decoder block identical to the 74138.

  Complexity and crafting a solution

You're faced with an extremely complex problem that will require a lengthy solution. How would you go about addressed the complexity and crafting a solution?

  What requirements analysis technique would you recommend

Only cities are listed in the correct order. What requirements analysis technique or techniques would you recommend for this situation? Explain your answer.

  Write a shell script that copies the file named by its first

Write a script that tests for at least 1 or more arguments in the line calling the script. Write a shell script that copies the file named by its first argument

  Difference between stratified and random sampling

What is the difference between stratified and random sampling and what were the similarities and differences between oneperquad and twoperquad? Be sure to explain pattern, dispersion, and density.

  Advanced qos configuration

Advanced QoS Configuration, Write a paragraph below that summarizes what was accomplished in this lab and what you learned by performing it

  What happens when you add a button to a container

What happens when you add a button to a container that uses a border layout and omit the position? Try it out and explain.

  Explain the purpose of all setting you used in dhcp server

You are required to set up a small network with network ID: 210.15.5.96/27. In this network, there are three routers, two servers, one acting as DHCP Server and another as Mail/DNS Server - Explain the functioning and purpose of all setting you use..

  How do you find out the name of the job scheduled

Should you run a command like this? nohup compute.sh. How do you find out the name of the job scheduled to be executed with at and batch?

  Write out the inputs and expected output of these six tests

Write out the inputs and expected output of these six tests, and explain why you would choose them. Do not worry about error handling (yet).

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