الاثنين، 10 مارس 2014
1:25 م

ثلاث طرق : لنقل 100 من موقع 400 الى 600

1- using  instruction jump
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 100h

mov 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 nextpt

hlt


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 التعليقات:

إرسال تعليق