;A = previous value = 1.0
;B = read value = 1.0
;C = step value = 1.2
fld A ; previous value
fld B ; read value
fcomp ; compare b to a
fnstsw ; move fpu code flags to ax reg
test ah,40h ; test to see if b == a
jmp @@same ; they are the same so we skip here
; they are not the same so continue
fmul C ; multiply st(0) [or B] by the step value
fstp A ; pop it off as A (so it can be read again next time)
@@same:
;do some stuff and eventually loop back to compare again
the previous value (A) is defined by default as 0.0
B will initially be read as 1.0
this means the comparison should value and it will multiply 1 by the step (C),
or 1.2, essentially turning B itself into 1.2
we will then pop this value off as A (again, it will be 1.2 now)
after it loops, it will push the previous value (A), or 1.2, on to the stack
it will then read B again, and in this case it will be 1.2
it compares these again and they are the same, so it skips the multiplication
it will eventually do some stuff and loop back to compare again
(in case anything changed the value of B)
however, this does not work and i get some value returned such as -21474.8364