Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for my assembly language class. I am stuck at the bottom. You will see 3 question marks after BYTE. What should go there?

This is for my assembly language class. I am stuck at the bottom. You will see 3 question marks after BYTE. What should go there? I don't need the full program written out. Thank you.

image text in transcribed

Homework #2A (sequence) Write a program to print the sum of two digits. Example run: Enter first digit: 1 Enter second digit: 2 Sum - 3 Discussion: Output: digSum Input: digl and dig2 Processing: digSum - digl + dig2 Therefore, pseudocode would be: ; Start ; Print "Enter first digit: " ; Input digi ; Print "Enter second digit: " ; Input dig2 ; digSum - digl + dig2 ; Print "Sum = ", digSum ; Stop Use this solution to solve the problem. You will need the following To read a digit from the keyboard we will use the author's routine, ReadDec. This routine is written to read in a number but we will use it to just read in a single digit. ; Input dig! call ReadDec mov digi, AL To write a digit to the screen we will use the author's routine, WriteDec. This routine is written to write a number but we will use it to just write a single digit. . ; Print digSum movzx EAX, digSum call WriteDec To calculate the digSum we do the following: mov add mov AL, digi AL, dig2 digSum, AL You can think of this problem as printing the sum of two numbers but the numbers are a single digit. Use the following definitions. .data digiMsg dig2Msg sumMsg digi dig2 digSum BYTE "Enter first digit: ",0 BYTE "Enter second digit: ", O BYTE "Sum -",0 BYTE ? BYTE ? BYTE

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions