Skip to main content
1 of 4
Jump3r
  • 175
  • 6

Emulated CPU code

I recently started new project - a CPU emulator in Java. Base code is written, now I can start to slowly implement new things, but I want code review to be done, to reformat code before it messes up. Unfortunately, I didn't add any Javadocs and didn't do any deeper tests, except checking if basic OP codes are working.

https://github.com/jakub-gonet/Emulated-CPU

Code structure is like so:

  • CommandHelper.py - script used to convert Op code to binary form and vice versa
  • Main - entry point
  • cpu/OPCODE - list of OP codes and what they should do
  • cpu/ADDR_TYPE - addressing modes
  • cpu/StatusFlags - CPU flags (carry, negative, zero flag etc)
  • cpu/programCounter - program counter
  • cpu/CPUEmulator - main class to bind rest to it
  • cpu/instructionArgument, InstructionMnemonic, Instruction - used to encode a single instruction
  • cpu/instruction/InstructionRunner - fetch and run Instruction
  • cpu/instruction/converter - package used to convert from bits to OP code and address modes
  • cpu/memory - package used to represent CPU memory

(bolded are important)

Jump3r
  • 175
  • 6