Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem : Using the template provided (see attached), write an assembly program that accomplishes the following: 2) Specifications: a) Place the results in EAX/AX/AL. You

Problem : Using the template provided (see attached), write an assembly program that accomplishes the following:

image text in transcribed 2) Specifications: a) Place the results in EAX/AX/AL. You must choose the correct size of the register, remember to consider efficient use of available resources. b) To compute the product, you must use one or more constant expressions that computes the value. This will be accomplished in one instruction. No loops or use of anything beyond Chapter 3 in the book may be used. No use of MUL, MULI, ... c) The register must be zeroed out before the result is stored. Part 2: 1) Write a short block of computational statements that causes the EBX register to set the carry flag. DO NOT USE STC. 2) Write a short block of computational statements that causes the ECX register to set the overflow flag. Specifications: a) Make sure no other computations affect the outcome of the registers. b) Use immediate values in your computational statements. c) The registers must be zeroed out before use. d) You may use the instructions ADD, SUB, MOV. For more information on these instructions use appendix B. e) NO LOOPS.

Assignment 2 Part 3: 1) Using directives for creating symbolics, write a single statement that computes the number of seconds in a day. Specifications: a) Place the result in the EDX register. HINT: Think about how memory is stored and how you can address memory. FYI there is a slide in the notes that explicitly explains how to do this. b) The statement that is placed in the program and expanded is SECONDS_IN_DAY only. c) The EDX register should be zeroed out before it is used. d) Make sure the statement uses the symbolics to the fullest extent; that is, SECONDS_IN_DAY will be the only expression on the instruction line. No other mnemonics, or operands just SECONDS_IN DAY. Part 4: 1. Calculate A = (A - B) + (C - D). Where A = 132d, B = 0110 1001b, C = AF5h and D = 85d. Specifications: a) You must ensure your registers are cleared before starting this part. b) Ensure that you are using registers (or parts of registers) of the appropriate size. c) You will calculate this in the following manner. A B C D (A B) + (C D) d) There are no memory to memory operations. You will have to use registers as necessary to accomplish this. e) You must declare 4 separate variables of the appropriate size to hold the values given above. f) After the result is stored in A, put the result in EAX. g) After the result is in EAX, type the following line of code in your program. Call WriteInt

1) Write a single statement that computes the product i=38i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions