flat assembler
Message board for the users of flat assembler.
Index
> Tutorials and Examples > [solved] How to use FPU flags for jumps? |
Author |
|
revolution 09 May 2021, 21:30
The instruction you probably want is FSTSW AX.
And if you are in 32-bit code, then SAHF to transfer them to EFLAGS. The FPU flags line up with the CPU well. It was designed with this sequence in mind. |
|||
09 May 2021, 21:30 |
|
Overclick 09 May 2021, 22:22
Thanks man
|
|||
09 May 2021, 22:22 |
|
revolution 10 May 2021, 00:44
Also, if your target CPUs are all AMD or Intel, and produced after aprox. December 2005, then it supports SAHF in 64-bit mode.
Windows 8.1 and later require the CPU to support 64-bit SAHF, so if your target OSes are one of those then it will be fine. |
|||
10 May 2021, 00:44 |
|
DimonSoft 10 May 2021, 20:04
Also there’re fcomi[p] instructions which set EFLAGS directly according to comparison result. Emulator support is quite poor though (AFAIR, DOSBox is bad at emulating them for DOS programs).
|
|||
10 May 2021, 20:04 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.