flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
edfed 07 Mar 2010, 00:45
maybe:
Code: C1 equ A1B1; C1 equ aaabbb |
|||
![]() |
|
LocoDelAssembly 07 Mar 2010, 01:42
Code: loco@athlon64:~$ cat test.asm A1 equ aaa B1 equ bbb match concat, A1#B1 { C1 equ concat } ; Verify concatenation match c, C1{display `c} loco@athlon64:~$ fasm test.asm flat assembler version 1.69.11 (16384 kilobytes memory) aaabbb 1 passes, 0 bytes. |
|||
![]() |
|
ouadji 07 Mar 2010, 09:40
Thank you LocoDelAssembly. ![]() |
|||
![]() |
|
ouadji 07 Mar 2010, 11:30
Code: if A1 equ / ;or /* then does not work. it's a pity, this would have been useful . |
|||
![]() |
|
baldr 07 Mar 2010, 12:06
ouadji,
It's only backtick that don't work. Symbol C1 is defined as /bbb. Try Code: match c, C1 { irps s, c \{ display \`s \} } |
|||
![]() |
|
ouadji 07 Mar 2010, 12:25
yes, it works (display), but in fact, I would like to do this: Code: A1 equ " B1 equ /* match concat, A1#B1#A1 ; A1#B1#A1== "/*" { C1 equ concat } mov eax,'C1' ; == mov eax,'"/*"' but I think I am asking something impossible! |
|||
![]() |
|
edfed 07 Mar 2010, 13:09
Quote:
and maybe a little useless too ![]() |
|||
![]() |
|
ouadji 07 Mar 2010, 14:14
sorry but my English is not good enough to explain all this, and edfed is French. et non ce n'est pas inutile, pas dans mon cas. Dans mon code, celui qui permet les commentaires multi-lignes et en blocs, je fais à plusieurs endroits référence aux symboles "start-comment" et "end-comment" ... Pouvoir définir ces symboles start/end avec des EQU m'aurait permis de changer rapidement de symboles dans tout mon code. Par exemple, passer de "/* */" à "(! !)". Je peux le faire, mais il faut que je définisse la totalité des "cas" ... exemple ... pour mov eax,'"/*"' ... je peux définir par un EQU <toto equ '"/*"'> et écrire ensuite : "mov eax,toto". Ca, c'est ok. Mais il faut alors que je définisse par des "equ" tous les cas ... "'/*'", '"/*'", "'*/'",'"*/"' . Pouvoir agir avec "equ + concaténation" m'aurait permis de changer uniquement 2 equ ... celui pour /* et celui pour */. Les autres cas seraient alors définis d'office par concaténation. voilou. |
|||
![]() |
|
zhak 07 Mar 2010, 14:17
wow! i don't know french, but i understood almost everything what ouadji wrote! )) sorry for offtopic )
|
|||
![]() |
|
ouadji 07 Mar 2010, 14:25
hat off zhak ! ![]() I am unable myself to understand a single word of Russian! |
|||
![]() |
|
ouadji 07 Mar 2010, 15:40
my solution Code: @S_ equ 2A2Fh @E_ equ 2F2Ah @S_qd = (@S_ shl 8) or 22000022h @E_qd = (@E_ shl 8) or 22000022h mov eax , @E_qd ; mov eax,'"*/"' if i change @E_ ... @E_ equ 2921h then, i have : mov eax,'"!)"' |
|||
![]() |
|
baldr 07 Mar 2010, 16:49
ouadji,
Why are you need all those combinations of quotes? Half of them are invalid anyway: string literal must end with the same quote (single or double) as it was started. ![]() Backtick macro operator works in match too: match c, `A1#`B1 { C1 equ c } defines C1 as string '/*'. Moreover, simple ![]() Code: COMMENT_START equ / * COMMENT_END equ * / struc textequ arg { local r r equ match v, arg \{ irps s, v \\{ match vv, r\\\#\\\`s \\\{ r equ vv \\\} \\} \} match v, r \{ . equ v \} } COMMENT_START_STRING textequ COMMENT_START COMMENT_END_STRING textequ COMMENT_END display COMMENT_START_STRING, 13, 10, COMMENT_END_STRING, 13, 10 SSQUOTED_COMMENT_START_STRING equ "'" shl 24 or (COMMENT_START_STRING) shl 8 or "'" SDQUOTED_COMMENT_START_STRING equ "'" shl 24 or (COMMENT_START_STRING) shl 8 or '"' DSQUOTED_COMMENT_START_STRING equ '"' shl 24 or (COMMENT_START_STRING) shl 8 or "'" DDQUOTED_COMMENT_START_STRING equ '"' shl 24 or (COMMENT_START_STRING) shl 8 or '"' mov eax, DDQUOTED_COMMENT_START_STRING ![]() |
|||
![]() |
|
edfed 07 Mar 2010, 17:29
to make coments on fasm, we use the ;
pour ce qui est du français, evidement que l'on peu comprendre le français ecrit lorsque l'on connait l'anglais, car l'anglais est une langue qui à importé une tonne de mots de france. mais les ont mis en anglais. donc, on peu facilement anglishiser un mot français. par exemple: j'aime les galettes i love the galets ok, it is not always true. ![]() de plus, le russe est inspiré du français en partie car était la langue de la cour du temps des tsars. donc, les russes n'ont pas de merites a comprendre el français. d'ailleur, un petit suet sur le russe serait interressant sur ce forum. par exemple, du russe orienté fasm. ![]() n'empeche, je ne comprend pas pourquoi utiliser le C design dans fasm. fasm is made to code asm gcc is made to code C then, if you want to code C, use GCC, not fasm. ![]() |
|||
![]() |
|
ouadji 07 Mar 2010, 20:08
Quote:
"/*" ; "*/" ; '/*' and '*/'. this, inside my multiline-comment code. These combinations should not be detected as a beginning or end of comment (nested or not) Quote:
There is not much information about this in the fasm doc. Where to find good documentation on the macros language ? Where to find good explanations and examples ... not in fasm.pdf. |
|||
![]() |
|
ouadji 07 Mar 2010, 20:35
Code: start_symbol equ /* end_symbol equ */ struc textequ arg { local r r equ match v, arg \{ irps s, v \\{ match vv, r\\\#\\\`s \\\{ r equ vv \\\} \\} \} match v, r \{ . equ v \} } @S_ textequ start_symbol @E_ textequ end_symbol @S_qd equ '"' shl 24 or (@S_) shl 8 or '"' @E_qd equ '"' shl 24 or (@E_) shl 8 or '"' thank you very much baldr ![]() This solution is perfect and meets my needs exactly. But where did you learn the macros language ? Where to find good documentation about this? |
|||
![]() |
|
Fanael 07 Mar 2010, 22:18
Ar an drochuair, níl aon doiciméadú.
|
|||
![]() |
|
ouadji 07 Mar 2010, 22:39
Fanael wrote: Ar an drochuair, níl aon doiciméadú. how those who know to use it, have they done ? |
|||
![]() |
|
edemko 07 Mar 2010, 22:49
Holy the google: http://translate.google.com/#auto|en|
The more macro the less assembler and more http://board.flatassembler.net/topic.php?t=11242&start=18(see baldr's post). |
|||
![]() |
|
Fanael 08 Mar 2010, 07:50
ouadji wrote:
You know Irish?!? |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.