Page 1 of 1
viewing pb's asm output
Posted: Tue Nov 22, 2011 7:03 pm
by Tenaja
How do you view pb's asm output so you can edit it, and then run it back through the assembler?
EDIT: Two different solutions for viewing the PureBasic assembly output code are given 5 posts down.
Re: viewing pb's asm output
Posted: Tue Nov 22, 2011 7:56 pm
by Shield
Call the PB compiler manually using the /COMMENTED flag, modify the ASM file and call it again with the /REASM help.
There is a whole section in the help about this.
Although this feature seems cool it's not very useful because you'd have to change the ASM file every time...
Re: viewing pb's asm output
Posted: Tue Nov 22, 2011 8:14 pm
by Tenaja
Yup, you are right... unless you have a Tool that runs every time...
And thank you. I have found the Command Line Compiler page in the help file.
Re: viewing pb's asm output
Posted: Tue Nov 22, 2011 8:18 pm
by Tenaja
Is there no way to get the /COMMENTED asm file from within the IDE without creating a Tool?
Thanks again.
Re: viewing pb's asm output
Posted: Tue Nov 22, 2011 8:34 pm
by luis
I don't think so. At minimum you have to write a simple batch file or something like that.
You should find something searching on the forum.
Re: viewing pb's asm output
Posted: Tue Nov 22, 2011 9:21 pm
by Tenaja
Got it. I will add it here, so it is in the Assembly forum. This is the source thread, showing both IDE and Batch File methods:
http://purebasic.fr/english/viewtopic.php?f=12&t=30864
I am using srod's with success. Trond's has a link to another.
srod wrote:just a simple tool which you may or may not find of some use. All it does is take the current source you have open in the PB IDE and generates the corresponding assembly code and loads it into notepad etc.
Compile to "commentedASM.exe" :
Code: Select all
file$=ProgramParameter(0)
dir$ = GetPathPart(file$)
DeleteFile(dir$+"PureBasic.asm")
If file$ And FileSize(file$)>0
Compiler = RunProgram(#PB_Compiler_Home+"\Compilers\pbcompiler", Chr(34)+file$+Chr(34)+" /commented", dir$, #PB_Program_Hide|#PB_Program_Wait)
dir$+"PureBasic.asm"
If Compiler And FileSize(dir$)>=0
RunProgram("notepad.exe", dir$,"")
Else
MessageRequester("Error!", "There was an error creating the assembly code file.")
EndIf
EndIf
Now add the commentedASM.exe tool to the IDE tools menu by selecting "Configure Tools".
(Make sure that you select the name of the commentedASM.exe (with full path) in the CommandLine option.
In the 'Arguments:' control enter "%TEMPFILE" with the quotes. Select the 'Run Hidden' checkbox.)
**EDIT : change the command RunProgram("notepad.exe", dir$,"") to simply RunProgram(dir$) if your system is set up to deal directly with .asm files etc.
Trond wrote:I won't say that
I already made this (oups there I said it), because I'm not using it any more. Instead I use a bat file:
Code: Select all
@echo off
cd "c:\programfiler\purebasic 4\compilers"
pbcompiler %1 /COMMENTED
if errorlevel 1 goto wait
start PureBasic.asm
exit
:wait
pause
The advantage is that it pauses to show you the compilation error if any.