Hi.. i have just started studying assembly.. i have written a code to print the numbers in reverse order.. but i want to know that how should we made increment in the address as i have stored every number in a variable (DB) and i m calling from its address... this is the code
title Printing numbers in reverse order.
.model small
.stack 100h
.data
num DB 0,1,2,3,4,5,6,7,8,9
result DB ?
.code
main proc
mov ax,@data
mov ds,ax
mov bx,offset result
mov al,num+9
add al,30h
mov [bx],al
mov al,num+8
add al,30h
mov [bx+1],al
mov al,num+7
add al,30h
mov [bx+2],al
mov al,num+6
add al,30h
mov [bx+3],al
mov al,num+5
add al,30h
mov [bx+4],al
mov al,num+4
add al,30h
mov [bx+5],al
mov al,num+3
add al,30h
mov [bx+6],al
mov al,num+2
add al,30h
mov[bx+7],al
mov al,num+1
add al,30h
mov [bx+8],al
mov al,num
add al,30h
mov [bx+9],al
mov cx,10
mov ah,2
mov dl,[bx]
bx by 1 so y it's not taking the next
address to print
show: int 21h
inc bx
loop show
mov ah,4ch
int 21h
main endp
end main