Just for fun :bg
include \masm32\include\masm32rt.inc
.data
MyDwords dd 123, 456, 789
.code
start: mov edi, offset MyDwords[4]
mov eax, 111
stos MyDwords
MsgBox 0, str$(MyDwords), "Surprise...:", MB_OK
exit
end start
More (http://www.google.com/search?q=%22explicit-operands+form+is+provided+to+allow+documentation%22)
yes - stos, lods, movs, scas, and cmps can all get a size from a label
it can be any appropriately sized label - does not matter if it is the one pointed to by the index regster :P
Even this works:
stos dword ptr GetTickCount
And yes, it's a simple stosd under the hood, mov [edi], eax/add edi, 4 - has nothing to do with GetTickCount.
That can be a cute feature, but on the other hand it's a nightmare to chase a bug caused by a wrong value in edi...
as i remember, you can do something similar with XLAT
of course, it always wants a byte table :P
Quote from: dedndave on May 26, 2011, 10:59:20 PM
as i remember, you can do something similar with XLAT
of course, it always wants a byte table :P
Hi,
Yeah, I tried these "label" tricks out once. Lasted almost
15 minutrs. Noted the string opcodes actually tried the
XLAT trick. Oh well.
Cheers,
Steve N.