1- using instruction jump
org 100h
org 100h
mov ax,0f000h
mov ds,ax
mov si,0400h
mov di,0600h
mov cx,64h
labelx:
mov ah,[si]
mov [di],ah
inc si
inc di
dec cx
jnz labelx
hlt
2-using instruction loop
org 100h
mov ax,0f000h
mov ds,ax
mov si,0400h
mov di,0600h
mov cx,64h
nextpt:
[mov ah,[si
mov [di],ah
inc si
inc di
loop nextpt //not need increment cx because loop do that
hlt
3-using srting instruction and loop
org 100hmov ax,0f000h
mov ds,ax
mov es,ax
mov si,0400h
mov di,0600h
mov cx,64h
cld
:nextpt
movsb //di<--si , inc si and di
loop nextpthlt
note :
if want to insert number in location 600 and use program put number in location 400 :
mov [0400h],05h
if want to insert number in all location but instruction in loop
label:
mov [si],05h // can [si+2] if want to but number from location 402 and up
loop label
0 التعليقات:
إرسال تعليق