You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)
@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.
Activity
aviallon commentedon Oct 14, 2020
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 commentedon May 2, 2021
@aviallon It's entirely possible.
You can try using sass, but I'm not sure if that works with kcc output.
aviallon commentedon May 11, 2021
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 commentedon May 11, 2021
@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.