Get a unique, high-quality and non-plagiarized paper from us today at the most affordable price
Email us : premieredtutorials@gmail.com

MACRO intVal

psymReadInt_mWriteInt_Macro (Chapter 10, Pr 5 and Pr 6, Modified)

Pr 5: Create a macro named mReadInt that reads a 16- or 32-bit signed integer from standard input and returns the value in an argument.

mReadInt MACRO intVal

Use conditional operators to allow the macro to adapt to the size of the desired result. Write a program that calls the macro, passing it operands of various sizes, either signed or unsigned. If the operand has an unexpected size, should display an error message during assembling, e.g., when you test

; Pass different sizes of arguments …
mReadInt AL ; test the macro’s error message

the build issues error during assembling because the BYTE AL has an unexpected size

1>MASM : error : ************************************************************************
1>MASM : error : Argument AL passed to mReadInt must be either 16 or 32 bits.
1>MASM : error : AL must be of 16 or 32-bit data type.
1>MASM : error : ************************************************************************

As see above, “Argument AL” is mentioned and no code assembled for AL. If mReadIntbVal as a BYTE, the error message should be “error : Argument bVal passed…”. In a valid test, you should be able to pass an argument to mReadInt and get it back to verify like this:

mWrite “Enter a 32-bit integer: ”
mReadIntdVal
mWriteIntdVal
mWrite “Enter a 16-bit integer: ”
mReadInt BX
mWriteInt BX

Here is an output of examples to use DWORD dVal and BX as arguments:

Enter a 32-bit integer: 1234000111
dVal = +1234000111
Enter a 16-bit integer: -32000
BX = -32000

Pr 6: Create a macro named mWriteInt that writes a signed integer to standard output by calling WriteInt. The argument passed to the macro can be a positive or negative valued operand. Use conditional operators in the macro so it adapts to the size of the argument. Write a program that demonstrates the macro, passing it arguments of different sizes. You can define

bVal SBYTE -2
wVal SWORD -122
dVal DWORD 1234567
qVal QWORD 11

and in code, simply test by invoking mWriteInt six times:

mWriteIntbVal
mWriteIntwVal
mWriteIntdVal
mWriteInt AX
mWriteIntebx

; Test the macro’s error message
mWriteIntqVal

But the build issues warning during assembling because the operand qVal has an unexpected size, and then you display an warning message:

1> Assembling [Inputs]…
1>MASM : warning : ************************************************************************
1>MASM : warning : Argument qVal passed to mWriteInt must be 8, 16, or 32 bits.
1>MASM : warning : ************************************************************************

As see here, “Argument qVal” is indicated and and no code assembled for this qVal. You can check your code either at assembly time and test valid results at run time. The substitution & operator in your macro can make the output like this:

bVal = -2
wVal = -122
dVal = +1234567
AX = +13176
ebx = +2130567168

Write three parts into one .ASM file: mReadInt, mWriteInt, and main. Attention to:
The Macro parameter intVal can receive either register or memory of any size when being called
Compare sizes and assign values between the type-less parameter intVal and the register Accumulator
Make push/pop matching in pair in any conditions
When test invalid sizes, mReadInt AL and mWriteIntqVal, make sure no code generated in listing
Don’t use mShow in your homework, but can read it as a good reference

 

 
For a custom paper on the above topic, place your order now!

What We Offer:

• On-time delivery guarantee

• PhD-level writers

• Automatic plagiarism check

• 100% money-back guarantee

• 100% Privacy and Confidentiality

• High Quality custom-written paper

How to Place an Order 

Send the assignment details such as the instructions, due date/deadline, number of pages and college level to the customer support agent online on live chat,  fill in the assignment details at place an order or send the information to our email address premieredtutorials@gmail.com and a customer support agent will respond to you immediately. 

Once you place your order, we choose for you the best and competent writer for your assignment based on each writer’s competence in handling a subject. 

When the homework is completed, we have a quality assurance team that proofreads the assignment to ensure it meets the required rubric instructions from your professor.

After thorough review of your assignment, we send the paper to the client. In case you need any changes at this point, you can let us know so that we can handle it for you at no extra charge. 

Homework Help Website

Why we should write your Paper 

  1. Money Return guarantee
  2. 0% Plagiarism Rate
  3. Guaranteed Privacy
  4. Written from scratch by highly qualified writers 
  5. Communication at Any Time (24/7)
  6. Flexible Pricing and Great Discount Programs
  7. Timely Deliveries
  8. Free Amendments
Looking for a similar assignment and in urgent need for help? Place your order and have excellent work written by our team of professionals to ensure you acquire the best grades.

  We are here to assist you.

 

Statistics about Us

130 New Projects
235 Projects in Progress
315 Inquiries
420 Repeat clients

© 2021 Premiered Tutorials
All rights reserved. We provide online custom written papers, such as term papers, research papers, thesis papers, essays, dissertations and other custom writing services.

All papers inclusive of research material are strictly intended to be used for research and study purposes only. Premiered Tutorials does not support or condone plagiarism in any form. These custom papers should be used with proper reference.

Place an Order
error: Content is protected !!