Page 1 of 1

Structure variables with inline asm

Posted: Tue Aug 08, 2017 2:53 pm
by wilbert
Is it always valid to use structure variables like this

Code: Select all

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) ?

Re: Structure variables with inline asm

Posted: Tue Aug 08, 2017 5:01 pm
by STARGĂ…TE
- 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/ ... edasm.html