flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Request

Author
Thread Post new topic Reply to topic
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan
The following requests can make life easier ))
Althou everyone can make changes in already defined macroses, i suggest Tomasz to think of adding the following in official FASM distribution.
OK, following:
1) sizeof.TCHAR. In every *a or *w inc files TCHAR defined according to ANSI/UNICODE support. It would be handy to have size of current TCHAR symbol for more portable programs. Say for manual string manipulation.
2) Define aliases for db,dw,dd in "struct" - byte, word, dword and also the same with capital letters (BYTE, WORD, DWORD /my personal preference/).
3) the same as [2)] oly with "local" macro in "proc" macro.
Thanks.
If you think it's useful - agree with me, if not - please explain why.

_________________
Any offers?
Post 16 Aug 2007, 10:10
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan
As an example of useful support of TCHAR pseudo type - retrieving filename from full path - would work OK if TCHAR would have sizeof - 1/2 bytes and its type - BYTE/WORD.
Code:
proc    findName uses ebx esi edi, szNamePath:DWORD
        mov     edi,[szNamePath]
        mov     ecx,-1
        xor     eax,eax
        repne   scas    TCHAR [edi]
        sub     edi,sizeof.TCHAR
        not     ecx

        mov     eax,'\'
        std
        repne   scas    TCHAR [edi]
        cld
        jnz     .not_found
        add     edi,2*sizeof.TCHAR

        mov     eax,edi
        ret
.not_found:
        xor     eax,eax
        ret
endp
    

it would be universal for UNICODE & ANSI strings if there better support of TCHAR.
Thanks for reading it.

_________________
Any offers?
Post 21 Aug 2007, 14:32
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Isn't there an API call somewhere that can clean up path names? I think I heard of one that you could use.. Try googling it.
Post 24 Nov 2007, 02:45
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Altough languages like Delphi comes with such function I couldn't find a parallel on Windows API. Still, obviously, asmfan don't want this for exactly support his example code only, and even if such API exists it is still good to have TCHAR so you can allocate proper buffer size when you assemble for ASCII or for UNICODE.

Code:
  fileNameBuff rb MAX_PATH*sizeof.TCHAR    
Post 24 Nov 2007, 03:37
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan
Diggin' the core)
Having looked at latest fasmw168.zip found that Tomasz finally agreed to me in [1] and added sizeof.TCHAR to headers ) hope the rest 2,3 coming soon )
How soon will it be possible to use TCHAR as datatype qualifier in indirect references? Or like masm-like "datatype PTR [X]" but it's not for masm-like "datatype1 PTR [X+datatype2]" where datatypes can be numbers if needed?

1.69 different from 1.68 in these basic functions? Or what's the difference between?
Post 24 Sep 2009, 18:58
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.

Powered by rwasa.