Phase 4: Ereignisschleife und klassische Traps

This commit is contained in:
2026-09-04 15:56:47 +02:00
parent 060674b466
commit 5cf5a6582c
40 changed files with 4024 additions and 176 deletions

View File

@@ -304,6 +304,14 @@ instrs! {
0xB2 RetFn;
0xB3 CallBuiltin(a: u16, b: u8);
// 0xE0 — Ereignis-Traps (Sprachreferenz §8); Kennung vom Stack
0xE0 TrapDefine(a: u8, b: u32); // Quellenart, Sprungziel
0xE1 TrapDisable(a: u8); // GOSUB 0
0xE2 TrapSet(a: u8, b: u8); // Quellenart, Zustand
0xE3 EventSwitch(a: bool);
0xE4 Doevents; // Zustellpunkt; legt 0 ab
0xE5 Sleep(a: bool); // hat Argument? Dauer vom Stack (Sekunden)
// 0xC0 — Fehlerbehandlung
0xC0 OnErrorGoto(a: u32);
0xC1 OnErrorLocal(a: u32);
@@ -614,6 +622,12 @@ mod tests {
Instr::Call(2, 3),
Instr::Input(2, false, 0xFFFF, true),
Instr::ConvCyR8,
Instr::TrapDefine(1, 4242),
Instr::TrapDisable(3),
Instr::TrapSet(0, 2),
Instr::EventSwitch(false),
Instr::Doevents,
Instr::Sleep(true),
Instr::RetFn,
];
let mut buf = Vec::new();