flat assembler
Message board for the users of flat assembler.
Index
> Windows > [BUG] api/shell32.inc doesn't include StrStr and StrStrI |
Author |
|
mindcooler 20 Aug 2010, 12:32
_________________ This is a block of text that can be added to posts you make. |
|||
20 Aug 2010, 12:32 |
|
LocoDelAssembly 20 Aug 2010, 14:05
CONFIRMED, this is a bug.
mindcooler, it is not the same case, here referring to StrStr succeeds, but later there is a fail inside the package-provided include files for doing this (i.e. the error generated for doing "alpha = StrStr" is quite different to that of "alpha = StrStrfuihwh23vbiugu"). |
|||
20 Aug 2010, 14:05 |
|
revolution 31 Aug 2010, 02:16
Actually this is part of a wider problem with the import macros. Some macros support only Win95 functions and others support later API functions. Adding StrStr means you lose the ability to safely compile for Win95.
IMO there should be a separate set of API macros for the various API versions. 95, 98, ME, NT, 2K, XP, Vista, 7. That way is becomes absolutely clear about which version of Windows the code is designed to support. |
|||
31 Aug 2010, 02:16 |
|
ziral2088 31 Aug 2010, 05:48
maybe stop supporting Win 95-ME ?
Cant find even where to look for PC with Win 95 or ME. 2k+ support is a good idea. |
|||
31 Aug 2010, 05:48 |
|
Tomasz Grysztar 31 Aug 2010, 08:28
revolution wrote: IMO there should be a separate set of API macros for the various API versions. 95, 98, ME, NT, 2K, XP, Vista, 7. That way is becomes absolutely clear about which version of Windows the code is designed to support. |
|||
31 Aug 2010, 08:28 |
|
revolution 31 Aug 2010, 08:58
Tomasz Grysztar wrote: Since fasm itself doesn't cut you out from the instructions for processors newer than those you program for, it would not be in the same spirit to make such thing for WinAPI. Tomasz Grysztar wrote: The idea is: just provide them all, programmer should know what he uses anyway. |
|||
31 Aug 2010, 08:58 |
|
Tomasz Grysztar 31 Aug 2010, 09:41
revolution wrote: Unfortunately this is becoming increasingly hard for the programmer to know which-CPU-supports-what. There is such a large variety now, and the variety is continually increasing. I think the best place to do the detection is by the assembler. |
|||
31 Aug 2010, 09:41 |
|
revolution 31 Aug 2010, 10:01
Tomasz Grysztar wrote: I had an exactly opposite impression - that nowadays processor are able to mix so many different abilities and inabilities (just look at amount of such bits that CPUID returns) that any such system would only create more trouble rather than really help. If I wanted to use any AES instruction, I would also need to remember how the AES-enabling directive is called for the environment I use in addition to knowing the instruction names (which are standard). Thats unnecessary complication in my view. Did you see how I did it for fasmarm? I used a bitmap to define the current processor set of available instructions. Using symbolic names for the bits helps a lot. And the programmer only has to get it right once during the initial coding and then the assembler will check all following instructions and catch any inadvertant mistakes. With an assembler that does no checks, when going back to old code and trying to change it, this is a prime time when "bad" instructions get included. And testing on a more capable CPU won't expose the error. It is only when the target users start running it and then complain about it crashing that the problems are exposed. Programming for a lessor CPU than what the programmer currently uses is very problematic when relying in just the programmer's own restraint and memory. |
|||
31 Aug 2010, 10:01 |
|
Tomasz Grysztar 31 Aug 2010, 10:25
It is not that I see any problem with implementing such thing - I just don't see a reason. I never liked those directives and don't like them still.
It is like having to mark the procedure boundaries with "proc" and "endp", because the recommended way of programming is to have them as separated pieces of code. But assembly program may not fit into such boundaries. If they are implemented as additional macros, they I'm OK with it - and same goes for other such limitations, as instruction set ones. I had 8086.INC as a separate (one might say: exiled) macro package since almost the first releases of fasm. You can then even have macros emulate unavailable instructions for you - like 8086.INC did with SHL r/m,imm8 with imm8>1. |
|||
31 Aug 2010, 10:25 |
|
revolution 31 Aug 2010, 10:42
Using macros is one way to solve, but it is also very space inefficient (uses lots more memory) and makes assembling slower (up to 10 times slower in many instances).
So for the original topic here, would you be okay with having multiple sets of API macros (or some other selection method) to allow for 95, 98, etc. API separation? If so, how would someone submit that for inclusion into the fasm download? Or would it always have to be a separate download? |
|||
31 Aug 2010, 10:42 |
|
Tomasz Grysztar 31 Aug 2010, 11:18
revolution wrote: Using macros is one way to solve, but it is also very space inefficient (uses lots more memory) and makes assembling slower (up to 10 times slower in many instances). And I'm OK with people having to pay some price for the features I personally dislike. revolution wrote: So for the original topic here, would you be okay with having multiple sets of API macros (or some other selection method) to allow for 95, 98, etc. API separation? If so, how would someone submit that for inclusion into the fasm download? Or would it always have to be a separate download? It would have to be the part of the project I linked to. I must confess that I don't know who is responsible for it right now. I leave it up to you. |
|||
31 Aug 2010, 11:18 |
|
Tomasz Grysztar 01 Sep 2010, 11:49
On second thought, I might still convince myself to implement some instruction set restrictions as an optional directives that wouldn't restrict anything unless you used them (so default would still be "everything allowed", as it is now).
However the fact that there is a set of macros that does the job well, does not encourage me to consider it as something worth effort. You know already that I love to have as much as possible implemented as macros (BTW, do you know LaTeX? ). And fasm 1.x has this flaw in its architecture that any keyword must be disallowed globally for assembly-time defined symbols (which is another reason for trying to avoid introducing new keywords [another BTW: I think it was a bad choice to introduce "note" as a keyword type of segment in ELF executable]; I myself have some programs where I had to rename the "note" label because of this). |
|||
01 Sep 2010, 11:49 |
|
revolution 01 Sep 2010, 12:15
Tomasz Grysztar wrote: On second thought, I might still convince myself to implement some instruction set restrictions as an optional directives that wouldn't restrict anything unless you used them (so default would still be "everything allowed", as it is now). I don't know LaTeX. Is this related to assembly instruction sets? I thought it was a text layout language? If you do decide to do it in some restricted form then targeting 286-and-lower vs 386-and-higher would be a good start. The long jumps need special attention when writing for 286 (and lessor) CPUs. Without the macros the programmer has no opportunity to force fasm to create the correct jump code. |
|||
01 Sep 2010, 12:15 |
|
Tomasz Grysztar 01 Sep 2010, 12:17
revolution wrote: For x86 one could use: PROCESSOR, or FEATURES? Or perhaps CAPABILITY? EXECUTIONSET? INSTRUCTIONSET? revolution wrote: I don't know LaTeX. Is this related to assembly instruction sets? revolution wrote: Without the macros the programmer has no opportunity to force fasm to create the correct jump code. |
|||
01 Sep 2010, 12:17 |
|
revolution 01 Sep 2010, 12:27
Tomasz Grysztar wrote:
Tomasz Grysztar wrote:
|
|||
01 Sep 2010, 12:27 |
|
Tomasz Grysztar 01 Sep 2010, 12:35
revolution wrote: I also considered how to make the directives use textual parameters but couldn't come up with any suitable solution. Tomasz Grysztar wrote: And on these smaller CPUs space/time is usually of a premium so making all jumps as JnCC SHORT $+5/JMP LONG TARGET is not efficient. Macros are the only practical way to get efficient (and correct) jump encoding. |
|||
01 Sep 2010, 12:35 |
|
revolution 01 Sep 2010, 12:47
Tomasz Grysztar wrote: And the restricting directives would not help you here (as they would restrict you in the same way as if every such jump had "short" type specified)- you'd still have to write macros. |
|||
01 Sep 2010, 12:47 |
|
Tomasz Grysztar 01 Sep 2010, 12:49
revolution wrote: They would help because at least the programmer will get a compile error. I'm going to stay with macros - this way you choose/modify them freely and add any instruction optimizations you want. And all those options could then be developed by people working on that "packaging project" - which I still hope to succeed one day. |
|||
01 Sep 2010, 12:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.