Does anyone know where I can read exactly what all the definitions are for things like 20h 20d etc...?
As far as I know it's an allocation of space in hex but I'm trying to understand how big it is or if I'm wrong what exactly it means!
Thanks in advance.
----
William
Quote from: kromag on February 01, 2009, 04:42:57 PM
Does anyone know where I can read exactly what all the definitions are for things like 20h 20d etc...?
As far as I know it's an allocation of space in hex but I'm trying to understand how big it is or if I'm wrong what exactly it means!
William,
20h is a number not an allocation space. h means hexadecimal and it means also 32 in decimal.
If we are talking about ascii codes, 20h means space like 30h is the ascci code for 0 (zero)
Rui
So what exactly is this telling me here:
.data
ClassName db "SimpleWinClass",0
AppName db "Our First Window",0
;::::::::::::::::::::::::::::::::::::::::::::::::
; here
;::::::::::::::::::::::::::::::::::::::::::::::::
char WPARAM 20h ; the character the program receives from keyboard
Iczelion's tut says: The initial value is 20h or the space since when our window refreshes its client area the first time, there is no character input. So we want to display space instead.
So how do I find out how much space that is and why I need said amount?
Ok I think I figured out the above...
It just sets 32 bits of space does it not?
But I don't understand why I need 32 bits of space there and why it was done that way "char WPARAM 20h"
---
William
Quote from: kromag on February 01, 2009, 07:11:10 PM
Ok I think I figured out the above...
It just sets 32 bits of space does it not?
But I don't understand why I need 32 bits of space there and why it was done that way "char WPARAM 20h"
---
William
No, no. It means the space ASCII text character, the same one you get when you press the space bar while entering text. It's just a single byte value.
oh man thanks!
I totally misinterpreted that one; my condolences!
---
William
Actually kromag, you are right, char WPARAM 20h creates a 32-bit variable set to 20 hex or 32 decimal or space ASCII. Since WPARAM is defined as WPARAM typedef DWORD in windows.inc. I'm not sure why he did it that way without looking at the code.
Greg,
Thanks for the input :bg!
Here is the link to the full Tutorial along with the code.
http://win32assembly.online.fr/tut6.html
----
William
Yeah, I saw the 20h value and recognized the 8-bit ASCII code and totally missed that since it's a DWORD value it's 32 bits here. :red
he want a space string, so he generates (in a different way) :
char byte " ",0,0,0
the needed string...
because of stack usage...
I'm not sure I really understand what you mean by: "because of stack usage".
Thanks for the info tho.
---
William
I think you are refering to this quote from Iczelion, "The initial value is 20h or the space since when our window refreshes its client area the first time, there is no character input. So we want to display space instead." In this case, the word "space" is used to refer to the ASCII space character. It is a single byte. It has a value or 20h (=32d), and in ASCII, it translates to the "space" character.
somedata db 'Hi William'
is the same as
somedata db 'Hi',20h,'William'
I hope that helps you make sense of it
- Dave
It makes sense now and thank you all for the help!
---
William
If WPARAM is 32-bit storage, and you are storing a byte in the form of a space char, then the null terminating 0, that's only accounting for 16 bits. I interpret what NightWare said about "stack usage" as having 16 more bits in the form of 0, 0 included in that storage for this "space string".
Am I close?
~psault
Ah that makes sense as well;
So the contents are padded!
Thank you again folks!
---
William
Quote from: psault on February 02, 2009, 03:46:39 PM
If WPARAM is 32-bit storage, and you are storing a byte in the form of a space char, then the null terminating 0, that's only accounting for 16 bits. I interpret what NightWare said about "stack usage" as having 16 more bits in the form of 0, 0 included in that storage for this "space string".
Am I close?
~psault
It creates a variable having the size of a WPARAM (i.e. a DWORD = 4 bytes = 32 bits) with the value of 20h (i.e. 00000020h).
Due to the way dwords are stored, the bytes will actually come out in memory as: 20h,00h,00h,00h
Thanks again Tedd; greatly appreciated :bg
---
William