如果我有一个声明如下的字符串:
message db "ABCDEFGHIJ",0
如何创建一个指针,允许我指向此字符串中的特定字符,例如“A”字符。而且,我怎么能创建一个允许我增加指针的循环,结果循环遍历整个字符串?
答案 0 :(得分:4)
mov ecx, message ; Masm would use "offset"
top:
mov al, [ecx] ; get a character
inc ecx ; get ready for next one
cmp al, 0 ; end of string?
jz done
; do something intelligent with al
jmp top
done: