Using pbcompiler without running program

Just starting out? Need help? Post your questions and find answers here.
Jeff88
New User
New User
Posts: 8
Joined: Thu Jan 03, 2019 3:05 am

Using pbcompiler without running program

Post 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
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Using pbcompiler without running program

Post 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
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 559
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Using pbcompiler without running program

Post 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
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Post Reply