.title pfcmp .ident /840901/ ; This compares two short reals on the stack and sets the condition ; codes to reflect whether the first operand is : ; ; 1. less than ; 2. equal to ; 3. greater than ; ; the second. Both operands are popped off the stack upon exit. ; No registers used. ; .psect $$$097:: clr -(sp) ;start off equal cmp 10(sp),4(sp) ;have a look bgt gt blt lt ; cmp 12(sp),6(sp) ;must look at rest of mantissa bhi gt ;definitely bigger blo lt ;definitely smaller br eq ;definitely equal ; gt: inc (sp) br neg ; lt: dec (sp) ; neg: tst 10(sp) bpl eq tst 4(sp) bpl eq neg (sp) ;both negative, flip result ; eq: mov (sp)+,6(sp) ;clear stack mov (sp)+,6(sp) cmp (sp)+,(sp)+ tst (sp)+ rts pc .end