It is currently Fri Apr 10, 2020 10:10 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: viewing pb's asm output
PostPosted: Tue Nov 22, 2011 7:03 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1626
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.


Last edited by Tenaja on Wed Nov 23, 2011 7:23 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: viewing pb's asm output
PostPosted: Tue Nov 22, 2011 7:56 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jan 21, 2011 8:25 am
Posts: 1021
Location: 'stralia!
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...

_________________
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds


Top
 Profile  
Reply with quote  
 Post subject: Re: viewing pb's asm output
PostPosted: Tue Nov 22, 2011 8:14 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1626
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: viewing pb's asm output
PostPosted: Tue Nov 22, 2011 8:18 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1626
Is there no way to get the /COMMENTED asm file from within the IDE without creating a Tool?

Thanks again.


Top
 Profile  
Reply with quote  
 Post subject: Re: viewing pb's asm output
PostPosted: Tue Nov 22, 2011 8:34 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3695
Location: Italy
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.

_________________
[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: viewing pb's asm output
PostPosted: Tue Nov 22, 2011 9:21 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1626
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:
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:
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:
@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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye