Professional Documents
Culture Documents
Write A Program in Assembly Language That Display The Following Output Using Loop: 1 2 3 4 5 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 1 2 2 1 1 1
Write A Program in Assembly Language That Display The Following Output Using Loop: 1 2 3 4 5 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 1 2 2 1 1 1
123454321
1234 4321
123 321
12 21
1 1
.model small
.stack 100h
.data
var db 49
var2 db 52
var3 db 53
four db 53
one db 48
ws db 32
tpfour db 52
tpone db 49
.code
main proc
mov Ax,@data
mov Ds,Ax
mov ah, 02h
mov cx, 5
l1:
mov bx, cx
mov cx, 9
mov ah, 02h
mov dl, var
l2:
int 21h
inc dl
exit:
l3:
cmp dl, one
je exit2
int 21h
dec dl
loop l3
exit2:
dec four
dec var2
jump:
mov var3, 32
mov cx, bx
loop l1
mov ah,4ch
int 21h
main endp
end main