flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > TCHAR as label |
Author |
|
revolution 16 Nov 2011, 00:17
ouadji wrote: yes, I know that "TCHAR" is a macro. |
|||
16 Nov 2011, 00:17 |
|
ouadji 16 Nov 2011, 00:22
Code: struc TCHAR [val] { common match any, val \{ . db val \} match , val \{ . db ? \} } sorry for this mistake. that said, I think a "struc" is a "macro" |
|||
16 Nov 2011, 00:22 |
|
revolution 16 Nov 2011, 00:52
A structure is a different from a macro in that it requires a leading label, whereas a macro cannot have a leading label.
Code: macro ABC {do something} struc ABC {do something else} ; ABC ;macro instantiation label1 ABC ;structure instantiation ; jmp TCHAR ;TCHAR structure with "jmp" as the label Last edited by revolution on 16 Nov 2011, 01:03; edited 1 time in total |
|||
16 Nov 2011, 00:52 |
|
revolution 16 Nov 2011, 00:56
BTW: Why you no look at the error messages?
Code: jmp TCHAR ;(B) does not compile (invalid operand) C:\Documents and Settings\We are the Borg\Our Documents\include/win32a.inc [12] TCHAR [1]: match , val \{ . db ? \} } C:\Documents and Settings\We are the Borg\Our Documents\include/win32a.inc [12] match [0]: match , val \{ . db ? \} } error: invalid operand. |
|||
16 Nov 2011, 00:56 |
|
typedef 16 Nov 2011, 01:29
Code: jmp TCHAR is the same as Code: jmp DWORD LAUGH OUT LOUD x 2 |
|||
16 Nov 2011, 01:29 |
|
ouadji 16 Nov 2011, 09:10
of course i look at the error messages. What I didn't understand was that "A" does compile and "B" does not. Now I understand why. Thank you revolution typedef: not "jmp dword", but "jmp byte" (a dword and a byte are two different things, do you know that ?) |
|||
16 Nov 2011, 09:10 |
|
revolution 16 Nov 2011, 09:42
BTW: In case you are wondering how to do what you wanted:
Code: jmp short TCHAR |
|||
16 Nov 2011, 09:42 |
|
ouadji 16 Nov 2011, 10:23
Quote: Although I would not really encourage using things like TCHAR as label names. (in the context of wink improvement) |
|||
16 Nov 2011, 10:23 |
|
typedef 16 Nov 2011, 19:18
ouadji wrote:
Ok, here's a better one maybe you have hard time with comparisons, or you just make quantitative judgements. Code: JMP [DATA_TYPE] Clearly, "DATA_TYPE" is a compiler reserved keyword. STILL, LAUGH OUT LOUD |
|||
16 Nov 2011, 19:18 |
|
revolution 16 Nov 2011, 19:28
typedef wrote: Clearly, "DATA_TYPE" is a compiler reserved keyword. |
|||
16 Nov 2011, 19:28 |
|
typedef 16 Nov 2011, 20:32
revolution wrote:
But if you include win32a.inc, it becomes reserved doesn't it ? LOL |
|||
16 Nov 2011, 20:32 |
|
revolution 16 Nov 2011, 21:14
typedef wrote: But if you include win32a.inc, it becomes reserved doesn't it ? |
|||
16 Nov 2011, 21:14 |
|
ouadji 16 Nov 2011, 21:51
if "TCHAR" is a compiler reserved word, "tchar" should be one too. However, it's not the case. |
|||
16 Nov 2011, 21:51 |
|
Tomasz Grysztar 20 Nov 2011, 01:04
TCHAR is not a reserved word. It gets defined in some Win32 macroinstructions, but since preprocessor in fasm is case-sensitive, you get "TCHAR" expanded as macro/struc, while "tchar" is not recognized as a macro (but you may as well define another macro called "tchar" which will get expanded in "tchar" places).
|
|||
20 Nov 2011, 01:04 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.