Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (5 points) Implement the following expression in assembly language: AX = (val3 + 7) - (var2 + vall) + (5/3) +7 Assume that

 

1. (5 points) Implement the following expression in assembly language: AX = (val3 + 7) - (var2 + vall) + (5/3) +7 Assume that vall, val2, and val3 are 16-bit integer variables You need to implement the expression the way it is provided, you cannot do any reduction on the expression while implementing it. Initialize val1 with 12 (decimal), va 12 with 9 (decimal), and val3 with 2 (decimal) You are ONLY allowed to use 16-bit registers. Use ONLY mov, add, sub instructions whenever needed. Use the debugger to verify your answer. O Submit the following: Save your source code using your last name. Lastnamel.asm Screenshot (showing the code and register window) of AX register contains the correct result. O . 2. (5 points) Implement the following expression in assembly language: CX = -val2 vall + (-vall + val3) + 3 Assume that vall, val2, and val3 are 8-bit integer variables You need to implement the expression the way it is provided, you cannot do any reduction on the expression while implementing it. Initialize vall with 12 (decimal), val2 with 9 (decimal), and va13 with 2 (decimal) - You are NOT allowed to update the values stored in vall, val2, and val3 You are only allowed to use 16-bit registers to hold intermediate results, whenever needed. Use mov, add, sub, max.ex, XX, or neg instructions whenever needed. Use the debugger to verify your answer. Submit the following: Save your source code using your last name, Lastname2.asm and upload the Lastname2.asm Screenshot (showing the code and register window) of CX register contains the correct result. 3. (3 points) True/False (2.1) The instruction, var BYTE '?' Lastnamel.asm and upload the The above instruction declares a variable named var and keeps in uninitialized. (2.2) The instruction, var DWORD "ABCD" stores the string 'ABCD in to variable named var (2.3) The instruction, var BYTE "ABCD" stores the characters A, B, C, D in an array of characters named var (2 points) Declare a variable: (6 DUP 3 DUP (?) Varl DWORD 2 DUP What is the total size of the array Varl? Explain your answer. >>

Step by Step Solution

3.49 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

Solution I can give one answer and i am trying to solve ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming Language Pragmatics

Authors: Michael L. Scott

4th Edition

0124104096, 978-0124104099

More Books

Students also viewed these Chemical Engineering questions

Question

What is an intercept interview?

Answered: 1 week ago

Question

Explain how you might implement setjmp and longjmp on a SPARC.

Answered: 1 week ago