الاثنين، 17 مارس 2014
4:27 م

string instruction with repeated(REP)

1- move from block to another by using string instruction with repeated(REP) :

org 100h
mov ax,0h
mov ds,ax
mov es,ax
mov si,2000h  
mov di,3000h
mov cx,20h    // 32 consecutive bytes in hex=20
cld

rep movsb

hlt

2-scan number if find replace with another number else by default found in last location :

org 100h  
cld 
mov ax,0h
mov es,ax
mov ds,ax  

mov di,00d0h  
mov [di],45h // for certain replace else put 29 in the last location 

mov cx,0046h // 70 bytes

mov al,45h
repne scasb
dec di
mov byte ptr[di],29h

hlt

0 التعليقات:

إرسال تعليق