Page 1 of 2
x_64 registers
Posted: Thu Jun 16, 2011 6:26 am
by Denis
Fred/Freak, there's no information about x_64 registers to use without saving them firt (eax, edx, ecx in x_86).
I've done search here but without succes. English PB help file is not available when installing PB x_64, so, it's not possible to take a look at it.
German doc is like french doc.
wich registers ?
Fred, please add these infos in help file.
Merci
Re: x_64 registers
Posted: Thu Jun 16, 2011 8:17 am
by Demivec
Denis wrote:which registers ?
rax, rdx, rcx in x_64
Re: x_64 registers
Posted: Thu Jun 16, 2011 8:30 am
by DarkDragon
This information isn't related to purebasic, so it should never get into the purebasic manual, should it?
Re: x_64 registers
Posted: Thu Jun 16, 2011 9:03 am
by Denis
Demivec wrote:Denis wrote:which registers ?
rax, rdx, rcx in x_64
Demivec, I think that's the same as x_86 (rax for eax etc.) but no infos for that (may be a thread on it but i didn't found it).
DarkDragon wrote:This information isn't related to purebasic, so it should never get into the purebasic manual, should it?
DarkDragon, why did you say that. It's related for x_86 in the PB help file. It's a possibility to code in asm with PB, so PB rules have to be known.
Thanks both.
Re: x_64 registers
Posted: Thu Jun 16, 2011 9:13 am
by Demivec
Denis wrote:Demivec wrote:Denis wrote:which registers ?
rax, rdx, rcx in x_64
Demivec, I think that's the same as x_86 (rax for eax etc.) but no infos for that (may be a thread on it but i didn't found it).
Yes it is the same, that's the point.
This is why I think this is true.
It would be nice if there was a note in the manual about it (for 64-bit in-line assembly).
Re: x_64 registers
Posted: Thu Jun 16, 2011 9:31 am
by DarkDragon
Denis wrote:DarkDragon, why did you say that. It's related for x_86 in the PB help file. It's a possibility to code in asm with PB, so PB rules have to be known.
That are assembler rules, not PB rules:
http://flatassembler.net/docs.php?article=manual#2.1.19
Re: x_64 registers
Posted: Thu Jun 16, 2011 9:44 am
by Demivec
To use inline assembler in PB you have to follow PB's rules, which may have originated in the document you linked to. Nevertheless they are also present in PB with regard to crafting assembly code that works alongside PB's language framework and it's foundations in assembly.
The registers that need to be preserved for x86 are listed in the manual under the 'Rules' heading of
'Inline x86 ASM'.
Re: x_64 registers
Posted: Thu Jun 16, 2011 10:10 am
by DarkDragon
Demivec wrote:
To use inline assembler in PB you have to follow PB's rules, which may have originated in the document you linked to. Nevertheless they are also present in PB with regard to crafting assembly code that works alongside PB's language framework and it's foundations in assembly.
The registers that need to be preserved for x86 are listed in the manual under the 'Rules' heading of
'Inline x86 ASM'.
Yes, well for this documentation part it might be senseful, but don't insert a whole assembler documentation into the purebasic help!
Denis sounded like he didn't know assembler and purebasic are two different things.
Re: x_64 registers
Posted: Thu Jun 16, 2011 10:48 am
by Denis
DarkDragon, i take a quickly look to the FASM doc (big doc) but i didn't find thoses rules.
I just want to have those infos in PB doc.
Re: x_64 registers
Posted: Thu Jun 16, 2011 10:55 am
by Demivec
DarkDragon wrote:Yes, well for this documentation part it might be senseful, but don't insert a whole assembler documentation into the purebasic help!
Agreed!

Re: x_64 registers
Posted: Thu Jun 16, 2011 11:07 am
by Shardik
DarkDragon,
I think that Denis only wants to have the equivalent statement for x64 to this rule in the help:
Inline x86 ASM help wrote:- The available volatile registers are: eax, edx and ecx. All others must be always preserved.
So that he knows which x64 registers he has to preserve in his x64 asm code block...

Re: x_64 registers
Posted: Thu Jun 16, 2011 11:59 am
by Helle
Re: x_64 registers
Posted: Thu Jun 16, 2011 12:02 pm
by remi_meier
Re: x_64 registers
Posted: Thu Jun 16, 2011 12:21 pm
by DarkDragon
Denis wrote:DarkDragon, i take a quickly look to the FASM doc (big doc) but i didn't find thoses rules.
I just want to have those infos in PB doc.
I posted a link to it! It scrolls right there after loading the page.
Do you also expect all the assembler keywords inside the PB doc? That would mess everything up like hell.
@Shardik: but for now it sounds like he wants everything inside the PB documentation.
[EDIT]
Ok, do what you want to.
Re: x_64 registers
Posted: Thu Jun 16, 2011 12:21 pm
by Trond
No, in pure assembly you can use registers are you please. This information tells us which registers PB expect NOT to change and which PB expect to change. We can't know what PB expects unless it says in the manual.