Skip to main content
3 of 7
added 450 characters in body
Raffzahn
  • 249.4k
  • 23
  • 722
  • 1k

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

I have a strong feeling that this is not about hex, but binary integers, 16 bit or more.

I know about FRMNUM ($DD67) and PRNTFAC ($ED2E), but I can't find the subroutine that Applesoft uses to take a decimal number and convert it to the six-bit exponent-mantissa format.

You're already on the right track. For example GIVAYF ($E2F2 *1) converts a 16 bit integer held in A/Y (High/Low) into a floating point number in FAC.

Of course this is less handy if your numbers are not straight integers, but some format of your own - which brings us to what might bet the primary issue:

Where is your data is originated?

Is it from some internal storage, or user input. If it's from user input why not skipping the task of reading a number, turning it into some two part integer and then convert it to FP and use the Applesoft input routines directly?


On a side note, it would be great if you could not only comment your source (*2), but as well add it not as picture but text. This does not only increase readability, but helps others a lot to reply with code sniplets you might love to get.


*1 - I always loved that address, it's o easy to remember: Enteger to Float too (yeah, I know, silly, can't help)

*2 - I would consider some header describing input/output/task a base minimum to each and every function. Keep in mind, you want to read your code in 10 years from now as easy as it is today - without a need to dissassemble your own thoughts.

Raffzahn
  • 249.4k
  • 23
  • 722
  • 1k