Skip to content
프로젝트

소개

CPU를 에뮬레이션하며 작동 원리 배우기

학습 및 교육

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

6502Emulator

Learning how a CPU works by emulating one.

This code was written during the youtube video : https://youtu.be/qJgsuQoy9bc

11/2020 NOTES / TODO

  • All 6502 legal opcodes emulated
  • Decimal mode is not handled
  • Test program /Klaus2m5/6502_65C02_functional_tests - will succeed if decimal is disabled.
  • Counting cycles individually for each part of an instruction is cumbersome and probably should just deduct the correct number at the end of the instruction.
  • There is no way to issue and interrupt to this virtual CPU
  • There are no hooks for debugging.
  • There is is no dissasembler or UI, this is just the CPU emulator & units test.
  • There are no asserts if you write memory outside of the bounds (it will overwrite memory)
  • Illegal opcodes are not implemented, the program will throw an exception.

Issues

  • Does the BRK command break when interrupts are disabled? that needs testing.
  • PLP clears the break flag when executed? is this correct?
  • INS_JMP_ABS, see notes about bug in 6502 for correct emulation

What did we learn from this?

  • A program is just big array bytes
  • Writing a CPU emulator is time consuming
  • Some features are undocumented!
  • Emulating a CPU is harder you than you think, because you have emulate things you got for free in a real CPU (like the clock)
  • Writing Unit tests for the CPU was a good idea.
  • Big switch state works for small instruction set processors, probably not for bigger ones, like the 68000.

관련 프로젝트 살펴보기

불러오는 중…