halt and catch fire
This commit is contained in:
parent
e53d40d5be
commit
2e0b67b69e
5
ISA.txt
5
ISA.txt
|
@ -22,5 +22,6 @@ INSTRUCTIONS
|
||||||
0x51: Less than - 3 Parameter - If byte in register (P1) less than byte in register (P2), set byte in register (P3) to 0x01
|
0x51: Less than - 3 Parameter - If byte in register (P1) less than byte in register (P2), set byte in register (P3) to 0x01
|
||||||
0x52: Greater than - 3 Parameter - If byte in register (P1) greater than byte in register (P2), set byte in register (P3) to 0x01
|
0x52: Greater than - 3 Parameter - If byte in register (P1) greater than byte in register (P2), set byte in register (P3) to 0x01
|
||||||
--- Development ---
|
--- Development ---
|
||||||
0xFE: Print byte as ASCII from register (invalid does nothing) - 1 Parameter - Prints the ASCII byte in register (P1) to console
|
0xFE: Print byte as ASCII from register - 1 Parameter - Prints the ASCII byte in register (P1) to console
|
||||||
0xFF: Print byte from register - 1 Parameter - Prints the byte in register (P1) to console
|
0xFF: Print byte from register - 1 Parameter - Prints the byte in register (P1) to console
|
||||||
|
0x66: Halt and Catch Fire - 0 Parameter - Fire! FIRE EVERYWHERE!!!!!
|
|
@ -21,6 +21,7 @@ export enum Instr {
|
||||||
GreaterThan,
|
GreaterThan,
|
||||||
Print,
|
Print,
|
||||||
PrintASCII,
|
PrintASCII,
|
||||||
|
HaltCatchFire,
|
||||||
}
|
}
|
||||||
|
|
||||||
const InstParamCount = new Map();
|
const InstParamCount = new Map();
|
||||||
|
@ -46,6 +47,7 @@ InstParamCount.set(Instr.GreaterThan, 3);
|
||||||
|
|
||||||
InstParamCount.set(Instr.Print, 1);
|
InstParamCount.set(Instr.Print, 1);
|
||||||
InstParamCount.set(Instr.PrintASCII, 1);
|
InstParamCount.set(Instr.PrintASCII, 1);
|
||||||
|
InstParamCount.set(Instr.HaltCatchFire, 0);
|
||||||
|
|
||||||
export type TempInstrState = {
|
export type TempInstrState = {
|
||||||
pos: u8;
|
pos: u8;
|
||||||
|
@ -286,6 +288,7 @@ export class Computer {
|
||||||
|
|
||||||
if (byte === 0xff) return Instr.Print;
|
if (byte === 0xff) return Instr.Print;
|
||||||
if (byte === 0xfe) return Instr.PrintASCII;
|
if (byte === 0xfe) return Instr.PrintASCII;
|
||||||
|
if (byte === 0x66) return Instr.HaltCatchFire;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue