;fpav - floating-Point Absolute Value Example section .data ; ----- ; Define constants. TRUE equ 1 FALSE equ 0 EXIT_SUCCESS equ 0 ; successful operation SYS_exit equ 60 ; call code for terminate ; ----- ; Define some test variables. dZero dq 0.0 dNegOne dq -1.0 fltVal dq -8.25 ; ********************************************************* section .text global _start _start: ; ----- ; Perform absolute value function on flt1 movsd xmm0, qword [fltVal] ucomisd xmm0, qword [dZero] jae isPos mulsd xmm0, qword [dNegOne] movsd qword [fltVal], xmm0 isPos: ; ----- ; Done, terminate program. last: mov rax, SYS_exit mov rbx, EXIT_SUCCESS ; exit w/success syscall