Source

simple-cpu / cpu.py

Author Commit Message Labels Comments Date
Kevin Veroneau
Added new software interrupt of 8, to allow easy string comparing.
Kevin Veroneau
Finished implementing address labeling system.
Kevin Veroneau
Added pointer label support to make referencing addresses during assembly much easier.
Kevin Veroneau
Updated software interrupts to include "int 12" for reading a line of text from the keyboard. Also combined interrupt routines into single loadable binary image. Load interrupt.tbl in address 4000 Load interrupt.bin in address 1000
Kevin Veroneau
Initial work on a proper software interrupt table has been implemented. The location in memory of the interrupt handler vector table is customizable. The stack of pushed registers is now fully stored in user-accessible memory. The location of various segments can now be set: CS: Code segment, controls the offset of the IP(Instruction pointer) DS: Data segment, is used when memory access is performed by code ES: Extra segment, not currently used, and is available to the user. SS: Stack segment, sets where the stack is located in memory. Various pointer registers have also been implemented: SP: Stack pointer, used to determine the stack index. IP: Instruction pointer, points to the next instruction to be run.
Kevin Veroneau
Removed CPUHook system in favor of a more CPU standard IN/OUT operations. Added many new standard registers, and reimplemented the stack. New registers also control where the code segment and data segments are read from.
Kevin Veroneau
More improvements to the MOV instruction, now supports: MOV ax,&cx MOV &cx,34 Update the math instructions to support the new options available.
Kevin Veroneau
Updated the MOV instruction to be more similar to the x86 MOV instruction: All these combos now work: MOV reg16, r/m/i16 MOV mem16, reg16 Completely rewrote the Unit classes to use C Struct, rather than my own calculations.
Kevin Veroneau
Updated CPU to use mmap and support basic memory address translation to load binaries in different memory locations.
Kevin Veroneau
Major update to CPU simulator, existing bytecode will need to be recompiled to use this new core. Work has begun to rework the op-codes to be more powerful and similar to standard assembly. Removed op-codes: ax bx cx dx cx++ cx-- addcx subcx New op-codes: mov inc dec add sub mul div swp Updated op-codes: push pop use The Coder class has been completely remade using the standard cmd.Cmd module.
Kevin Veroneau
Added new op-code to enable 16-bit memory locations for using larger binaries with the simulator.
Kevin Veroneau
Updated 16-bit implementation to use a new Unit16 class.
Kevin Veroneau
Initial 16-bit support.
Kevin Veroneau
Added screen clear/color support, and single key input.
Kevin Veroneau
Enabled support to zlib compress binary files.
Kevin Veroneau
Updated CPU Hook interface to make it easier to create hooks and use them in the included assembler.
Kevin Veroneau
Added CPU op-code Hooks to enable custom plugin classes to perform custom Python code when called from your binary image.
Kevin Veroneau
Made the CPU class extendable with overridable INTs.
Kevin Veroneau
Added Hello World example.
Kevin Veroneau
Initial code import.