running the first c code

This commit is contained in:
inixyz
2023-10-17 23:24:36 +03:00
parent 8920adc805
commit b79efd608a
6 changed files with 24 additions and 1 deletions

View File

@@ -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

Binary file not shown.

BIN
tests/a.out Executable file

Binary file not shown.

3
tests/main.c Normal file
View File

@@ -0,0 +1,3 @@
int main(){
}

20
tests/main.s Normal file
View 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"

Binary file not shown.