Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN asmly language Pretty please with successful build screen shot and output 1.Using the AddTwo program from Section 3.2 as a reference, write a program

IN asmly language Pretty please with successful build screen shot and output

1.Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the following expression, using registers: A = (A + B) (C + D). Assign integer values to the EAX, EBX, ECX, and EDX registers.

Note: you can hard code integer literal onto the registers, e.g. mov eax,55

; AddTwo.asm - adds two 32-bit integers. ; Chapter 3 example

.386 .model flat,stdcall .stack 4096 ExitProcess proto,dwExitCode:dword

.code main proc mov eax,5 add eax,6

invoke ExitProcess,0 main endp end main

2. Listing File for AddTwoSum Generate a listing file for AddTwoSum.asm(in 3.4.3 of the text) and write a description of the machine code bytes generated for each instruction. You can write your descriptions directly over the .lst file. You might have to guess at some of the meanings of the byte values.

Submit the .lst file with your description over it.

TITLE Add and Subtract, Version 2 (AddSub2.asm)

; This program adds and subtracts 32-bit integers ; and stores the sum in a variable.

INCLUDE Irvine32.inc

.data val1 dword 10000h val2 dword 40000h val3 dword 20000h finalVal dword ?

.code main PROC

mov eax,val1 ; start with 10000h add eax,val2 ; add 40000h sub eax,val3 ; subtract 20000h mov finalVal,eax ; store the result (30000h) call DumpRegs ; display the registers

exit main ENDP END main

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago