flat assembler
Message board for the users of flat assembler.
Index
> Main > flat assembler 1.66 Goto page Previous 1, 2, 3 Next |
Author |
|
Tomasz Grysztar 12 May 2006, 13:54
The thing of making lines in the middle of processing some other line is still a bit of a problem for current architecture.
|
|||
12 May 2006, 13:54 |
|
vid 12 May 2006, 14:46
isn't it same as expanding macro?
or do you mean case like when there are 2 inline macros in same line? |
|||
12 May 2006, 14:46 |
|
Tomasz Grysztar 12 May 2006, 15:07
As I already wrote, expanding macro adds new lines after the line that invoked the macro, with inlined macros it wouldn't work this way.
|
|||
12 May 2006, 15:07 |
|
vid 12 May 2006, 15:19
you could also add original line at the end, without expanded macro or with "returned" value instead of macro.
returning would be another problem... |
|||
12 May 2006, 15:19 |
|
dead_body 13 May 2006, 08:23
fasm 2.0 will be after fasm 1.9 ?
|
|||
13 May 2006, 08:23 |
|
Tomasz Grysztar 13 May 2006, 11:49
Since it's a different desing, it could come in parallell, actually. It has nothing to do with how many versions of 1.xx are released.
|
|||
13 May 2006, 11:49 |
|
vid 14 May 2006, 18:23
0xDEADB0D7: 1.10 comes after 1.9
|
|||
14 May 2006, 18:23 |
|
Big Red 29 May 2006, 13:40
Nice. This version works pretty well so far, thanks again Mr. Grysztar. Also good to be back to having only one official version, it was getting confusing (with 1.64-1.65) to have to use one version for the editor (for the international symbols) and the other to compile.
|
|||
29 May 2006, 13:40 |
|
quiveror 01 Jun 2006, 18:32
I found 'label' bug in PE64 and COFF64. Please try to insert the below code into '.data' section and compile:
Code: x dd ? label y byte at x and you'll got error: invalid use of symbol. |
|||
01 Jun 2006, 18:32 |
|
Tomasz Grysztar 01 Jun 2006, 21:45
Right, too strict error checking leftover... Thanks for the report.
I made a quick fix into the 1.66 packages. |
|||
01 Jun 2006, 21:45 |
|
quiveror 04 Jun 2006, 16:53
This 2-line code got error. I think this is a bug.
Code: align x x=8 By the way, Code: x=8 align x works OK |
|||
04 Jun 2006, 16:53 |
|
halyavin 05 Jun 2006, 09:39
I suggest that by default x=0 and align 0 gives division by zero.
|
|||
05 Jun 2006, 09:39 |
|
quiveror 05 Jun 2006, 15:23
halyavin wrote: I suggest that by default x=0 and align 0 gives division by zero. from the manual 1.2.3 Quote: When a constant is defined only once in source, it is – like the label – |
|||
05 Jun 2006, 15:23 |
|
Tomasz Grysztar 05 Jun 2006, 18:31
|
|||
05 Jun 2006, 18:31 |
|
revolution 05 Jun 2006, 21:48
Yes, this is a bug. At line 1902 of ASSEMBLE.INC we can see that the value 0 causes an immediate invalid value error.
You can fix this by changing line 1902 (jz invalid_value) to this: Code: jnz alignment_positive cmp [error_line],0 jne instruction_assembled mov eax,[current_line] mov [error_line],eax mov [error],invalid_value jmp instruction_assembled alignment_positive: |
|||
05 Jun 2006, 21:48 |
|
wise 05 Jun 2006, 22:20
Hey everybody.
I am new to fasm's macro syntax and capabilities, however I was thinking of a way to use it to allow function call syntax that is somewhat easier to apprehend. I did read the thread, and while it may serve the same purpose, no , it is not about return values, at least not all and definetely not in the way you discussed. I was thinking of a macro named func say, which would enable the declaration of functions in the following syntax: Code: func func_name (in_reg_1, ,..., in_reg_n)(out_reg_1, ..., out_reg_n) some notes: 1) I usually pass all my params in registers, which will be all the more true for x64 which is the reason i'm intrested in fasm. 2) This syntax would actually allow more than one return value which is usefull in light of (1) among other things. 3) the declaration would define the respective registers used in the function. it would also define a new macro with the function's name in order to call the function using a similar double-parenthesis style, "mov"ing values between registers where needed. 4) actually I would like to allow local aliasing for the registers but that would complicate the question (and syntax) too much. unless I missed something, and I did RTFM this is not currently possible because i would need to parse the passed lists either with RegExp (best but unavailable) or some other way, because while it does say how to make comma'ed lists, and pass them ( in <>) I see no way to get the elements back. I'm thinking of a stub Perl script to act as an additional preprocessor, but i'm wandering whether it might be indeed possible, not to say closer existing capabilities than what you are proposing. This is rather longer than I expected so thank you for bearing with me |
|||
05 Jun 2006, 22:20 |
|
Tomasz Grysztar 05 Jun 2006, 22:36
revolution: I would rather call it a "lack of resolving feature" than a bug - there are still other places (perhaps mainly in formatter) where invalid values cause errors immediatelly*, some of them are inevitable (that is: they are errors that make correct resolving impossible to continue), while some other are simply because I didn't think they would need such more sophisticated handling. The code resolving "declaration" (that says that the only sure thing is that if assembler succeeds, the results should be correct) is a kind of "excuse" for such lacks. Unfortunately it didn't came to my mind that someone might need forward-referenced alignment value, so I didn't add such feature - I guess now I should add it also for section alignments?
*Some sample of other such case: Code: format PE data alpha end data data beta end data alpha = 5 beta = 6 |
|||
05 Jun 2006, 22:36 |
|
Tomasz Grysztar 05 Jun 2006, 22:55
wise: this is not at all a working macro package for functions nor anything like that, but it shows how to do the parsing:
Code: macro func [params] { common match funcname(in)(out) ,params \{ macro funcname [funcparms] \\{ \\common match (inv)(outv), funcparms \\\{ display 'Input:',13,10 show_values <in>,<inv> display 'Output:',13,10 show_values <out>,<outv> \\\} \\} \} } macro show_values in,inv { define values inv,0 irp name,in \{ match value=,rest,values \\{ define values rest display \`name,' = ',\\`value,13,10 \\} \} } func testfunc (a,b,c) (d,e) ; this defines the "testfunc" macro testfunc (1,2,3) (eax,ebx) ; this shows the assigned values Actually the are many other options how you can do such things with various combinations of standard and "instantaneous" macros, and some may be even better than this, this is just a quick example - just note that even more complex parsing is possible with fasm's preprocessor, see http://board.flatassembler.net/topic.php?t=4608 If you can specify some more details on how you would expect your macros to work, I can give some further help (but please start a separate thread in "Macroinstructions" in such case). |
|||
05 Jun 2006, 22:55 |
|
wise 05 Jun 2006, 23:30
thanks, Tomasz.
Now it makes much more sense. it will take me some time to pore over the whole example, but meanwhile, do i understand correctly that any literal string in the "match" pattern is treated as a name of a capture group unless preceded with "="? if that's so you really should be more clear on this in the manual as well as mention RegExp's and other familiar terms in the context of "match", because at first the connection wasn't apparent at to me all, and just left me wondering what is it for. Good Night |
|||
05 Jun 2006, 23:30 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.