/* file "dtimeb.s" (For Metware High C/C++ Compiler/Assembler) Assembly language routine to convert 64-bit PowerPC TB facility to Double-precision, floating-point number. (Plus additional routines for testing.) CJC 981216 (separation of test routines.) MRR 000327 */ .text .global conversion .global conversion_test .global float_test // Routine passed sample values of TBU and TBL. // Returns FPU and FPL as unsigned long. //For CodeWarrior: //asm struct TB_View * conversion_test(unsigned long Upper, // unsigned long Lower, double TICS) conversion_test: or r5,r3,r3 //Use test values of TBU and TBL passed in r3 and r4 or r6,r4,r4 //as substitutes for values read from TB. mflr r11 //Save the return address. bl conversion //Convert TBU and TBL into FPU and FPL mtlr r11 //Return in r3 and r4 //For CodeWarrior: // la r3,Local_pointer(SP) //Return a pointer to the FPU storage location. blr // Routine passed sample values of TBU and TBL. Returns seconds as double. //For CodeWarrior: //asm double float_test(unsigned long Upper, unsigned long Lower, double TICS) float_test: or r5,r3,r3 //Use test values of TBU and TBL passed in r3 and r4 or r6,r4,r4 //as substitutes for values read from TB. mflr r11 //Save the return address. bl conversion //Convert TBU and TBL into FPU and FPL mtlr r11 //Return as double in fpr1 blr