petercoulton / 6502-cpu

A 6502 CPU emulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

6502 CPU emulator

A 6502 CPU emulator created during a Dojo.

Example

(def program
  "LDA 100 ; foo
   ADC 7
   STA 15
   BRK"
  )

(def mem (load-program (assemble (parse program))))

(def cpu {:pc  0
          :ar  0
          :brk false})

(dump!! (run {:cpu cpu :mem mem}))

:pc  = 0x0c   12
:ar  = 0x6b  107
:xr  = 0x0d   13
:yr  = 0x18   24
:sp  = 0x27f  639
:brk = true
:eq  = false
00000000  a9 64 69 07 8d 0f a2 0c  e8 a0 18 00 00 00 00 6b  |.di............k|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000270  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
=> nil

About

A 6502 CPU emulator

License:Other


Languages

Language:Clojure 99.9%Language:Assembly 0.1%