flat assembler
Message board for the users of flat assembler.

Index > Windows > is TCHAR a compulsory now? db seems to breaks.

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 9091
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
hi,
i just have a weird test with latest available downloaded fasm assembler.

if change the TCHAR to db, it seems breaks.
Code:
  _class db 'FASMWIN32',0
  _title db 'Win32 program template',0
  _error db 'Startup failed.',0
    


i search around the board and manual for TCHAR, it seems nobody mentioned it somehow.


Description:
Filesize: 4.99 KB
Viewed: 1014 Time(s)

untitled.GIF


Post 07 Jan 2009, 11:15
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
It surely isn't compulsory. I think you should post bigger piece of code that doesn't work.
Post 07 Jan 2009, 13:26
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7783
Location: Kraków, Poland
Tomasz Grysztar
Pehaps he used the win32w.inc instead of win32a.inc?
Post 07 Jan 2009, 15:02
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9091
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
oops yea. i think you are correct tomasz.
Post 08 Jan 2009, 01:48
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9091
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
confuse here,

what are the TCHAR effect when one uses win32a.inc and win32w.inc?
is TCHAR = 2 bytes?
Post 08 Jan 2009, 07:00
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
WIN32A.INC:
Code:
; Win32 programming headers (ASCII)



...

struc TCHAR [val] { common match any, val \{ . db val \}

                           match , val \{ . db ? \} }

    


WIN32W.INC:
Code:
; Win32 programming headers (WideChar)



...


struc TCHAR [val] { common match any, val \{ . du val \}

                     match , val \{ . du ? \} }    


http://flatassembler.net/docs.php?article=win32 wrote:
1.7 Text encoding

The resource macroinstructions use the du directive to define any Unicode strings inside resources - since this directive simply zero extends the characters to the 16-bit values, for the strings containing some non-ASCII characters, the du may need to be redefined. For some of the encodings the macroinstructions redefining the du to generate the Unicode texts properly are provided in the ENCODING subdirectory. For example if the source text is encoded with Windows 1250 code page, such line should be put somewhere in the beginning of the source:

include 'encoding\win1250.inc'


http://flatassembler.net/docs.php?article=manual#1.2.2 wrote:
1.2.2 Data definitions

To define data or reserve a space for it, use one of the directives listed in table 1.3. The data definition directive should be followed by one or more of numerical expressions, separated with commas. These expressions define the values for data cells of size depending on which directive is used. For example db 1,2,3 will define the three bytes of values 1, 2 and 3 respectively.

The db and du directives also accept the quoted string values of any length, which will be converted into chain of bytes when db is used and into chain of words with zeroed high byte when du is used. For example db 'abc' will define the three bytes of values 61, 62 and 63.
Post 08 Jan 2009, 07:20
View user's profile Send private message Reply with quote
israbvk



Joined: 09 Mar 2009
Posts: 1
israbvk
I am looking at ways to define the UNICODE character set for text encoding (Currently looking for a specific non-roman script language) to create a language specific editor /notepad. Help directions requested in connection with TCHAR and use of db.


1.7 Text encoding

The resource macroinstructions use the du directive to define any Unicode strings inside resources - since this directive simply zero extends the characters to the 16-bit values, for the strings containing some non-ASCII characters, the du may need to be redefined. For some of the encodings the macroinstructions redefining the du to generate the Unicode texts properly are provided in the ENCODING subdirectory. For example if the source text is encoded with Windows 1250 code page, such line should be put somewhere in the beginning of the source:

include 'encoding\win1250.inc'
Post 09 Mar 2009, 07:57
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.