Structure variables with inline asm

Bare metal programming in PureBasic, for experienced users
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3734
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Structure variables with inline asm

Post 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) ?
macOS 10.15 Catalina, Windows 10
User avatar
STARGÅTE
Addict
Addict
Posts: 1495
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Structure variables with inline asm

Post 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
PB 5.73 ― Win 10, 20H2 ― Ryzen 9 3900X ― Radeon RX 5600 XT ITX ― Vivaldi 3.6 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Post Reply