Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Following 8086 Assembly program accepts a two digit number and display as two digit number. A macro has been used to read a two-digit number.

Following 8086 Assembly program accepts a two digit number and display as two digit number. A macro has been used to read a two-digit number. Extend this code to read two numbers of two digits. The program will add the numbers and display the sum as two digits.

.model small

.stack 64

.data fdigit db ?

sdigit db ?

number db ?

message db "Please enter a digit number$"

output db "You entered $"

.code .

startup

macro twodigitread

mov [di],al

mov ah,01

int 21h

sub al,30h

mov [bx],al

; adjust

mov al,[di]

mov ah,0

mov cl,10

mul cl; ax=first digit

add al,[bx]

mov [si],al endm

mov dx, offset message

mov ah,9

int 21h

mov ah,01

int 21h

sub al,30H

mov di,offset fdigit

mov bx,offset sdigit

mov si,offset number

twodigitread

mov dx,offset output

mov ah,9

int 21h

mov al,[number]

mov ah,0

mov cl,10

div cl

mov cl,al; first digit

mov ch,ah; second digit

mov dl,cl

add dl,30h

mov ah,2

int 21h

mov dl,ch

add dl,30h

mov ah,2

int 21h

.exit end

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago

Question

Define induction and what are its objectives ?

Answered: 1 week ago

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago