falsam wrote: But i think there is a bug with pbcompiler. exe option /COMMENTED (Version x86)
Possible. Ok, i don't understand x86-Assembler, but I understand c64 and Atari-ST-Assembler and know how things work there. A change from "RET" to "RET +4" is not a simple or small error. It is a huge error. It will cause a corrupt stack and this is reallly bad and maybe one of the difficult to find errors. I personal y think, that when it is a bug, it has crash a long time before this.
The problem is: You don't understand assembler. You don't understand what you doing. It is more a try and error. When it doesn't work, try something else until it works. That in this case a very bad method of programming. Maybe it solve the problem in this one spezific way, but not in every position.
Have you read the readme in the SDK-folder? There is a discription how strings should be handled. And as my code-example aboves show: A Userlibrary must handle strings different from an "purebasic"-Procedure. PB does a complete different "call". So you use the Userlibrary in an undocumented way. Thats the problem. Thats also way the Program crash, when you try a MLF-Userlibrary with an array in the parameter.
There are other problems: Have you try to understand your ASM-Code for the Userlibrary? There are many "Public" in there. There are original designed to export this labels for other thing (PB-Libraries for example). Your code also export them.
Now you have to parts who export this label - the original PB-Main-File and your userlib. You have luck, that the linker seems to prefer the original-PB-Main-File and not your lib. Also it is possible, that the code in your userlib need the access to the label of the PB-Main-File, because it should be "extrn". It will fail and use the wrong one. Funny things can happen.
Also you handle Integers complete wrong.
Code: Select all
Case "i", "l"
ProcedureType = "Long | StdCall"
on a x86 system this is correct, but under x64 an integer is a quad! I use the Integer, when i want to return a pointer. Because a pointer is under x86 a long and under x64 a quad.
At the current state, i would say, that MLF is a very early alpha stage. With a high risk of bugs. Don't use it in productive systems. And maybe this thread should be moved to a different forum.
I personal y think, this bugs can be only solved, when LibraryMaker support not a new third Type (besides OBJ and LIB): PBOBJ. So the userlibs are called like a PB-Generated-Routine. But in this case, Fred should make the small step to add inbuild lib creation support
I really like the idea, but the next step is: Learn Assembler to understand, what the problem is.
I think, it has a reason, why tailsbite died. Includes seems to be the much better way, with a higher chance of compatibility with future PB-Version.