Implement instructions 0x03C-0x053, add flag constants and fix execute pipeline #5
Reference in New Issue
Block a user
Delete Branch "diego/instruc-03c-053"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implemented relative jump instructions (JMR, JER, JNR, JIR), user flag operations (SFB, LFB, JUF, JUR), stack operations (PUSH, POP), function call/return (CALL, RET minimal version), system flag instructions (EDI, SHSS), and float arithmetic (FLI, FNEG, FADD, FSUB, FMUL, FDIV, FEPS, FEEP). ALLOC/HFREE are stubs pending heap implementation. FMOD, FDMOD and float comparisons (FEQ-FLE) left as TODO.
Added flag register constants to CPU.hpp for bits 7, 10, 12, 16 and 20-23 based on the VM spec pages 11-14. Please verify the bit positions are correct.
Fixed two issues in the execute pipeline: CPU::execute() was indexing addrModes[] with the opcode (only 8 entries) instead of instrMap[] (512 entries). Runtime::step() was only decoding the instruction but never dispatching it — added the cpu.execute() call to complete the fetch-decode-execute cycle.