//--------------------------------------------------------------- // det.s // // Here is an implementarion for the determinant function // for a 2-by-2 array of single-precision floating-point // values. // // float det( float a, float b, float c, float d ); // // assemble using: $ as det.s -o det.o // // programmer: ALLAN CRUSE // written on: 04 DEC 2003 //---------------------------------------------------------------- .text det: pushl %ebp movl %esp, %ebp finit flds 8(%ebp) # load a flds 20(%ebp) # load d fmulp %st, %st(1) # compute a*d flds 12(%ebp) # load b flds 16(%ebp) # load c fmulp %st, %st(1) # compute b*c fsubrp %st, %st(1) # compute a*d - b*c popl %ebp ret .globl det