Code Monkey home page Code Monkey logo

n2t-cpu's Introduction

n2t-cpu

An implementation of the nand2tetris CPU emulator that runs in your browser.

Supports drawing to the screen, but not keyboard input.

Try it out!

Features

  • Support for all instructions, not just the author's 18 default mnemonics.

  • Keyboard shortcuts (replace CTRL with Command on Mac)

    Shortcut Behavior
    ctrl+o Open a hack file
    ctrl+shift+o Open a RAM dump file
    s Step 1
    x Step X
    shift+x Step X (prompt for X)
    ctrl+g Go to ROM address
    ctrl+h Go to RAM address
    ctrl+b Set a breakpoint at the current PC
    ctrl+shift+b Set a breakpoint at the prompted address

n2t-cpu's People

Contributors

dependabot[bot] avatar gerrit0 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

n2t-cpu's Issues

Allow loading asm files

I didn't want to implement this initially, as I wanted to be able to push code before the assignment was due, but this would be very useful. When loading an asm file, the program should include comments.

Refresh gui on error

When doing step X and an error is thrown, the UI is not updated to show the current state of the machine. It should be.

Provide a way to jump to address

Both the RAM and the ROM tables need a way to jump to a specific point. It is rather painful to try to scroll to a specific address.

This should be pretty simple, prompt() for input then set the scrollTop of the relevant element.

Save Step X/Step Rate between sessions

Currently when refreshing the page, step X is reset to 50 and step rate is set to 3.

These should be saved to localStorage so that user values are persisted.

Add watchpoints

Like #4, it is reasonable to want to step until a given memory address is accessed and/or modified.

Add breakpoints

It would be really nice to be able to step to a certain PC value without calculating how many instructions need to be run and entering that in the Step X box, which might be next to impossible in the first place with nested loops.

Add keyboard shortcuts

The more I use this the more I realize I want shortcuts similar to other debuggers.

Shortcut Command
F9 Step
F10 Step X
F11 Step X (prompt for X)
CTRL+G Go to ROM address
CTRL+H Go to RAM address

Blocked by #2

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.