Small changes
This commit is contained in:
parent
4d81f2b32b
commit
808d51918f
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
/target
|
/target
|
||||||
|
Cargo.lock
|
||||||
|
|
|
||||||
7
Cargo.lock
generated
7
Cargo.lock
generated
|
|
@ -1,7 +0,0 @@
|
||||||
# This file is automatically @generated by Cargo.
|
|
||||||
# It is not intended for manual editing.
|
|
||||||
version = 3
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "salt-n-vinegar"
|
|
||||||
version = "0.1.0"
|
|
||||||
8
notes/registers.txt
Normal file
8
notes/registers.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
16 8-bit general registers, V0 -> VF
|
||||||
|
1 16-bit register I, only 12 bits are used
|
||||||
|
|
||||||
|
Program counter (PC) should be 16-bit, and is used to store the currently executing address.
|
||||||
|
The stack pointer (SP) can be 8-bit, it is used to point to the topmost level of the stack.
|
||||||
|
The stack is an array of 16 16-bit values, used to store the address that the interpreter shoud return to when finished with a subroutine.
|
||||||
|
Chip-8 allows for up to 16 levels of nested subroutines.
|
||||||
|
|
||||||
7
src/chip8.rs
Normal file
7
src/chip8.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Miscellanious registers
|
||||||
|
static mut program_counter: u16 = 0;
|
||||||
|
static mut stack_ptr: u8 = 0;
|
||||||
|
|
||||||
|
// General purpose registers
|
||||||
|
static mut registers: [u8; 16] = [0; 16];
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user