flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
asmfan 21 Aug 2007, 14:32
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? |
|||
![]() |
|
AlexP 24 Nov 2007, 02:45
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.
|
|||
![]() |
|
LocoDelAssembly 24 Nov 2007, 03:37
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 |
|||
![]() |
|
asmfan 24 Sep 2009, 18:58
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? |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.