CosmOS pre-alpha and launchable application versions of old programs.

This commit is contained in:
Anachronaut
2026-08-17 15:31:49 -04:00
parent eff6902bcf
commit 91c9d49d1b
66 changed files with 5612 additions and 160 deletions
+17
View File
@@ -592,6 +592,23 @@ uint8_t executeOperation(uint8_t Instruction, CPURegisters *cpu) {
*target = cpu->StackPointer;
}
break;
case 0x4D: {
// MVDS - Copy the selected Data Pointer into the Stack Pointer.
//
// This one is dangerous and is meant to be used rarely. Moving the Stack
// under a running program abandons every return address on it, so a RET
// after this goes wherever the new Stack happens to say.
//
// It exists because a system that runs other programs has no other way to
// get its Stack back. A program that gives up part way through leaves
// whatever it pushed behind, and the interrupt frame that carried the
// request to stop is on there too. Without this the Stack only ever grows
// downward, one abandoned program at a time, and a shell cannot outlive
// many of them.
uint16_t *source = selectDataPointer(cpu);
cpu->StackPointer = *source;
}
break;
//
// Dx - Output Operations:
//