the relational operator "JNL" does not work together with "COMISD" when used with floating point numbers, it only works with integers when used with "CMP" operator. See C code below using COMISD with "JNL".
CODIGO EM C:
float total = 7.3;
float media = 2.2;
main() {
if(!total < media){
write(total);
}
}
CODIGO EM ASM X64:
extern printf
extern scanf
section .data
fmt_f: db "%.2f", 0
total: dq 7.30
media: dq 2.20
section .text
global main
main:
mov qword [total], 0 ; (!total)
movsd xmm0, [total]
movsd xmm1, [media]
comisd xmm0, xmm1
jnl label0
sub rsp, 8
movsd xmm0, qword [total]
mov rdi,fmt_f
mov eax, 1
call printf
add rsp, 8
label0:
mov rax,0
ret
If you change the operator "JNL" to "JNG", in the two cases where "if(!total < average)" and "if(total < average)" are true and printf is executed, which is not true. Could you help me understand what happens?