17 April 2015

repne scasb, rep movsb




a) to count string length. Looks at how ECX is used, 'neg ecx' 
b) to copy string to somewhere in memory



NOTES

scasb:
   cmp al, [edi]
   ##add esi, 1
   add edi, 1


repne scasb:
  repeat 'not equal' or 'ECX times',



movsb:
  mov byte [edi], [esi]
  add esi, 1     ; depending on direction flag, might be decreased
  add edi, 1


rep:
  repeat ECX times

rep movsb:
   repeat while ecx not 0;
   sub ecx, 1
   (#repeat ecx times)





usually:
   'repne scasb' to count string lenght;
    'rep movsb' to copy string  

No comments:

Post a Comment

Terima kasih