Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following code, in ASSEMBLY language (MASM x86) add code for multibyte subtraction of sum - decimal_two to get decimal_one DECIMAL OFFSET 5 ;

Given the following code, in ASSEMBLY language (MASM x86) add code for multibyte subtraction of "sum - decimal_two" to get decimal_one

image text in transcribed

DECIMAL OFFSET 5 ; offset from right of string data decimal_one BYTE "100123456789765" decimal_two BYTE "900402076502015" sum BYTE (SIZEOF decimal_one 1) DUP (0),0 ; 1001234567.89765 9004020765.02015 code main PROC ; Start at the last digit position mov esi,SIZEOF decimal one1 mov edi, SIZEOF decimal_one mov ecx, SIZEOF decimal_one mov bh, 0 set carry value to zero L1 : ah, 0 ; clear AH before addition mov mov al,decimal_oneesi]get the first digit add al,bh ; add the previous carry ; adjust the sum (AH-carry) ; save the carry in carryl ; convert it to ASCII ; add the second digit ; adjust the sum (AH = carry) ; OR the carry with carryl ; convert it to ASCII ; convert AL back to ASCII ;save it in the sum ; back up one digit mov bh, ah or bh, 30h add al,decimal_two [esi] bh, ah or or bh, 30h or mov sum [edi],al dec esi dec edi loop L1 mov sum [edi], bh al, 30h ; save last carry digit exit main ENDP END main DECIMAL OFFSET 5 ; offset from right of string data decimal_one BYTE "100123456789765" decimal_two BYTE "900402076502015" sum BYTE (SIZEOF decimal_one 1) DUP (0),0 ; 1001234567.89765 9004020765.02015 code main PROC ; Start at the last digit position mov esi,SIZEOF decimal one1 mov edi, SIZEOF decimal_one mov ecx, SIZEOF decimal_one mov bh, 0 set carry value to zero L1 : ah, 0 ; clear AH before addition mov mov al,decimal_oneesi]get the first digit add al,bh ; add the previous carry ; adjust the sum (AH-carry) ; save the carry in carryl ; convert it to ASCII ; add the second digit ; adjust the sum (AH = carry) ; OR the carry with carryl ; convert it to ASCII ; convert AL back to ASCII ;save it in the sum ; back up one digit mov bh, ah or bh, 30h add al,decimal_two [esi] bh, ah or or bh, 30h or mov sum [edi],al dec esi dec edi loop L1 mov sum [edi], bh al, 30h ; save last carry digit 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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago