Pointer

Posts 14 of 4 · Page 1 of 1
Pointer
Alright well I've looked around and I can't get a good definition of a pointer for some reason. I've seen that a pointer gets it's space allocated at runtime. Is that true? For example, if I have

Code:
 
lpText equ offset text     ;set a pointer to the offset (location) text

.data
text db "Pointers are fun!", 0
then lpText doesn't get it's size until I run my program that will push lpText onto the stack for my MessageBoxA correct? Thanks a lot, really need that cleared up.
Sorry, I don't get the question. \:

I've read over this several times but I don't get what you're asking.
Why do you need to have 2 variables defined for the same string?

A pointer is just like the name suggests. It points to a defined memory location, in this case the string in the .data section. A pointer does "not" have a size (depends on how you look at it, the address itself is in 32-bit programs a DWORD, it does not relate to the size of data it might point).

You could just do it like this:

Code:
.data 

lpText db "Pointers are fun!", 0

.code

...

push 10h
push 0
push offset lpText
push 0
call MessageBox

...
Idk if it made any sense, like Void, I don't really understand your question .
My wording was crap there, sorry. HellSpider, that was pretty helpful. I got my problem solved anyway.
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?