It is currently Tue Aug 22, 2017 6:32 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Structure variables with inline asm
PostPosted: Tue Aug 08, 2017 2:53 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 2960
Location: Netherlands
Is it always valid to use structure variables like this
Code:
Structure test
  a.l
  b.l
EndStructure

v.test\a = 1

EnableASM
mov edx, 1
mov eax, v\a
add edx, eax
mov v\b, edx
DisableASM

Debug v\b

and if so, which registers are free to use (unaltered by the compiler when it encounters a structure variable) ?

_________________
MacOS 10.12, PB 5.51 x64


Top
 Profile  
Reply with quote  
 Post subject: Re: Structure variables with inline asm
PostPosted: Tue Aug 08, 2017 5:01 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1115
Location: Germany, Glienicke
Quote:
- On x86 processors, the available volatile registers are: eax, ecx and edx, xmm0, xmm1, xmm2 and xmm3. All others must be always preserved.
- On x64 processors, the available volatile registers are: rax, rcx, rdx, r8, r9, xmm0, xmm1, xmm2 and xmm3. All others must be always preserved.
http://www.purebasic.com/documentation/reference/inlinedasm.html

_________________
ImageImage


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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