Commented ASM

Mac OSX specific forum
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Commented ASM

Post by wilbert »

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. :?
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Commented ASM

Post by Shardik »

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: Select all

; 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!
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Commented ASM

Post by mk-soft »

Command line:
/{path to purebasic}/PureBasic.app/Contents/Resources/compilers/pbcompiler
Arguments:
-c "%FILE"
Arguments (thread safe):
-c -t "%FILE"
Arguments DyLib:
-c -dl "%file"
Arguments Dylib (thread safe):
-c -t -dl "%file"
Tip
The compiler don't like space character into the path to PureBasic.app for create DyLib´s
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Commented ASM

Post by wilbert »

Thanks a lot Shardik and mk-soft.
Both solutions are working fine :)
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply