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
/STRING seems to have problems with negative values #46
Comments
What tests are you running?
|
I pushed an update to master where I am now, and the string stuff works after I got rid of the tabs (which is worrying in itself, we might have a problem with PARSE and whitespace?). At the moment, it crashes at
which all worked fine before I included the string tests. I'm going to be busy with the Real World (c) for the next couple of days, so that's where I have to leave it for now. |
I pushed an update to master where I am now, and the string stuff works after I got rid of the tabs (which is worrying in itself, we might have a problem with PARSE and whitespace?). At the moment, it crashes at
65C02: 6873 0a 78 00 f7 00110100 Py65 Monitor
6502: 0000 00 00 00 ff 00110000 Py65 Monitor
6502: 0000 00 00 00 ff 00110000 |
I did have to replace tabs with spaces in John Hayes' code to get it to work with Tali. If both tabs and spaces are supposed to be equivalent as a separator, that is not the case at the moment. |
So I checked and the standard says clearly that PARSE-NAME (which EVALUATE uses) skips leading spaces (https://forth-standard.org/standard/core/PARSE-NAME). However, if you trick Gforth into accepting tabs with |
The usage page for the standard http://forth-standard.org/standard/usage#subsubsection.3.4.1.1 I noticed you commented out the test case with the negative value passed to /string. I believe you will find it works if you change the base to decimal before running that code. It currently sees 10 as $10 and moves 16 characters forwards in the first step. I got it to pass a test run by adding decimal before the test:
I think I want to break the tests up into separate files and have a way to run only one group of tests as well as all of the tests. I'm thinking of a makefile where you might type I've also found a bug in the python tester program that may be hiding the exact location of the crash back to the simulator monitor (#49). I'll keep you updated as I dig deeper. |
I think breaking up the test into multiple parts is a great idea, simply because of the time now involved in testing (I now finally know why all those people in the movies always have code running through on some terminal window -- they're testing their 8-bit Forths!). The first step would be to break up I'm wondering if a I've enough stuff with |
I think you can close this bug as it seems to be working properly. To get your test case working, you can either switch to decimal (be sure to switch back to hex afterwards, as following tests expect it) or adjust the numbers in the test to be be hex or to be 9 or less so it doesn't matter. Do you want me to issue a pull request with one of those, or do you want to just fix it up yourself? |
... at least it's failing the test suite there.
The text was updated successfully, but these errors were encountered: