Code Monkey home page Code Monkey logo

nesemulator's Introduction

Nes Emulator Learning


6502 CPU

  • 16 bit address
  • 8 bit data
  • can write address to the bus
  • can read and write data to the bus
  • 56 legal instructions
  • each instruction has a size and duration(clock cycles)

Instruction type

  • LDA $41 2-BYTE (IMMEDIATE ADDRESSING MODE) [ OPERAND OPCODE ]
  • LDA $0105 3-BYTE ( ABSOLUTE ADDRESSING )
  • CLC 1-BYTE

For a given instruction we need to implement the function + addressing mode + cycles

Register

  • [ 8 BIT ] A (accumulator)
  • [ 8 BIT ] X
  • [ 8 BIT ] Y
  • [ 8 BIT ] stkp STACK POINTER
  • [ 16 BIT ] pc PROGRAM COUNTER ( contains the next byte of instruction )
  • [ 8 BIT ] status STATUS REGISTER ( check for various operations like carry, enable/disable interrupts and zero compare )

since insrutction can be 1,2 or 3 bytes we might need several clock cycles


Main bus

  • has address and data lines

RAM

  • 64 kb

REFERENCES

Why use unint_x variables Where should we use auto and how What are forward declarations ? and where are they used Circular Dependecy related to forward declarations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.