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

scas misassembles castle #409

Open
pixelherodev opened this issue Oct 14, 2020 · 4 comments
Open

scas misassembles castle #409

pixelherodev opened this issue Oct 14, 2020 · 4 comments

Comments

@pixelherodev
Copy link

scas currently misassembles castle, in a seriously bad way. This is likely an issue with either macros, conditional assembly, or relative jumps.

@aviallon
Copy link
Member

Do you think that the corrupted kalculator I have may be caused by that?
Perhaps assembling compiler output my be a good "completeness" test as the compiler produces unoptimized things.

@pixelherodev
Copy link
Author

@aviallon It's entirely possible.

You can try using sass, but I'm not sure if that works with kcc output.

@pixelherodev pixelherodev modified the milestones: scas 1.0, scas 0.6 May 2, 2021
@aviallon
Copy link
Member

I also think that I'll simply end up writing my calculator in assembly. This way I'm sure it'll work.
Also, I think C is badly suited for the z80e, so another language might be better for that (one that natively supports 16 bit data type and which has less undefined behavior)

@pixelherodev
Copy link
Author

@aviallon Of all the pieces of KnightOS that need work, z80e is not - to my knowledge - one of them. It definitely doesn't need to be rewritten in any other language, and I guarantee you that doing so will create more bugs than it fixes. Also, C has very good 16-bit (and 8-bit) support with stdint.h, which I highly recommend using for all integers in C. Using "raw" types (int / short / long / etc) is almost always a mistake for portable code.

z80e isn't perfect, but it's very good. What we really need is a way to automatically test it against a real calculator, but that's a lot harder. Testing the CPU is trivial - the CPU emulation is perfect[ly correct], but it's a z80 so that's not particularly challenging - but testing the rest of the ASIC is not.

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

No branches or pull requests

2 participants