Skip to content

Commit

Permalink
update PSEMU/CPU.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherrytree56567 committed Oct 4, 2023
1 parent 68089a8 commit e5f132f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PSEMU/CPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ void CPU::loadInstructions() {
}

void CPU::run() {
registers.pc = 0; // Start from the beginning of memory
registers.pc = 0xbfc00000; // Start from the beginning of memory
registers.next_pc = pc + 4;

while (registers.pc < numInstructions * 4) {
uint32_t instruction = memory.readWord(registers.pc);
Expand Down Expand Up @@ -949,7 +950,8 @@ void CPU::run() {
}

// Program Counter
registers.pc += 4; // 4 Bytes = 32 Bits
registers.pc = registers.next_pc; // 4 Bytes = 32 Bits
registers.next_pc += 4;

// Interrupts
if (checkForInterrupts()) {
Expand Down

0 comments on commit e5f132f

Please sign in to comment.