Closed vddCore closed 6 years ago
These look like nice changes, thanks! When I get a chance, I am going to look over this PR to see if I have any questions and probably merge it soon after.
@Ciastex I have uploaded these changes to curse, version 1.12.2-5, thanks again!
So I thought I'd add a few cents myself, since I'm using this mod like there's no tomorrow. The list of chages are as follows.
Additional conditonal jumps
JE/JNE - Aliases for JZ/JNZ JG/JGE - Jump if Greater / or Equal JL/JLE - Jump if Lesser / or Equal
Additional push/pop instructions
PUSHA - Pushes all GPRs onto stack in the following order: A B C D POPA - Pops 4 values from the stack into GPRs in the following order: D C B A
CMP instruction
The CMP instruction works like it does in x86 architecture, i.e. allows for JG/JL jumps; doesn't break existing code relying on JZ/JNZ.
New behavior of CMP a, b:
Code book tweaks
Code book now has a primitive indentation support for tab key - inserts 2 spaces at the current cursor position.
Processor fault codes
When a processor sets its fault flag it also sets a fault code that can be seen when hovering the mouse cursor over the fault flag in GUI.
Processor fault codes are as follows: 0x00 - Division by zero. 0x01 - Stack underflow (pop when stack empty). 0x02 - Stack overflow. 0x03 - Undefined instruction pointer location. 0x04 - Code load error. 0x05 - Out of bounds error. 0xFE - Processor stopped using HLT instruction. 0xFF - Processor operating correctly (default state).