I'm trying to write a calculator program in assembly for the Apple //e. I know that there are built-in subroutines for performing all kinds of math operations involving the floating-point accumulator (FAC), and I'd like to use those, but I don't know how to convert the set of hex digits the user inputs into memory into the format required for the FAC (exponent + mantissa, explained in great detail on p.100 of "Inside the Apple IIe" by Gary B. Little). I know about
I'm trying to use FRMNUM ($DD67) and PRNTFAC ($ED2E) to carry out the math and print the result, but I can't findit's not working.
Below is a sample program designed just to add 1 and 1 and print 2, but the program winds up in a loop.
It puts the data 31 c8 31 00 (= 1 + 1) at memory address $7000, points TXTPTR (which is the pointer used by the FRMNUM subroutine) at that Applesoft uses to take a decimal numberaddress, runs FRMNUM and convert it tothen runs PRNTFAC which should print the six-bit exponent-mantissa formatresult on the screen.
It doesn't. It winds up in a loop somewhere in the $DD's, ie in FRMNUM.