flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next |
Author |
|
JohnFound 26 Mar 2015, 17:23
I like it! It is great to get rid of curly braces, back slashes and differences between preprocessor and assembling stages.
![]() I also have several questions: I understand that the speed is not important just now, but still, what is the estimated speed of FASMG related to FASM? Isn't implementation of the instruction set through macros too slow, especially for such complex CPUs as x86 and x86-64? Or too complex? How about the size optimizations of the instructions? Are you planning to implement built-in instruction handling in addition to FASMG? Maybe in some modular way that to allow different instruction sets to be switched in easy? What binary formats are supported? Are FAS files generated as in FASM? Or maybe in different format? Sorry for so many questions, but I am really interested, because the syntax seems to be really good, addressing most of FASM flaws. ![]() BTW: If once the preprocessor and the assembler are joined, why not to join the assembly symbols and the preprocessor symbols? Why to keep two different and not compatible entities instead of one. I understand, that it will need to handle two different types of data (numbers and symbols) in one variable, but the type converting is not impossible and may even become great flexible feature. In addition, some directives will become redundant and the syntax cleaner. IMHO. |
|||
![]() |
|
Tomasz Grysztar 26 Mar 2015, 17:50
JohnFound wrote: I understand that the speed is not important just now, but still, what is the estimated speed of FASMG related to FASM? JohnFound wrote: Isn't implementation of the instruction set through macros too slow, especially for such complex CPUs as x86 and x86-64? Or too complex? JohnFound wrote: How about the size optimizations of the instructions? JohnFound wrote: Are you planning to implement built-in instruction handling in addition to FASMG? Maybe in some modular way that to allow different instruction sets to be switched in easy? JohnFound wrote: What binary formats are supported? JohnFound wrote: Are FAS files generated as in FASM? Or maybe in different format? |
|||
![]() |
|
Tomasz Grysztar 26 Mar 2015, 17:58
Here comes the package I prepared. I am a bit tired with this project at the moment, so I have done the final packaging a bit hastily, but I hope this is enough for a first preview.
UPDATE: I have made this package available on the official download page, you can get the latest version there when any new updates are made. Last edited by Tomasz Grysztar on 13 Jun 2015, 18:16; edited 1 time in total |
|||
![]() |
|
revolution 26 Mar 2015, 23:35
Can macros access a previous decision from a previous pass and declare that a further pass is required?
|
|||
![]() |
|
l_inc 27 Mar 2015, 01:19
Tomasz Grysztar wrote:
A nice feature I'm missing in fasm 1. There are some inaccuracies in the manual... Some proofreading might be desirable (I'd like to volunteer ![]() revolution Quote: Can macros access a previous decision from a previous pass and declare that a further pass is required? This is possible with fasm 1. It's possible to take values from any specific previous pass and to use those in the following passes or to do smth. only if a condition is true at some specific pass etc. So I guess a mechanism of doing the same wouldn't change. _________________ Faith is a superposition of knowledge and fallacy |
|||
![]() |
|
revolution 27 Mar 2015, 01:48
l_inc wrote:
|
|||
![]() |
|
l_inc 27 Mar 2015, 23:05
revolution
I can't unambiguously decipher your clarification, but it seems like you want to declare a need for another pass by checking if some constraint is satisfied. This is kinda convoluted way of thinking, cause multipass processing is there for satisfying such constraints. So instead of attempting to do some explicit intra-pass specific checking and pass count control you just need to specify the constraint and fasm then applies as many passes as needed to make it true. _________________ Faith is a superposition of knowledge and fallacy |
|||
![]() |
|
revolution 28 Mar 2015, 05:20
What I mean is something like this ARM code:
Code: thumb cmp r0,0x102-y y: Code: F1B00FFE 7M ---> cmp r0,0xFE Note that the alternative narrow encoding is this: Code: 28FE V4T ---> cmp r0,0xFE |
|||
![]() |
|
Tomasz Grysztar 28 Mar 2015, 08:59
The revolution's question is about the "oscillator problem", when some conditional assembly (like when trying to optimize an instruction to a shortest form) causes the initial condition to be changed to its opposite, and this alternates between the consecutive passes. The stream of passes with alternating conditions then never ends and the solution cannot be found.
[Note: the samples I provide below assemble exactly the same with either fasm 1.71 or fasmg pre-release] Let's have a look at this simplified example: Code: if v and 1 = 0 db v shr 1 ; short opcode else db 80h,v ; long opcode end if v: So, to make a source that is not self-contradictory, just like in the example of "if ~defined", we need to modify conditions a bit. This one gets correctly resolved to a long form of instruction: Code: if v and 1 = 0 & ~broken db v shr 1 ; short opcode broken = 0 else db 80h,v ; long opcode broken = 1 end if v: You can look at it from the point of view of tracing the changes of values during the consecutive passes (though that requires some knowledge of fasm's implementation) - the symbol "broken" then simply traces that the optimization to short form failed at least once, and it prevents it from being chosen again (thus preventing the oscillation). But I prefer to describe the problems like above in the terms of logical contradictions and removing them, because then this is less dependent on the particular implementation, and is more a general feature of language. Of course it is possible that current implementation of fasm or fasmg may not be able to find a solution even in case, when source is not self-contradictory, and then the knowledge of implementation details may help to find the right set of modifications to help the assembler deal with the problem - for this reason in case of fasm I documented some of the details of how the predictions are made. But I still prefer to start with a general formulation for an abstract language, and leave the description of fasm's current implementation for an "appendix" (that is more or less what I did in fasm 1 manual, though in a very compressed form). revolution asked whether fasmg allows macros to trace the stored decisions across the passes. As l_inc rightly pointed out, this is something that never was a real problem even in case of fasm 1 - because macros are able to define as many local symbols as they need, and they can use these symbols to trace the predictions. The actual problem that applied to fasmarm was with the native instruction handlers, which in case of fasm 1 architecture had much harder way to define any internal symbols or other kind of data storage for this purpose. The macros never had such problem. |
|||
![]() |
|
revolution 28 Mar 2015, 11:09
Thanks for the explanation.
Also, how does it treat floating point numbers? Specifically: What do SHR, SHL, BSR and BSF do with FP inputs? Are variables and constants tagged in any way as floats? Can we use +, -, *, / etc. to do arithmetic in float space? Can we convert from float to integer and/or integer to float? |
|||
![]() |
|
Tomasz Grysztar 28 Mar 2015, 13:09
A small follow-up in the topic of the problematic "oscillating" optimizations: in my design notes for fasm2 I wrote down an idea for an additional feature that would allow attempts to solve this kind of problems by measuring something like a "stability" of input values. I did not test whether this is viable, but I hoped that the fasmg engine would allow to more easily test various ideas of this kind.
revolution wrote: Also, how does it treat floating point numbers? Specifically: What do SHR, SHL, BSR and BSF do with FP inputs? Are variables and constants tagged in any way as floats? Can we use +, -, *, / etc. to do arithmetic in float space? Can we convert from float to integer and/or integer to float? |
|||
![]() |
|
revolution 28 Mar 2015, 14:31
Most useful would be the ability to define the float format. For example for ARM there are various formats used: 1, 2, 4 and 8 bytes. The 4 and 8 byte formats are the usual IEEE754. The 2 byte format has 2 variants. And the 1 byte format for some coprocessor modules.
And further to the 2 byte format one of the variants does not encode any infinity value so the exponent can be all 1's and encode a normal float value. |
|||
![]() |
|
Tomasz Grysztar 28 Mar 2015, 14:52
revolution wrote: Most useful would be the ability to define the float format. For example for ARM there are various formats used: 1, 2, 4 and 8 bytes. The 4 and 8 byte formats are the usual IEEE754. The 2 byte format has 2 variants. And the 1 byte format for some coprocessor modules. PS. I have updated the preview package above, I fixed a few small bugs today. |
|||
![]() |
|
codestar 28 Mar 2015, 17:19
Good work. Say good bye to \{\} forever.
What about the "save block/file" feature? As for "`", the option to use `UPPERCASE would be nice to auto-create multiple names and texts from one generic "name": NAME, 'name', ID_NAME, TYPE_NAME, name_fp, name_import, 'NAME.BMP', etc. How about ``name or `+name? Is this redefine for both define/equ? Quote: redefine seq cdr What's this .type/.size applied to macro parameters? Does . (ns.size) have a different meaning? Code: if a.size = 0 err 'Size not specified' end if if a.type = 'mem' | a.type = 'reg' ; ... end if macro parse_operand ns,op match =byte? value, op ns.size = 1 parse_operand_value ns,value ; ... ??? Is the "esc" a return from macro? Any %line, %date, %file/%name tags? |
|||
![]() |
|
Tomasz Grysztar 28 Mar 2015, 18:22
codestar wrote: What about the "save block/file" feature? codestar wrote: As for "`", the option to use `UPPERCASE would be nice to auto-create multiple names and texts from one generic "name": NAME, 'name', ID_NAME, TYPE_NAME, name_fp, name_import, 'NAME.BMP', etc. How about ``name or `+name? codestar wrote: Is this redefine for both define/equ? REDEFINE is like a two-liner RESTORE+DEFINE; REEQU is like RESTORE+EQU. codestar wrote: Do if/define/equ work the same together? codestar wrote: Have you considered a type of "if symbolic" (ifs)? codestar wrote: What's this .type/.size applied to macro parameters? Does . (ns.size) have a different meaning? codestar wrote: Is the "esc" a return from macro? codestar wrote: Any %line, %date, %file/%name tags? |
|||
![]() |
|
Tomasz Grysztar 28 Mar 2015, 18:41
I have updated the package once again - I decided to switch to version number based on the timestamp.
|
|||
![]() |
|
JohnFound 28 Mar 2015, 19:41
Tomasz Grysztar wrote: I have updated the package once again - I decided to switch to version number based on the timestamp. Tomasz, do you use some version control system? If so, have you thought about publishing the repository? The chance to follow the creation of something good is really interesting and useful. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
![]() |
|
Tomasz Grysztar 28 Mar 2015, 19:49
JohnFound wrote: Tomasz, do you use some version control system? If so, have you thought about publishing the repository? The chance to follow the creation of something good is really interesting and useful. |
|||
![]() |
|
JohnFound 28 Mar 2015, 21:02
Tomasz Grysztar wrote: ... but after you recommended Fossil I decided to give it a try... That is why I asked. ![]() ![]() _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
![]() |
|
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.