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

TASK: Write hw/cpu test case to show LMSW behavior #54

Open
joncampbell123 opened this issue May 26, 2021 · 0 comments
Open

TASK: Write hw/cpu test case to show LMSW behavior #54

joncampbell123 opened this issue May 26, 2021 · 0 comments

Comments

@joncampbell123
Copy link
Owner

joncampbell123 commented May 26, 2021

LMSW bit 0 enables protected mode. It is known that on 386 and higher processors, the machine status word is just the low 16 bits of the 386 CR0 register. On the 286, you were allowed to set the bit to enter protected mode, but you were not allowed to leave protected mode without a reset (clear the bit).

The purpose of the program is to show, on the CPU it is run, whether LMSW is allowed to set the bit, and whether it is allowed to clear the bit.

Obviously the program must return safely, so if LMSW cannot clear the register, it should write CR0 to clear it.

It is possible that by the 486 and Pentium era (1996), LMSW no longer enforced the set-only behavior and allowed clearing the bit.

The reason for this test: joncampbell123/dosbox-x#2549

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

No branches or pull requests

1 participant