Assembleur avec float
Publié : sam. 29/avr./2006 18:31
Je ne sais pas si ma question est bête, mais comment fait-ton pour utiliser des floats avec l'assembleur (déja des trucs basiques genre add, sub, mul, etc....)?
Code : Tout sélectionner
x = 5
y = 5
!mov eax, [v_x]
!mov ebx, [v_y]
!cmp eax, ebx
!jz ici
End
!ici:
Debug "yo"
Code : Tout sélectionner
x = 5
y = 5
If x = y
debug 1
endif
Code : Tout sélectionner
x = 5
y = 6
!mov eax, [v_x]
!mov ebx, [v_y]
!cmp eax, ebx
!jnz ici
End
!ici:
Debug 1
Code : Tout sélectionner
x = 5
y = 6
if x <> y
debug 1
endif
Code : Tout sélectionner
x = 5
y = 6
if x < y
debug 1
endif
Code : Tout sélectionner
Mnemonic Condition tested Description
o OF = 1 overflow
no OF = 0 not overflow
c CF = 1 carry
b CF = 1 below
nae CF = 1 not above nor equal
nc CF = 0 not carry
ae CF = 0 above or equal
nb CF = 0 not below
e ZF = 1 equal
z ZF = 1 zero
ne ZF = 0 not equal
nz ZF = 0 not zero
be CF or ZF = 1 below or equal
na CF or ZF = 1 not above
a CF or ZF = 0 above
nbe CF or ZF = 0 not below nor equal
s SF = 1 sign
ns SF = 0 not sign
p PF = 1 parity
pe PF = 1 parity even
np PF = 0 not parity
po PF = 0 parity odd
l SF xor OF = 1 less
nge SF xor OF = 1 not greater nor equal
ge SF xor OF = 0 greater or equal
nl SF xor OF = 0 not less
le (SF xor OF) or ZF = 1 less or equal
ng (SF xor OF) or ZF = 1 not greater
g (SF xor OF) or ZF = 0 greater
nle (SF xor OF) or ZF = 0 not less nor equal
Ex:
--
cmp dword [v_variable], eax ; compare v_variable with the value in eax.
je .equal_to ; Jump if v_variable is equal to eax, etc.
jne .unequal_to
jg .greater_than ; for signed numbers
jl .less_than ; for signed numbers
ja .above ; for unsigned numbers
jb .below ; for unsigned numbers
jge .greater_than_or_equal_to ; for signed numbers
jle .less_than_or_equal_to ; for signed numbers
jae .above_or_equal ; for unsigned numbers
jbe .below_or_equal ; for unsigned numbers