1

Trying to print out floating point number from st0 register.

Currently I have to pass the value through xmm0 register then call c function printf.

is there any way to pass the value from the st0 register straight into printf?

user1050632
  • 680
  • 4
  • 13
  • 26
  • Related: [How to print a single-precision float with printf](https://stackoverflow.com/q/37082784) you need to print it as a `double` or `long double`, passed in xmm0 or the stack respectively. – Peter Cordes May 25 '22 at 19:25

1 Answers1

2

the x86-64 ABI's require that you use XMM registers to pass around floating point values, so unless you write a custom printf that uses your own ABI (calling convention), there is really no way around this.

Necrolis
  • 25,836
  • 3
  • 63
  • 101