I would like to know the difference between 0, NULL and FALSE at assembler level. In the Windows.inc NULL EQU 0 FALSE EQU 0 Um...seems all equals to zero Some functions in the Win32 API said they will return TRUE when success, FALSE when failure, but some other functions said they will return NULL if error. Is it ok if i use the following code to check? (I've tried once but I have forgotten I tried which function. I remembered that I have to use .IF eax == NULL but not .IF eax to check) .IF eax ; Do what i want .ELSE invoke GetLastError . . . .ENDIF
Posted on 2001-01-12 06:56:00 by RVA
it's just other way to call the number 0 (for C 'compatibility') true=1 false=null=0
Posted on 2001-01-12 07:32:00 by (scalp)
It increase a lot redability. NULL means a non considered parameter, for example, this doesn't tell the same to readers than a true transmitted 0 or a meaninfull FALSE flag. betov.
Posted on 2001-01-12 10:51:00 by Betov
AS you choose HOW to style your code, concider this: '.IF eax == NULL ' compiles down to: or eax, eax jne @somelabel while '.IF !eax' compiles to: or eax, eax jne @somelabel In other words, they make the same code. Thats's the one problem using built-in macros, you are not sure how they work. But rest assured they work QUITE WELL. BTW, when returning values in eax, I tend do code like such: mov eax, TRUE ret xor eax, eax ; mov eax, FALSE ret IE, if I know a shorter way to express a value, I use it, BUT comment it so it makes perfect brainless sense. Late nite coders appreciate all the help they can get ;-D
Posted on 2001-01-12 11:08:00 by Ernie