Coder Social home page Coder Social logo

tostc / opcodedoc Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 315 KB

A website with opcode documentation of CPUs and VMs, all in a handy, parsable JSON format.

Home Page: https://tostc.github.io/OpcodeDoc/

License: MIT License

Python 51.08% SCSS 34.62% JavaScript 14.30%
chip8 compiler compiler-construction cpu decompiler emulation n64-development vm web website

opcodedoc's Introduction

OpcodeDoc

OpcodeDoc is the name of this website and the protocol for documenting opcodes of various CPU's and VM bytecode's.

The goal of this project is to create a one-stop shop where both emulator and compiler developers can find information about the different CPU's and VM's in a consistent format.

How to Build

You need Python 3 to create/generate the web pages. If Python 3 is installed, the gendoc.py file must be executed. After that, the dist folder will contain the web pages.

OpcodeDoc Spec

The OpcodeDoc Spec format is a JSON file with various blocks of data. The idea behind this format is to provide a consistent format that can be easily consumed by a program, so you can generate source code from it, for example, as is the case with OpenAPI.

Metablocks

There are currently two types of metablocks. Each metablock begins with a $-Character.

"$spec": "1.0.0"

This block contains the version number of the specification used for a file. The versioning type used here is semver.

"$info": {
    "title": "Name of the Processor / VM",
    "description": "Description of what type of processor we are dealing with",
    "clock_speed": "Clock speed of the processor + unit (Hz, KHz, MHz, GHz)",
    "cache": {
        "CACHE NAME e.g. L1": {
            "size": "Size of the cache + unit (B, KB, MB)",
            "comment": "Additional comment e.g. Special use case"
        }

        Multiple caches are possible.
    },
    "address_bus": Size of the address bus in bits e.g. 32 or 0 if unknown,
    "version": "Document version also in semver starting by 1.0.0",
    "sources": [ "Where does all this information come from? We don't want any plagiarize." ],
    "complete": true or false if this document is not complete
}
"glossary": {
    "Term": "Explanation"
}

The glossary is for web documentation only.

"registers": {
    "Core or processor name e.g. Main": [
        {"name": "Name of the register", "value": "Value of the register", "size": Size of the register in bits}
    ]
}

The register block contains a map of different cores or processing units, each of which can have its own register.

"groups": [
    "Group name"
]

The groups can be referenced by each opcode. This helps to categories the opcodes on the web interface.

"opcodes": [
    {
        "group": Group index starting with 1 for the first group in the group array or 0 for no group,
        "name": "Name of the assembly e.g. MOV",
        "opcode": Opcode value e.g. 50,
        "decode": {
            "Name for a variable or just a binary value": Size in bits
        },
        "format": "Assembly example on how to use this introduction e.g. MOV reg1, reg2",
        "purpose": "What does this command?",
        "description": "Example of how an emulator might emulate this command e.g. reg2 = reg1"
    }
]

This block describes how an opcode works and is encoded. The decoding map shows how a sequence of bytes can be decoded to get all the necessary values, or conversely, how an assembler introduction is encoded.

For more information you can have a look at some files in the spec folder.

License

All files, except the files inside the specs and fonts folder, are under the MIT License. The informations, which are inside the specs/*.json, are without warranty of correctness or completeness.

opcodedoc's People

Contributors

tostc avatar

Stargazers

 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.