Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

15
  • 2
    Doing floating-point decimal input in hex seems to be an unusual choice. Did you really mean that? It seems to be contradicted by your last sentence. Commented Apr 3, 2021 at 14:33
  • 2
    What are you trying to do that FRMNUM doesn't? Are you looking for a something like FIN (6502disassembly.com/a2-rom/Applesoft.html#SymFIN)? Commented Apr 3, 2021 at 14:51
  • 5
    So the input is decimal? The user types "123.456" on the keyboard, not "7B.1CB"? Commented Apr 3, 2021 at 16:02
  • 2
    Applesoft BASIC stores expressions in tokenized form, but numeric constants are just strings of ASCII digits. FRMNUM will evaluate a numeric constant or expression into a value in FAC. You'd need a '+' token ($c8) rather than a '+' character ($2b/ab) if you wanted FRMNUM to add two numbers. Use the "command-line" tokenizer routine if you want to evaluate plain text (and aren't in a hurry). (Also: I suggest you refer to a string of ASCII digits as a string of ASCII digits, rather than "hex format", which is a bit unclear.) Commented Apr 3, 2021 at 16:06
  • 1
    @AlGorithm At this point you've pivoted from "how do I solve this problem" to "why doesn't my code work". Other forums may be better for that type of question; perhaps comp.sys.apple2 or reddit (it looks like you've already found the latter... reddit.com/r/apple2/comments/mivith/…). I don't see anything obviously wrong with your code; my advise would be to set a breakpoint at $6000 and walk through it. And be sure you're invoking it from the monitor, not Applesoft (since you're trashing TXTPTR). Commented Apr 4, 2021 at 21:14