News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Addr,Offset,Procs and Registers

Started by GR33d, July 12, 2005, 05:32:14 PM

Previous topic - Next topic

GR33d

hi hutch and friends
i have some questions..... can u help me?

im always having some problem about the correct use of ADDR and OFFSET
i never know when to use them, is there any example showing the diference ?
another question is the diference between a proc like this :

MakeStuff proc hWnd:DWORD
and a proc like this
MakeStuff proc uses ebx,edx,ecx hWnd:DWOD

oh...and the last one is
where can i find some reference about the registers them self? like
EAX has AX,AH inside of it ....
what AL ...and stuff

can someone explain it ?? im posting this here because someone let me know that this is assembler related..since im using Masm32
i tought this could be the right place
im not a newbie, these are just some anoying doubts about some ASM concepts thats i did let go trought my "ASM school"(at home lol)

thanks all for the patience
GR33d


Petroizki

- ADDR is only used with the invoke-command. It is almost the same as OFFSET, but it will calculate address of procedure locals (you cannot get the immediate address at compile -time). Simply just use ADDR always with invoke, and OFFSET on everything else. :wink

- The second procedure you showed; preserves ebc,edx and ecx. It will restore their original values just before the procedure returns. The uses declaration is just the lazy man's way to do this, especially on procedure with multiple returns. These two procedures are the same:
MakeStuff proc uses ebx edx ecx hWnd:DWORD
ret
MakeStuff endp

MakeStuff proc hWnd:DWORD
push ebx
push edx
push ecx
...
pop ecx
pop edx
pop ebx
ret
MakeStuff endp



Also check the hlp files in the MASM32\help\ -folder.

GR33d

oh  :eek
thanks
that really make things clear and some sense now  :toothy
and another question :P

about the registers ??
where can i find some *.hlp about it ? or any tut ........
just to make some reference when coding
thanks Petroizki

Mark Jones

Gr33d, see the ASMINTRO.HLP file in \masm32\help.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08