Personally I prefer the inline approach Keya demonstrated.
As far as I remember, the way labels are named hasn't always been the same across different PB versions.
It also looks inconsistent to me that the label you have to use for the jump instruction is different form the label declaration itself.
By coding manually, I have full control and know things are working as they should.
wilbert wrote:Personally I prefer the inline approach Keya demonstrated.
As far as I remember, the way labels are named hasn't always been the same across different PB versions.
It also looks inconsistent to me that the label you have to use for the jump instruction is different form the label declaration itself.
By coding manually, I have full control and know things are working as they should.
Yes, you are right. The way labels work in asm have changed at least two times the last years. I would like to have something more "stable", something that will last regardless PB changes. Is Keya's approach this kind of "stable"?
The dot syntax Helle mentioned seems to work fine on OSX.
Anonymous labels (@f with @@) are not supported on OSX. Nasm/Yasm doesn't support this.
If you want your Asm code to be cross platform compatible, don't use them.
sys64802 wrote:Thank you, but out of curiosity it's nasm or yasm used on osx ?
Both
PureBasic uses yasm for the 64 bit version of PureBasic on OSX and nasm for the 32 bit version.
Don't ask me why because I have no idea why Fred made this choice.
To me it would be more logical to choose one of the two and use it for both 32 and 64 bit.
the repository contains a flat assembler version that will run on Macintosh OS X 10.6-10.11 (both x86 and x86_64).
Even though this isn't an officially supported FAsm version, and won't be guaranteed to be always updated along with latest official FAsm releases, it would be nice if in the upcoming PureBasic versions there was an option to use the FAsm compiler on Mac, instead of Yasm/MASM. I wonder if this is possible ...
If Mac where to support FAsm then there would no longer be the cross-compatiblity issue that is currently introduced by the presence of ASM code in PB sources.