GithubHelp home page GithubHelp logo

pbpu2's Introduction

PBPU2

A 4-Bit Fantasy CPU with basic I/O.

Registers

Letter Name Size
A Accumulator 4-Bit
B B-Register 4-Bit

A and B can be used together for Input/Output

Flags

Letter Name
C Carry
Z Zero

Instructions

Num Mnemonic Description Size
0 NOP No Operation 1
1 LDAN num Load Number into A 2
2 LDAM (mem) Load Contents of Memory into A 4
3 STA (mem) Load Contents of A into Memory 4
4 SWAP Swap the Contents of A and B 1
5 SHFT Shift A Left, Shifts Leftmost Bit into Carry 1
6 ADD Add A with B, load result into A, Carry exists 1
7 SUB Subtract B from A, Result in A, Borrow doesn't exist 1
8 AND AND A with B, Result in A 1
9 OR OR A with B, Result in A 1
A XOR XOR A with B, Result in A 1
B IN Wait for Input until Interrupt, load IO-Bus into AB (Can be used as HALT) 1
C OUT Output AB onto IO-Bus until Acknowledged 1
D JP mem Unconditional Jump 4
E JPC mem Conditional Jump, if Carry = 1, jump 4
F JPZ mem Conditional Jump, if Zero = 1, jump 4

Memory

2^(3x4), aka 2^12 4096x4 Address Space

pbpu2's People

Contributors

officialpixelbrush avatar

Watchers

 avatar

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.