0

I'm having a simple problem copying a char from register al into a variable called ErrorChars...

Do I have to dereference the destination as [ErrorChars]? Is this a decent solution to scanning a buffer, finding the errored chars within the buffer, and placing them in a string, so that I can print them as one item?

 SECTION .data ; Section containing initialized data ErrorChars: db "", 10 ErrorCharsLen: equ $-ErrorChars ; ... mov al, byte [ebp+ecx] ; copy current byte of Buffer into al mov byte ErrorChars, [al] ; copy byte at al into ErrorChars 
0

1 Answer 1

4
mov byte ErrorChars, [al] ; copy byte at al into ErrorChars 

ErrorChars is your memory operand, not al. So yes, it should be in brackets and not al.

mov [ErrorChars], al ; copy byte in al into ErrorChars 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.