Git Product home page Git Product logo

uni04's Introduction

uni04

uni04 (or uni.4) is a 4-bit architecture made for Alex's 4-bit arch challenge

There are 2 registers, X (accumulator), and Y

  v ALU
┌──┬─┐
│  │ │ <- Registers
│  │ │
├──┴─┤
└────┘
  ^ Control Unit

Instructions

Opcode Instruction Arguments Description
00 imm reg con Immediate value
01 ldx adr Load adr into X
02 ldy adr Load adr into Y
03 ldi reg adr reg Indexed load
04 stx adr Store X into adr
05 sty adr Store Y into adr
06 mov reg reg Move value from reg1 to reg2
07 add reg reg reg1 += reg2
08 sub reg reg reg1 -= reg2
09 shr reg con Shift right reg by con
0A not reg Bitwise NOT on reg
0B nor reg con Bitwise NOR on reg by con
0C jmp adr Jump to adr
0D jmz adr Jump to adr if zero
0E cal adr Call subroutine
0F ret Return from subroutine

ASM syntax example

mov x y    // Hmmm comment
ldx 7      // meow :3
ldi x 21 a

As you can see instead of ; you use // and there is no , unlike most ASMs

Turning into opcode

Registers

x 0
y 1

mov x y = 06 00 01

imm x 8 = 00 00 08

Addreses (8-bit)

adr ##

ldx 16 = 01 0F

jmz 27 = 0D 1B

Constants

con #

nor x 1 = 0B 01 01

uni04's People

Contributors

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