0

I'm trying to compare two float values in x86_64 Assembly. I'm new to it and I don't know where I should include the if statement.

ucomisd xmm15, xmm14
ja first_num_greater
jle second_num_greater

What I have is this ^, what I think I should be doing is creating

first_num_greater db
second_num_greater db 

in my segment .data section. I'm a bit confused here and I'm unsure of where to head next or if I'm even correct with this idea.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
cheaseeds
  • 21
  • 2
  • 2
    Why would you want to define bytes? You want those to be labels in your code, where you want execution to continue. Also note that `jle` is wrong, it should be `jb`. – Jester Sep 06 '22 at 00:03
  • You only need one branch, to jump or fall-through. (Unless you want to distinguish between equal vs. below, then you need two branches. And yet another branch if you want to distinguish unordered (one or both operands being NaN, resulting in PF being set)). As usual, look at compiler output for examples: [How to remove "noise" from GCC/clang assembly output?](https://stackoverflow.com/q/38552116) – Peter Cordes Sep 06 '22 at 00:17

0 Answers0