Started by Theo Gottwald, October 21, 2013, 07:55:45 AM
0 Members and 1 Guest are viewing this topic.
QuoteThe issue with the gosub implementation in procdures perhaps was due to the single passcompilation, the specific issue would arise from select statements where PureBasic uses the stackso when either a gosub or goto is used to exit from within a select statement it will either result in reading the wrong local variables or produce an IMA on returning from the procedure.So It appears Fred disallowed gosub within procedures. I've provided macro replacements for goto and gosub with FASM preprocesor directives to handle this issue, you just need to use a depth parameter if you're exiting a select
Function PBMain () As Long Local i As Long For i = 1 To 3 ! jmp lbl_show lbl_ret: Next i Exit Functionlbl_show: ? Str$(i) ! jmp lbl_ret End Function'' and these macros'Macro p_return (lbl) ! jmp lbl_retEnd MacroMacro p_gosub (lbl) ! jmp lbl_show lbl_ret:End Macro
Quote from: Aslan Babakhanov on October 21, 2013, 10:28:15 PMPurebasic to fasm translator is not that complex and smart as it should be from the first sight.
Quote from: José Roca on October 21, 2013, 10:39:48 PMWrong. it is a three pass compiler.
FOR I=0.001 TO 0.78 STEP 0.01
Quote from: José Roca on October 22, 2013, 06:43:12 AMDon't believe all what you read. Older versions of the compiler where two-passes. A third pass was added in PB9 to handle forward references. Most "indie" basics, like Pure Basic and FreeBasic, are single pass, which is inefficient.
Quote from: Theo Gottwald on October 22, 2013, 10:39:28 AMBrice, you have wrong informations.
Quotemost of the optimization by Fred seems to have been in the libs as opposed to the compiler.
Quote, as dependence on a single operating system, restrictions in the inline assembler, limited graphics capabilities, higher development costs, longer development cycles,
Page created in 0.286 seconds with 20 queries.