Giter Club home page Giter Club logo

8-bit-assembler's Introduction

8bit-assembler

An assembler I made for my 8 bit computer

Instrucion set

ID Opcode VALUES Hexcode Description
0 NOP 0x00 0x00 0x00 No instruction
1 HLT 0x06 0x00 0x01 Halts the clock
2 MOV 0x81 0x00 0x02 Sets ram adress to Z
3 ARL 0x15 0x00 0x03 Loads from current Adress to A register
4 BRL 0x0D 0x00 0x04 Loads from current Adress to B register
5 LVA 0x11 0x00 0x05 Loads [Z] value to A register
6 LVB 0x09 0x00 0x06 Loads [Z] value to B register
7 ADD 0x12 0x00 0x07 Adds A register to B, stores in A
8 SUB 0x0A 0x01 0x08 Subs A register from B, stores in B
9 STORA 0x64 0x00 0x09 Stores value of A register in current adress
10 STORB 0x63 0x00 0x0A Stores value of B register in current adress
11 RLV 0x61 0x00 0x0B Stores value of argument in current adress
12 OUTA 0x04 0x02 0x0C A Register -> Output Register
13 OUTB 0x03 0x02 0x0D B Register -> Output Register
14 JMP 0x01 0x20 0x0E Uncodnitional jump to [Z]
15 CMP 0x02 0x41 0x0F Compares numbers in registers and sets flags
16 OUTAL 0x02 0x02 0x10 ALU -> Output Register
17 OUTR 0x05 0x02 0x11 Ram -> Output Register
18 OUTV 0x01 0x02 0x12 Rom argument to Output register
19 STORR 0x84 0x00 0x13 ALU -> Current Adress
20 CMPA 0x04 0x40 0x14 Compare numbers in register A with 0
21 CMPB 0x03 0x40 0x15 Compare numbers in register A with 0
22 JOF 0x01 0x28 0x16 Jump if overflow
23 JPO 0x01 0x18 0x17 Jump if positive
24 JNE 0x01 0x10 0x18 Jump if negative
25 JZE 0x01 0x08 0x19 Jump if zero
26 TAB 0x0C 0x00 0x1A Transfers A to B
27 TBA 0x13 0x00 0x1B Transfers B to A
28 JBT 0x01 0x18 0X1C Jumps if button pressed

Opcode layout: |Opcode + ARG| = 2 bytes

Each opcode takes 2 bytes of memory, every instruction contains opcde in odd position and argument in even position

When running assembler.py, it will produce file program.bin from program.ebt

8-bit-assembler's People

Contributors

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