assume cs:code
a segment
db 1, 2, 3, 4, 5, 6, 7, 8
a ends
b segment
db 1, 2, 3, 4, 5, 6, 7, 8
b ends
cc segment
db 0, 0, 0, 0, 0, 0, 0, 0
cc ends
code segment
start:
mov ax, a
mov es, ax
mov ax, b
mov ss, ax
mov ax, cc
mov ds, ax
mov cx, 8
mov bx, 0
s:
mov al, es:[bx]
add al, ss:[bx]
mov ds:[bx], al
inc bx
loop s
mov ax, 4c00H
int 21H
code ends
end start
(6)
assume cs:code
a segment
dw 1, 2, 3, 4, 5, 6, 7, 8, 9, 0aH, 0bH, 0cH, 0dH, 0eH, 0fH, 0ffH
a ends
b segment
dw 0, 0, 0, 0, 0, 0, 0, 0
b ends
code segment
start:
mov ax, a
mov ds, ax
mov ax, b
mov es, ax
mov cx, 8
mov bx, 0
s:
push ds:[bx]
add bx, 2
loop s
mov cx, 8
mov bx, 0
s1:
pop es:[bx]
add bx, 2
loop s1
mov ax, 4c00H
int 21H
code ends
end start
|