Skip to content

Custom 8 bit CPU emulator with custom Assembler written in C

Notifications You must be signed in to change notification settings

HaydenD100/8bitcpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

8 bit CPU emulator

8 bit cpu emulator written in C using a custom instruction set with an assembler that assembles my custom assembly language.

Assembler

The assembler supports the custom assembly language I have created, the assembly language includes 16 base Instructions as well as Macros that are expanded with a preprocessor I have designed, You can define bytes, strings and labels which all get evaluated by the assembler, the directory asm holds examples of the custom assembly language.

Opcodes

0x0 MR reg, reg/8bit
0x1 LR reg, HL/16bit       load byte
0x2 WR reg, HL/16bit        write byte
0x3 ADD reg, reg/8bit
0x4 ADC reg, reg/8bit + c flag    resets c flag
0x5 SUB reg, reg/8bit
0x6 SBB reg, reg/8bit + b flag    resets b flag
0x7 JCN 4bitflag flag HL/Adress 1 bit, 001 = L 010 = C 011 100 = B, HL/16bit
0x8 CMP reg, reg/bit
0x9 PUSH reg/8bit      
0xa POP reg
0xb AND reg, 8bit/reg
0xc OR reg, 8bit/reg
0xd NOR reg, 8bit/reg
0xe INB reg, PORT
0xf OUTB reg, 8bit/reg

Register

SP 16bit
PC 16bit
IR 8bit

A 8bit
B 8bit
C 8bit
D 8bit
F 8 bit

Flags

LESS
EQUAL
CARRY
BORROW

About

Custom 8 bit CPU emulator with custom Assembler written in C

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published