5(5)
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
c segment
db 0,0,0,0,0,0,0,0
c ends
code segment
start:
;setting Segment register
mov ax,a
mov ds,ax
mov ax,b
mov es,ax
mov ax,c
mov ss,ax
;setting offset address
mov ax,0
mov bx,ax
;setting number of cycles
mov cx,8
s:
mov al,ds:[bx]
mov ss:[bx],al
mov al,es:[bx]
add ss:[bx],al
add bx,1
loop s
mov ax,4c00H
int 21h
code ends
end start
5(6)
assume cs:code
a segment
dw 1,2,3,4,5,6,7,8,9,0,0ah,0bh,0ch,0dh,0eh,0fh,0ffh
a ends
b segment
db 0,0,0,0,0,0,0,0
b ends
code segment
start:
mov ax,a
mov ds,ax
mov ax,b
mov ss,ax
mov sp,16
mov bx,0
mov cx,8
s:
push [bx]
add bx,2
loop s
mov ax,4c00H
int 21h
code ends
end start
6
assume cs:code,ss:stack,ds:data
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
data segment
db '1. display '
db '2. brows '
db '3. replace '
db '4. modify '
data ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10H
mov bx,0
mov cx,4
s: push cx
mov si,0
mov cx,4
s0: mov al,3[bx+si]
and al,11011111B
mov 3[bx+si],al
inc si
loop s0
pop cx
add bx,10H
loop s
mov ax,4c00H
int 21h
code ends
end start