flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
asmfan
TCHAR is either BYTE or WORD depending on include file fith suffix a or w, e.g. win32a.inc (win32w.inc)
|
|||
![]() |
|
Tomasz Grysztar
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. |
|||
![]() |
|
demonwu
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. |
|||
![]() |
|
demonwu
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. |
|||
![]() |
|
hidden
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 |
|||
![]() |
|
vid
demonwu: what is point of using TCHAR in assembly?
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.