Giter VIP home page Giter VIP logo

chip8-asm.el's Introduction

About

This is an assembler for the CHIP-8 instruction set written entirely in Emacs Lisp. Together with chip8.el, this means you can assemble and run CHIP-8 programs without the need of external tools.

Both CHIP-8 and Super Chip-48 instructions are implemented.

Installation

You can install this package with Quelpa, straight.el or by manually requiring the chip8-asm.el file.

Usage

Use the chip8-asm interactive function in order to assemble the current file. You will be asked for the path to the output binary.

Synthax and Special Instructions

Available Instructions

For a list of available instructions and their synthax, look at Cowgod’s Chip-8 Technical Reference.

Labels

Labels are written with a colon separating them from the following instructions. Labels can be used in place of addresses. label: JP label

Comments

Any text following a semicolon is considered a comment ; This is a comment

org command: Location in Memory

In order to define where the following instructions and/or data are placed in memory, you can use the org command. org $200

Numbers

There is no distinction between immediate values and addresses, since the instruction set uses them in completely separate instructions.

Numeric bases

% is used for binary integers. %1111 No prefix is used for decimal integers. 15 $ is used for hexadecimal numbers. $F

db command: Add bytes as data

You can add bytes to the binary using the db command followed by a list of numbers each representing a byte.

small_o:  db %00000000
	  db %11110000
	  db %10010000
	  db %11110000

Example

        org $200
	
	HIGH
	LD I, sprite
        LD V0, $32
        LD V1, $16

        DRW V0, V1, 0

end:	JP end


sprite:	
        db $55 $55 $55 $55
	db $55 $55 $55 $55
	db $55 $55 $55 $55
	db $55 $55 $55 $55

chip8-asm.el's People

Contributors

fayalalebrun avatar

Watchers

James Cloos avatar  avatar  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.