.model small
.stack 100h
.data
reg_numbers db 007h, 027h, 069h
.code
main proc
mov ax, @data
mov ds, ax
mov si, 0 ; initialize source index to point to the first element of reg_numbers
mov cx, 3 ; set the loop counter to 3 (number of elements in reg_numbers)
mov bx, 007h ; initialize destination memory location to 007h
move_numbers:
mov al, reg_numbers[si] ; load the value from reg_numbers into AL register
mov [bx], al ; move the value to the memory location pointed by BX
inc bx ; move to the next memory location
inc si ; move to the next element of reg_numbers
loop move_numbers ; repeat the process until CX becomes zero
mov ah, 4ch
int 21h
main endp
end main
|