Skip to content

Commit

Permalink
Now README is more beautiful :)
Browse files Browse the repository at this point in the history
  • Loading branch information
strzelca committed Jan 5, 2024
1 parent 77d84ca commit ff08c63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Binary file added .github/imgs/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
# EmuCPU
# EmuCPU

![EmuCPU](https://raw.githubusercontent.com/EmuKit/EmuCPU/master/.github/imgs/diagram.png)

## What is EmuCPU?
EmuCPU is an emulator for a CPU I designed.

* It's 16 bit
* It has 2 registers (A and B) and a Program Counter
* Its ISA has 6 instructions
* Program it's stored in a Memory, which size is defined at compile time.

## What is the ISA?
The ISA is the instruction set of the CPU. It has 6 instructions, MOV, ADD, SUB, MUL, DIV and INC.
Math it's done with using boolean logic, not C math operators.

## How do I use it?
There's not a method to load a program from a file, so you have to write it in the code. In main.c there's an array called 'prog' which contains the program. You can write something in an ASM-like language.
3 changes: 2 additions & 1 deletion lib/isa.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define SUB 0x0003
#define MUL 0x0004
#define DIV 0x0005
#define INC 0x0006

#define HLT 0xFAFB
#define NUL 0x0000
Expand All @@ -25,7 +26,7 @@ void _ADD(uint16_t *restrict dst, const uint16_t *restrict v1, const uint16_t *r
void _SUB(uint16_t *restrict dst, const uint16_t *restrict v1, uint16_t *restrict v2, uint32_t *restrict flags);
void _MUL(uint16_t *restrict dst, const uint16_t *restrict v1, uint16_t *restrict v2, uint32_t *restrict flags);
void _DIV(uint16_t *restrict dst, uint16_t *restrict v1, uint16_t *restrict v2, uint32_t *restrict flags);

void _INC(uint16_t *restrict dst, uint32_t *restrict flags);


#endif //ISA_H

0 comments on commit ff08c63

Please sign in to comment.