Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimICE: decimal numbers #67

Closed
stefandrissen opened this issue Oct 11, 2021 · 3 comments
Closed

SimICE: decimal numbers #67

stefandrissen opened this issue Oct 11, 2021 · 3 comments

Comments

@stefandrissen
Copy link

stefandrissen commented Oct 11, 2021

The manual contains:

Decimal: 0n12345 or 12345.

When using A to view a new address, the first works correctly, the second does not:

  • 0n32768 -> hex address 8000 is correctly shown;
  • 32768 -> the leading 3 is chomped off and hex address 2768 is shown.

My use case for decimals is the print function of pyz80, which only prints decimal values of any expression, hex( $ ) fails as an expression and prints ?.

I think the behavior is consistent, bpm also chops the leading decimal digit, see screen shot for 10874 and 0n10874:
image

@simonowen
Copy link
Owner

There are a few inconsistencies in how numeric inputs are handled, and the documentation isn't quite right anymore, which doesn't help!

The debugger works almost exclusively in hex, so 12345 will be treated as 0x12345 instead of 12345. Though if the context is expecting an 16-bit or 8-bit value it'll be further clipped to 0x2345 or 0x45, respectively. You can still use the 0n prefix for decimal values. In much older versions of SimCoupe the debugger display was hex but the input defaulted to decimal, which many people found confusing so it was changed.

Other places like data import/export still use decimal by default, though the inputs are still passed through the same expression evaluation so you can specify a hex prefix to override it there too.

I'm still looking at cross-platform native UI support, which might be a good time to add the extra display and input flexibility everywhere. In the short term I'll probably just fix the documentation by removing "or 12345" from the first line you quoted.

@stefandrissen
Copy link
Author

Just removing from the docs is fine for me, I just kept thinking I was going mad.

simonowen added a commit that referenced this issue Oct 18, 2021
The manual suggested numeric input was decimal by default but this hasn't
been true since v1.0. Also updated some examples to be less ambiguous.
@stefandrissen
Copy link
Author

Updated docs is fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants