Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Conversation

@phire
Copy link
Contributor

@phire phire commented Jul 20, 2022

CLR needs to set V flag depending on value for various cpu6 detection code to work.

Also stub parity enable/disable.

Allows ?DSKT to correctly detect and report that it's running on cpu6

Before:

./centurion ../SOFTERM/\?/\?DSKT.4.bin
Centurion Binary ../SOFTERM/?/?DSKT.4.bin loaded; entry at 0164
[07]?DSKT 7.0

** CPU 5 **
RETURN TO LOADER(L); ERROR LOG ON CRT(C), PRINTER(P), OR BOTH(B)? 

After

./centurion ../SOFTERM/\?/\?DSKT.4.bin
Centurion Binary ../SOFTERM/?/?DSKT.4.bin loaded; entry at 0164
[07]?DSKT 7.0

** CPU 6 **
RETURN TO LOADER(L); ERROR LOG ON CRT(C), PRINTER(P), OR BOTH(B)? 

phire added 2 commits July 21, 2022 10:12
Needs to set V flag depending on value for various cpu6 detection
code to work
Now cpu6 detection works, code actually executes these
alu_out ^= ALU_V;
// Explicitly clears L and F flags
alu_out &= ~(ALU_L | ALU_F);
logic_flags(v);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be neat if you describe CPU detection logic somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a comment?

Code just executes a clr to a non-zero value and checks the v flag. As CPU5 doesn't implement "small immediates", it clears to zero and v flag is zero.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, got it. CPU5 ignored the remaining nibble of the operand, where the constant was pushed in in cpu6.
Still perhaps worth leaving somewhere. In code comments or maybe on wiki.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so we finally know wtf was going on. Cool

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants