Structure variables with inline asm

Bare metal programming in PureBasic, for experienced users
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
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) ?
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
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 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Post Reply