Skip to content

Commit

Permalink
Print stack functionality
Browse files Browse the repository at this point in the history
Signed-off-by: sukhman-sukh <[email protected]>
  • Loading branch information
sukhman-sukh committed Nov 6, 2023
1 parent c258d05 commit 623f308
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7883,6 +7883,7 @@ void CPU::updateTimers(int cycles)

// print elements of calleraddresses stack
void CPU::printStack() {
for(Word i = reg_SP.dat ; i < 0xCFFF ; i++)
printf("%hu",(*mMap)[i]);
printf("Printing Stack....");
for(Word i = reg_SP.dat ; i <= 0xCFFF ; i++)
printf("Address at stack_pointer %hu is %hu ", i, (*mMap)[i]);
}

0 comments on commit 623f308

Please sign in to comment.