From b79efd608ac379cbafe3e542b0640dd781e711c1 Mon Sep 17 00:00:00 2001 From: inixyz Date: Tue, 17 Oct 2023 23:24:36 +0300 Subject: [PATCH] running the first c code --- src/main.c | 2 +- tests/1.bin | Bin 0 -> 28 bytes tests/a.out | Bin 0 -> 4864 bytes tests/main.c | 3 +++ tests/main.s | 20 ++++++++++++++++++++ tests/test.bin | Bin 16 -> 0 bytes 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 tests/1.bin create mode 100755 tests/a.out create mode 100644 tests/main.c create mode 100644 tests/main.s delete mode 100644 tests/test.bin diff --git a/src/main.c b/src/main.c index d10329c..80c2bb0 100644 --- a/src/main.c +++ b/src/main.c @@ -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){ set_fg_color(BRIGHT_YELLOW); - printf(" %.8x ", addr); + printf(" %.8x ", addr + tinyriscv_MEM_OFFSET); set_fg_color(RESET); for(uint32_t i = addr; i < addr + 16; i++){ diff --git a/tests/1.bin b/tests/1.bin new file mode 100755 index 0000000000000000000000000000000000000000..cca49104d1ca9e630f43c948b3fed65c1c9a7e62 GIT binary patch literal 28 jcmWe;Wc;tJ*2o~t!pJz8oq<8Pm7RfE;TI;S4^;N{k6X+1asgx!ekPJu$BmK{*6Owgrm=rOwXY|nvEK~M6MPow zS0eSLKd)lk!u3~?z8E>;|HJ{(Vb`k2qA=0q5F7C7(LE7uiXZL}^r zoMT<>c6p;yck`a(a7XC2aQDLI_gQ103mv#I831U`ttIpxMqzt#6lB6!2+;ad%Q7aI zxc8&!LfB^SMi>qr`_D%AOZSirRv?jTkYgl`hing>=JHga(LHQZJc{Uj5H%U3;h=%SVzbGR#wJWXsxQR{pfLq=bjNL|1kFnndMiZ literal 0 HcmV?d00001 diff --git a/tests/main.c b/tests/main.c new file mode 100644 index 0000000..98f7e00 --- /dev/null +++ b/tests/main.c @@ -0,0 +1,3 @@ +int main(){ + +} \ No newline at end of file diff --git a/tests/main.s b/tests/main.s new file mode 100644 index 0000000..7e13dcc --- /dev/null +++ b/tests/main.s @@ -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" diff --git a/tests/test.bin b/tests/test.bin deleted file mode 100644 index cf71cef9aa7f8bd137b2d3a2e7062e553a3e4290..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16 YcmbQvz`($~@Bl+H3j@RZeQWOl03&e)n*aa+