1

If I had a string declared like this:

message db "ABCDEFGHIJ",0

how could I create a pointer that would allow me to point to a specific character in this string, such as the 'A' character. And also, how could I create a loop that would allow me to increment the pointer and as a result, cycle through the entire string?

0

1 Answer 1

5
    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:
Sign up to request clarification or add additional context in comments.

1 Comment

Simple yet effective. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.