Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit 972b41b

Browse files
author
f74064054@mail.ncku.edu.tw
committed
Fix the uninitialized problem of stack pointer
1 parent 67afb9b commit 972b41b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

emu-rv32i.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,8 @@ int main(int argc, char** argv)
21442144

21452145
/* run program in emulator */
21462146
pc = ram_start;
2147+
/* Initialize the address of stack pointer*/
2148+
reg[2] = ram_start + RAM_SIZE - 4;
21472149
riscv_cpu_interp_x32();
21482150

21492151
uint64_t ns2 = get_clock();

0 commit comments

Comments
 (0)