Coder Social home page Coder Social logo

8bit-c's Introduction

8-Bit microprocessor

This project is the construction of an 8-bit microprocessor.
The processor can run on computer or raspberry pico.

Instructions

Item Description code
HLT Stop processing 0x00
NOP This instruction is used to waste time 0x01
OTI Add accumulator value to OTR 0x02
LDA Add UR value to accumulator 0x03
LDI Add argument to accumulator 0x04
ADD Add an argument to the accumulator 0x05
SUB Subtracts argument from the accumulator 0x06
STA Add accumulator value to UR 0x07
AND Does the logic and between accumulator and argument 0x08
ORL Does the logic or between accumulator and argument 0x09
XOR Does the logic xor between accumulator and argument 0x0A
NOT Invert the accumulator bits 0x0B
GTA Conditional branch instruction 0x0C
IFC Conditional branch instruction if flag c is enabled 0x0D
IFZ Conditional branch instruction if flag z is enabled 0x0E
IFE Conditional branch instruction if flag e is enabled 0x0F
ITI Add ITR value to accumulator 0x10
SHR Shift right accumulator 0x11
SHL Shift left accumulator 0x12
CPA Compares the accumulator with the argument 0x13
ADA Add UR to accumulator 0x14
SBA Subtracts UR to accumulator 0x15
ANA Does the logic and between accumulator and UR 0x16
ORA Does the logic or between accumulator and UR 0x17
XRA Does the logic xor between accumulator and UR 0x18
SWA Reversing the nibbles 0x19
PUH Adds the accumulator value to the memory stack 0x1A
POP Return and remove the last value from the memory stack 0x1B
CSR Calls a function located at the address of the argument 0x1C
RET Restores the counter to the content prior to calling the csr instruction 0x1D

Registrars

Currently has five registrars:

Item Description
INSTRUCTION Instruction
ADD_INSTRUCTION Instruction address
ARGUMENT Argument
ACC Accumulator
ADD_ROM Current address of rom memory
BR 8-bit registers to aid in logical operations
UR Ten registers for the user to use
OTR Output register
ITR Input register

Flags

Currently has two flags:

Item Description
CFLAG Enabled if the result of some arithmetic operation is more than 255
ZFLAG Enabled if accumulator is zero
EFLAG Enabled if an accumulator is equal to the argument

Memory Stack

The memory stack has a ten levels.

Raspberry Pico

Configuration

Create the build folder and inside the folder run the command:

cmake ..

Build

make -j4

8bit-c's People

Contributors

brunoagst 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.