Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

There is a single bug please correct. The bug is a logical bug and not syntax Da

ID: 657392 • Letter: T

Question

There is a single bug please correct. The bug is a logical bug
and not syntax

Data Segment

num dw 1234H

res db 10 dup ('$')

Data Ends

Code Segment

Assume ds:Date,cs:Code

Start:

mov ax,data

mov ds,ax

mov ax,num

lea si,res

call Convert

lea dx,res ;may be written as mov dx, offset res

mov ah,2

int 21H

mov ah,4CH

int 21H

Code Ends

Convert Proc Near

mov cx,0

mov bx,10

Loop1:

mov dx,0

div bx

add dl,30H

push dx

inc cx

cmp ax,9

jg loop1

add al,30H

mov [si],al

Loop2:

pop ax

inc si

mov [si],al

loop loop2 ;works with the cs register

ret

Convert EndP

End Start

Explanation / Answer

Data Segment

num dw 1234H

res db 10 dup ('$')

Data Ends

Code Segment

Assume ds:Date,cs:Code

Start:

mov ax,data

mov ds,ax

mov ax,num

lea si,res
Convert call

lea dx,res ;
mov ah,2

int 21H

mov ah,4CH

int 21H

Code Ends

Convert Proc Near

mov cx,0

mov bx,10

Loop1:

mov dx,0

div bx

add dl,30H

push dx

inc cx

cmp ax,9

jg loop1

add al,30H

mov [si],al

end loop1

Loop2:

pop ax

inc si

mov [si],al

loop loop2 ;
ret

Convert EndP

End Start

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote