[5.60 X86] PBCompiler /COMMENTED
Posted: Wed Oct 11, 2017 1:39 pm
If I'm trying to create a user library with this test code, I'm having a weird behavior when I test the result with PureBasic 5.60 x86.
■ User library creation test code.
■ To create this user library, I use the tools present in the Purebasic installation folder.
- pbcompiler. exe /COMMENTED to get the ASM file
- fasm. exe to get the obj file
- LibraryMaker. exe to obtain the user library.
■ The user library is created.
I test the result with this code.I should get "no bug" but in fact, I get "bug".
■ An extract from the ASM code
Last line: If I replace RET by RET + 4 The result is correct "no bug".
I don't have this problem with the x64 versions of PureBasic. That's why I think it's a bug with pbcompiler. exe (x86)
■ User library creation test code.
Code: Select all
ProcedureDLL.s Dummy()
ProcedureReturn "bug"
EndProcedure
- pbcompiler. exe /COMMENTED to get the ASM file
- fasm. exe to get the obj file
- LibraryMaker. exe to obtain the user library.
■ The user library is created.
I test the result with this code.
Code: Select all
Debug "no " + Dummy()
■ An extract from the ASM code
Code: Select all
; ProcedureDLL.s Dummy()
public PB_Dummy
PB_Dummy:
PS0=4
; ProcedureReturn "bug"
MOV edx,_S1
PUSH dword [_PB_StringBasePosition]
PUSH edx
CALL _SYS_CopyString@4
POP eax
ADD eax,[PB_StringBase]
JMP _EndProcedure1
; EndProcedure
_EndProcedureZero1:
MOV eax,[_PB_StringBasePosition]
ADD eax,[PB_StringBase]
MOV word [eax],0
_EndProcedure1:
RET

I don't have this problem with the x64 versions of PureBasic. That's why I think it's a bug with pbcompiler. exe (x86)