It is currently Tue Dec 11, 2018 12:35 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Commented ASM
PostPosted: Wed Jul 04, 2018 10:16 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3268
Location: Netherlands
How can I make this work on MacOS ?
I know I've used it in the past, when the compiler etc. were not yet moved inside the PureBasic app but now everything is inside the PureBasic app I can't seem to get it working. :?

_________________
macOS 10.14 Mojave, PB 5.62 x64


Top
 Profile  
Reply with quote  
 Post subject: Re: Commented ASM
PostPosted: Thu Jul 05, 2018 10:31 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1571
Location: Germany
The following is working for me on MacOS 10.13.4 'High Sierra' with PB 5.62 x64. I have taken srod's original example code and modified it for MacOS:
Code:
; http://www.purebasic.fr/english/viewtopic.php?f=12&t=30864&start=0
; srod

; Modifications for MacOS by Shardik:
; -----------------------------------
; - Backslashes changed to slashes
; - " /commented" changed to " -c"
; - "\Compilers\pbcompiler" changed to "Compilers/pbcompiler" 
; - RunProgram("notepad.exe, dir$,"") changed to RunProgram("Open", dir$, "")

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) + " -c", dir$,
    #PB_Program_Hide | #PB_Program_Wait)
  dir$+"PureBasic.asm"
  If Compiler And FileSize(dir$)>=0
    RunProgram("Open", dir$, "")
  Else
    MessageRequester("Error!",
      "There was an error creating the assembly code file.")
  EndIf
EndIf

- I compiled it to /Volumes/DATEN/Displayx64AsmCode.app
- I opened Tools > Configure Tools... and filled in the form as in the following image. Unfortunately the shown path is truncated in the Edit Tool Settings and is the following in full length:
/Volumes/DATEN/Displayx64AsmCode.app/Contents/MacOS/Displayx64AsmCode

Image

- Afterwards the new tool entry looked like this:

Image

- It may further be necessary to assign an editor like TextEdit to purebasic.asm so that purebasic.asm is automatically opened in TextEdit!


Top
 Profile  
Reply with quote  
 Post subject: Re: Commented ASM
PostPosted: Thu Jul 05, 2018 10:39 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 1475
Location: Germany
Command line:
Quote:
/{path to purebasic}/PureBasic.app/Contents/Resources/compilers/pbcompiler

Arguments:
Quote:
-c "%FILE"

Arguments (thread safe):
Quote:
-c -t "%FILE"

Arguments DyLib:
Quote:
-c -dl "%file"

Arguments Dylib (thread safe):
Quote:
-c -t -dl "%file"


Tip
The compiler don't like space character into the path to PureBasic.app for create DyLib´s

_________________
My Projects OOP-BaseClass / OOP-BaseClassDispatch / Event-Designer /
PB v3.30 / v5.60 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Commented ASM
PostPosted: Fri Jul 06, 2018 4:49 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3268
Location: Netherlands
Thanks a lot Shardik and mk-soft.
Both solutions are working fine :)

_________________
macOS 10.14 Mojave, PB 5.62 x64


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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