CQWOne: fld [CQWBuffer] fld [CQW01] fcom;Compare ST(0) with ST(1) fstsw ax sahf;Store ah in flags. jc CQWTwo fsub [CQW01] fst [CQWBuffer] jmp CQWOne CQWTwo: hlt;Just here for testing purposes. CQWBuffer dq 0FFFFFFFFFFFFFFFFh CQW01 dq 10000000000000000000d CQW02 dq 1000000000000000000d CQW03 dq 100000000000000000d CQW04 dq 10000000000000000d CQW05 dq 1000000000000000d CQW06 dq 100000000000000d CQW07 dq 10000000000000d CQW08 dq 1000000000000d CQW09 dq 100000000000d CQW10 dq 10000000000d CQW11 dq 1000000000d CQW12 dq 100000000d CQW13 dq 10000000d CQW14 dq 1000000d CQW15 dq 100000d CQW16 dq 10000d CQW17 dq 1000d CQW18 db 100d CQW19 db 10d CQW20 db 1d
| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Fpu Help
Started by ghostrider, Aug 24 2006 02:37 AM
1 reply to this topic
#1
Posted 24 August 2006 - 02:37 AM
I'm new to using the FPU in assembly, the 'Stack Fault' bit in the Status Word is always set, and I'm not quite sure what this means. Has anyone else encountered this problem? My code is posted below. It will eventually take a 64-bit variable and turn it into a number that a human can understand.
#2
Posted 26 September 2006 - 01:50 AM
I don't know if you're still looking for an answer, but here's one: (finally)
Quote
The SF field (bit6) or Stack Fault exception is set whenever an attempt is made to either load a value into a register which is not free (the C1 bit would also get set to 1) or pop a value from a register which is free (and the C1 bit would get reset to 0). (Such stack fault is also treated as an invalid operation and the I field flag bit0 would thus also be set by this exception; see below.)
So basically either a) you tried to write over a register you loaded b)you forgot to clear the FPU registers.
a)doesn't really seem like it. I might have to go over it a few times, but it seems like clean code.
b)hmm... have you tried FFREEing your registers first? Because they're usually loaded before
you run your code. FFREE x - clears fpu register x.
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














