It is currently Sat Jan 23, 2021 2:00 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Assembler problems
PostPosted: Sat Nov 21, 2015 8:39 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3710
Location: Netherlands
I tried a very simple instruction
Code:
!movq rax, xmm0
which is not working on PB 5.40 Linux (x64).

When I started comparing assembler versions that come with PureBasic, I wasn't surprised.

PB 5.40 (x64) OSX comes with YASM 1.2.0 from 2012
PB 5.40 (x64) Windows comes with FASM 1.69.35 from 2011
PB 5.40 (x64) Linux comes with FASM 1.67.18 from 2006 :(

I just don't understand why those aren't updated.
It makes it very difficult to write cross platform code this way that works on all systems.
I just don't know how to make my sha3 module code work now on all three systems.
I need to move 64 bit values between a xmm register and a 64 bit register and it just doesn't seem possible on Linux out of the box.
Anyone has a suggestion that works with the fasm version that comes with PB ?

_________________
macOS 10.15 Catalina, Windows 10


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Sat Nov 21, 2015 9:06 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1672
+10!!! how nice would it be (but not just nice, important) to have the latest assemblers as part of PB :) :) :) and its nearly Christmas, Fred!

surely all of those assemblers have had a lot of bugs fixed in the 3-9 years since, not to mention new optimizations and features for us to take advantage of and empower our Purebasic abilities :)

wilbert i know that for forcing undocumented or unsupported stuff you can use raw !db bytes in the code instead, for all assemblers i think? as i know you know!
so i went into Hopper seeing as we're both playing with that today heehee...
First go to Main menu -> Preferences, and click "Show Hex Column" to see the raw bytes alongside the disassembly.
And now with any random binary open go to an instruction, and click Modify menu -> Assemble Instruction, and enter your "movq rax, xmm0", and it will assemble it for you to: 66 48 0F 7E C0 :)
not fun though when you just want to program :(

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Last edited by Keya on Sat Nov 21, 2015 10:01 pm, edited 7 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Sat Nov 21, 2015 9:11 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3710
Location: Netherlands
@Keya, I know using hex bytes is possible but in this case rax and xmm0 is just an example.
I need multiple general purpose registers (r8, r9, r10, r11 and r12) and multiple xmm registers.
It would be very inconvenient to have to use a different byte sequence for each combination of registers.

_________________
macOS 10.15 Catalina, Windows 10


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Sat Nov 21, 2015 9:14 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1672
yes and it's slow-going and ugly code too :( but i think the only workaround besides having fasm updated? fingers crossed!

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Sat Nov 21, 2015 10:00 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1809
Location: Uttoxeter, UK
+1 for latest assembler versions.

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Sun Nov 22, 2015 4:18 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France
I will see what can be done.


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Sun Nov 22, 2015 4:43 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1672
Thankyou soooo much for looking into it Fred. I think we can all appreciate that if anything major has changed in the assembler itself then it's not going to be just a trivial matter of switching one binary for another! but hopefully it'll be a smooth transition! fingers crossed and best luck :) :) :)

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Sun Nov 22, 2015 5:11 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3710
Location: Netherlands
Fred wrote:
I will see what can be done.

Thank you very much :)

_________________
macOS 10.15 Catalina, Windows 10


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Tue Nov 24, 2015 7:56 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France
All updated to lastest versions


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Tue Nov 24, 2015 8:52 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3710
Location: Netherlands
That's great !!! :D

_________________
macOS 10.15 Catalina, Windows 10


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Tue Nov 24, 2015 9:45 am 
Offline
User
User

Joined: Wed Aug 06, 2008 8:21 am
Posts: 72
Fred wrote:
All updated to lastest versions

Thank you very much :!:

_________________
PureBASIC v5.41 LTS , Windows v8.1 x64
Forget UNICODE - Keep it BASIC !


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Tue Nov 24, 2015 10:25 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1672
but Christmas isn't until December heehee :) :) :) exciting times, thankyou sooooo much Fred!!!!!!!!

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Thu Nov 26, 2015 4:44 pm 
Offline
User
User

Joined: Sat May 10, 2008 7:52 am
Posts: 38
Location: SecondLife
wilbert wrote:
It makes it very difficult to write cross platform code this way that works on all systems.


Cross platform assembly ??? :mrgreen:


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Thu Nov 26, 2015 5:33 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3710
Location: Netherlands
ker2x wrote:
wilbert wrote:
It makes it very difficult to write cross platform code this way that works on all systems.


Cross platform assembly ??? :mrgreen:

Yes, cross platform assembly.
Windows, OSX and Linux all use a x86 / x64 processor.
There are some differnces between fasm and yasm/nasm but if you pay attention to those you can write cross platform assembly code.

_________________
macOS 10.15 Catalina, Windows 10


Top
 Profile  
Reply with quote  
 Post subject: Re: Assembler problems
PostPosted: Fri Nov 27, 2015 5:16 pm 
Offline
User
User

Joined: Sat May 10, 2008 7:52 am
Posts: 38
Location: SecondLife
only very partially then. Since they have different function call conventions.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

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