running the first c code
This commit is contained in:
@@ -80,7 +80,7 @@ void memdump(const tinyriscv_hart* hart, uint32_t addr){
|
|||||||
|
|
||||||
for(uint32_t end_addr = addr + 256; addr < end_addr; addr += 16){
|
for(uint32_t end_addr = addr + 256; addr < end_addr; addr += 16){
|
||||||
set_fg_color(BRIGHT_YELLOW);
|
set_fg_color(BRIGHT_YELLOW);
|
||||||
printf(" %.8x ", addr);
|
printf(" %.8x ", addr + tinyriscv_MEM_OFFSET);
|
||||||
set_fg_color(RESET);
|
set_fg_color(RESET);
|
||||||
|
|
||||||
for(uint32_t i = addr; i < addr + 16; i++){
|
for(uint32_t i = addr; i < addr + 16; i++){
|
||||||
|
|||||||
BIN
tests/1.bin
Executable file
BIN
tests/1.bin
Executable file
Binary file not shown.
BIN
tests/a.out
Executable file
BIN
tests/a.out
Executable file
Binary file not shown.
3
tests/main.c
Normal file
3
tests/main.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
int main(){
|
||||||
|
|
||||||
|
}
|
||||||
20
tests/main.s
Normal file
20
tests/main.s
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
.file "main.c"
|
||||||
|
.option nopic
|
||||||
|
.attribute arch, "rv32i2p1"
|
||||||
|
.attribute unaligned_access, 0
|
||||||
|
.attribute stack_align, 16
|
||||||
|
.text
|
||||||
|
.align 2
|
||||||
|
.globl main
|
||||||
|
.type main, @function
|
||||||
|
main:
|
||||||
|
addi sp,sp,-16
|
||||||
|
sw s0,12(sp)
|
||||||
|
addi s0,sp,16
|
||||||
|
li a5,0
|
||||||
|
mv a0,a5
|
||||||
|
lw s0,12(sp)
|
||||||
|
addi sp,sp,16
|
||||||
|
jr ra
|
||||||
|
.size main, .-main
|
||||||
|
.ident "GCC: () 13.2.0"
|
||||||
BIN
tests/test.bin
BIN
tests/test.bin
Binary file not shown.
Reference in New Issue
Block a user