Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Template for MASM Setup your environment either MASM or NASM (see videos for setup), translate the code below to the assembler of your choice. Rules:

image text in transcribed

Template for MASM Setup your environment either MASM or NASM (see videos for setup), translate the code below to the assembler of your choice. Rules: .386 .MODEL FLAT, stdsalt .STACK 4096 Exit CS855 PROT, de6a6fb5d85000 . The answer must be stored in a variable of the correct data type given your data. The values for your data (A, B, C, D) must be stored in register (e.g. eax, ebx), not variables. You must supply the initial values for the data (A, B, C, D). Create a string that could accompany the answer in an output statement. Comment each line of your code as Demonstrated in Program 3.2 (1 know I said not to do this, but for the first assignment it is better is you figure out the usage of every line) .data ; Write your data definitions here C++ code: .code _main PROC int main() ; Write your code here { int answer - INVOKE ExtProcess, main ENDP END 11 A, B, C, D should be replaced by any number, // for example A = 1, B = 2, C = 3, D = 4 or any other set of values answer = (A + B) - (C + D); return; Template for NASM } SECTION .data Write your data definitions here How will you know the program is correct? Take any set of 4 values for example 1, 2, 3, 4 for A, B, C, D. If that is true then the operation (A + B) - (C + D) will have to store (1 + 2) - (3 + 4) = -4 or FFFFFFFC in hex. Make sure the answer variable is storing that value by debugging your program and directly check the value stored. SECTION .text global main _main: ; Write your code here mov sax 1 mov bx @ int seh

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_2

Step: 3

blur-text-image_3

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

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

Describe the guidelines for appropriate use of the direct plan.

Answered: 1 week ago