flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 19 Feb 2009, 21:21
First: that would be way beyond the line of what the low-level assembler should optimize by itself. You should do that with macros, just like some other optimizations discussed on this board. Just overload the "jmp" instruction with a macro, it should work like a charm. And if slows down compilation too much for you, you can enable this macro only when making the final executable (for release).
Second: this kind of jump is sometimes needed, like when you enter processed mode. I cannot image how angry (and confused) some programmers would get when assembler did such optimization for them in such case. |
|||
![]() |
|
IronFelix 19 Feb 2009, 21:28
Thank for your quick reply, Tomasz. I'll try to do it with assembler directives in my case.
|
|||
![]() |
|
rugxulo 24 Feb 2009, 07:22
I wrote a sed script / .BAT for this for checking my simple DOS programs (which can have this due to too many careless cut n' pastes). Of course, it wouldn't work on your macro use since "@f" and "@@" don't match. But it can be done.
![]() |
|||
![]() |
|
Tomasz Grysztar 24 Feb 2009, 11:58
I was thinking about collecting all such macros into one "agressive optimization" macro package. You could just include it into your sources just to compile the final release.
|
|||
![]() |
|
DOS386 25 Feb 2009, 00:07
Agree. FASM core shouldn't do things like drop jumps, replace MOV by XOR, CMP by TEST, ...
|
|||
![]() |
|
asmfan 25 Feb 2009, 16:13
The thing core defenitely should do is apply short variant of instructions (implied sign extension if possible & need, short jumps, smart indirect addressing encoding/optimization) by default. That's enough /for the first time;)?/
|
|||
![]() |
|
rugxulo 27 Feb 2009, 08:15
DOS386 wrote: Agree. FASM core shouldn't do things like drop jumps, replace MOV by XOR, CMP by TEST, ... Don't forget that TASM was part of the inspiration behind FASM, and it had normal MASM mode as well as an improved IDEAL mode. So, with that reasoning, there's no reason that FASM (in theory) couldn't support more, including a separate mode for more aggressive optimizations. The jump issue could be handled by a warning, however. Maybe that's the best answer, add a diagnostics mode that returns more warnings than normal without actually changing anything. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.