Skip to content

Commit

Permalink
feat: add ex 4-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ludics committed Aug 27, 2023
1 parent dd7e928 commit 2ed54b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/exercises/ex_4_1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CC=riscv64-linux-gnu-gcc

all:
$(CC) hello.c -I/usr/riscv64-linux-gnu/include -static -march=rv64id -g -Wall -o hello.elf

run:
qemu-riscv64 hello.elf

clean:
rm -rf *.o *.bin *.elf
7 changes: 7 additions & 0 deletions code/exercises/ex_4_1/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

int main()
{
printf("Hello World!\n");
return 0;
}

0 comments on commit 2ed54b3

Please sign in to comment.