Restructure the processor definition
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
GCC_COMPILER=riscv32-unknown-elf-gcc
|
||||
GCC_OBJCOPY=riscv32-unknown-elf-objcopy
|
||||
|
||||
all:
|
||||
assemble
|
||||
build
|
||||
@echo "Done"
|
||||
all: build
|
||||
|
||||
assemble:
|
||||
$(GCC_COMPILER) -S test.c
|
||||
|
||||
build:
|
||||
$(GCC_COMPILER) -Wl,-Ttext=0x0 -nostdlib -march=rv64i -mabi=lp64 -o test test.S
|
||||
|
||||
bin:
|
||||
$(GCC_OBJCOPY) -O binary test test.bin
|
||||
|
||||
clean:
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
ADDI x2, x0, 1
|
||||
|
||||
loop:
|
||||
SUB x1, x1, x2
|
||||
SW x1, 4(x0)
|
||||
BLT x0, x1, loop
|
||||
@@ -1,6 +1,5 @@
|
||||
ADDI x2, x0, 1
|
||||
jal x0, main
|
||||
|
||||
loop:
|
||||
SUB x1, x1, x2
|
||||
SW x1, 4(x0)
|
||||
BLT x0, x1, loop
|
||||
main:
|
||||
addi t0, x0, 100
|
||||
sb t0, 8(sp)
|
||||
|
||||
BIN
test/test.bin
BIN
test/test.bin
Binary file not shown.
@@ -1,4 +0,0 @@
|
||||
int main() {
|
||||
int x = 1 + 2;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user