Page 1 of 1

Using pbcompiler without running program

Posted: Thu Jan 24, 2019 8:39 pm
by Jeff88
Occasionally I like to view the assembler generated by PB, I use the program below and modify the first line for the program I want to view. I found this code somewhere else in the forum. Is there someway to modify the call to the pbcompiler so that the program is not executed--just create the asm file? Something like a switch for pbcompiler like /NORUN.

Code: Select all

file$="timeloop.pb"
dir$ = GetPathPart(file$)
If file$ And FileSize(file$)>0
  Compiler = RunProgram(#PB_Compiler_Home+"\Compilers\pbcompiler", Chr(34)+dir$+file$+Chr(34)+
    " /commented", dir$, #PB_Program_Hide|#PB_Program_Wait)
  If Compiler  
    dir$+"PureBasic.asm"
    RunProgram("notepad.exe", dir$,"")
  EndIf
EndIf

Re: Using pbcompiler without running program

Posted: Fri Jan 25, 2019 8:51 am
by #NULL
There is the --check switch, but I think it doesn't work with --commented. But you can try creating an executable as srod mentioned here: viewtopic.php?p=234541#p234541

Re: Using pbcompiler without running program

Posted: Fri Jan 25, 2019 3:41 pm
by Sicro
In the CodeArchiv there is a PB-IDE-Tool, which can display the ASM-Code of the current PB-Code: DisplayASMCode

Code: Select all

; Tool Settings:
; - Arguments: "%HOME" "%FILE" "%TEMPFILE"
; - Event: Menu Or Shortcut