Skip to content

Assembler for a modified version of the Chip-8 instruction set

License

Notifications You must be signed in to change notification settings

lukelab04/Chip8-Assembler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Chip8-Assembler

Assembler for a modified version of the Chip-8 instruction set

How to use

To compile, run gcc -o asm.exe asm.c.

Then, once you have written your assembly program, run ./asm.exe [programname.asm]. The assembled file will be saved as "program.hex".

Instruction Set

The base instruction set can be found here. However, there are a few additions to this program.

The instruction ld I, vx was added, which sets the value of the I register equal to the value in vx.

Comments are defined with ';', as follows:

cls       ;Clear Screen
ret       ;Return from subroutine

Anchor points are predefined places where a program can jump to. They can be created as follows:

.myAnchorPoint
;Implement routine here

Later, Anchor points can be called like this:

jp myAnchorPoint
;PC is set to the place where myAnchorPoint was defined

It is important to remember that all words are converted to lowercase during the assembly. Therefore, 'myanchorpoint' and 'MYANCHORPOINT' are equivalent.

The binary values of a few instructions were also altered to make room for more instructions in the future.

Running your program

Unfortunatley, since this is a modified set, preexisting emulators will not work out of the box. You may be able to modify one or write your own to run your program. I am also working on an emulator, but I do not feel that it is complete enough to publish. However, it is in a functional state, so I was able to test the assembler to make sure it was working. I even got Pong running, as shown below. chip8

About

Assembler for a modified version of the Chip-8 instruction set

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages