flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > A few things missed in fasm |
Author |
|
asmfan 10 Mar 2007, 09:08
TCHAR is either BYTE or WORD depending on include file fith suffix a or w, e.g. win32a.inc (win32w.inc)
|
|||
10 Mar 2007, 09:08 |
|
Tomasz Grysztar 11 Mar 2007, 14:29
As for the sizeof feature of DB, see the example in section 2.3.4 of manual, and perhaps this one.
The FINDDATA name was there because some of the old docs I had used this name. You're right, the newer docs call it WIN32_FIND_DATA, I'm correcting it. Those definitions were left in the "temporary state" for years, they really need to be revised. |
|||
11 Mar 2007, 14:29 |
|
demonwu 01 Apr 2007, 03:19
First, I must say thank you for the answer.
About local data in TCHAR, it won't get error if local variable declaration doesn't use brackets [], i.e.: local data:TCHAR According to macro in proc32.inc and win32a.inc (assume we want to use ANSI version), statement above will be translated into: data db ? Let's see how it works from each include files. From win32a.inc: struc TCHAR [val] { common match any, val \{ . db val \} match , val \{ . db ? \} } Symbol TCHAR would be translated into: db ? And from proc32.inc: macro local [var] { ... match , done@local \\{ varname vartype restore done@local \\} \} ... } Statement local data:TCHAR would be translated into: data db ? But, if we use brackets [] for local TCHAR data declaration, the compiler would complain, i.e.: local data[260]:TCHAR The problem lays in macro local from proc32.inc: Let's see, what will be executed in macro local if we use brackets: macro local [var] { ... match , done@local \\{ virtual varname vartype end virtual rb count*sizeof.\#vartype restore done@local \\} \} ... } So, according to macro above, it will be translated into: rb 260*sizeof.TCHAR The problem is that we cannot use operator sizeof for macro struc (TCHAR is built from macro struc). Keep up the good work. |
|||
01 Apr 2007, 03:19 |
|
demonwu 01 Apr 2007, 03:20
First, I must say thank you for the answer.
About local data in TCHAR, it won't get error if local variable declaration doesn't use brackets [], i.e.: local data:TCHAR According to macro in proc32.inc and win32a.inc (assume we want to use ANSI version), statement above will be translated into: data db ? Let's see how it works from each include files. From win32a.inc: struc TCHAR [val] { common match any, val \{ . db val \} match , val \{ . db ? \} } Symbol TCHAR would be translated into: db ? And from proc32.inc: macro local [var] { ... match , done@local \\{ varname vartype restore done@local \\} \} ... } Statement local data:TCHAR would be translated into: data db ? But, if we use brackets [] for local TCHAR data declaration, the compiler would complain, i.e.: local data[260]:TCHAR The problem lays in macro local from proc32.inc: Let's see, what will be executed in macro local if we use brackets: macro local [var] { ... match , done@local \\{ virtual varname vartype end virtual rb count*sizeof.\#vartype restore done@local \\} \} ... } So, according to macro above, it will be translated into: rb 260*sizeof.TCHAR The problem is that we cannot use operator sizeof for macro struc (TCHAR is built from macro struc). Keep up the good work. |
|||
01 Apr 2007, 03:20 |
|
hidden 01 Apr 2007, 04:11
There is a way to make array of TCHARs
Code: format PE GUI entry start include 'win32a.inc' proc start local szLocalString:TCHAR 260 dup(?) ret endp |
|||
01 Apr 2007, 04:11 |
|
vid 01 Apr 2007, 09:01
demonwu: what is point of using TCHAR in assembly?
|
|||
01 Apr 2007, 09:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.