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

Added based-constants and character constants #262

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

SamCoVT
Copy link
Contributor

@SamCoVT SamCoVT commented Dec 9, 2020

ANS2012 requires the recognition of the following constants:

#1234 - a decimal number
$1234 - a hexadecimal number
%1010 - a binary number
'W' - a character constant

NUMBER now pushes the base at the beginning, modifies the base if appropriate, processes the number like before (including negative signs and a . on the end for a double), and restores the base at the end. Character constants are handled directly by putting the ASCII value on the stack as a single. Not all characters can be used as caracter constants (eg. ' ' for a space will not work and there are no escaped characters supported so no way to get a newline - use a hex/dec/bin constant instead for those situations)

Tests have been added to the core_c.fs file to test positive/negative single/double based numbers in both decimal and hex modes, as well as a few select character constants.

Note: Because there are other outstanding pull requests, the taliforth-py65mon.bin and listings in /docs were not included in this pull request. Just issue a "make" (or "make -B" to guarantee everything is rebuilt) after this has been merged and then push the result. A "make tests" before pushing might be in order as well, just to double check.

@SamCoVT SamCoVT mentioned this pull request Dec 9, 2020
@scotws scotws self-assigned this Dec 20, 2020
@scotws scotws merged commit d5004d6 into scotws:master-64tass Jan 8, 2021
@SamCoVT SamCoVT deleted the feature/number_constants branch November 16, 2022 15:35
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

Successfully merging this pull request may close these issues.

None yet

2 participants