解决lb lh 指令没有进行符号扩展的问题
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import shutil
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ CFLAG=[
|
||||
|
||||
SRC=[
|
||||
"riscv/main.c",
|
||||
"riscv/test.c",
|
||||
"riscv/start.S"
|
||||
]
|
||||
|
||||
@@ -36,7 +37,16 @@ LD_FILE="riscv.ld"
|
||||
|
||||
TARGET="riscv"
|
||||
|
||||
OUTPUT="output"
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not os.path.exists(OUTPUT):
|
||||
os.mkdir(OUTPUT)
|
||||
os.system(f"{CC} {' '.join(CFLAG)} {' '.join(SRC)} -T{LD_FILE} -Wall -Wextra -nostartfiles -Wl,-Map,\"{TARGET}.map\" -o {TARGET}.elf")
|
||||
os.system(f"{OBJCPY} -O binary {TARGET}.elf {TARGET}.bin")
|
||||
os.system(f"{OBJCPY} -O ihex {TARGET}.elf {TARGET}.hex")
|
||||
os.system(f"{OBJDUMP} -d {TARGET}.elf > {TARGET}.lst")
|
||||
tagets_list=[f"{TARGET}.bin",f"{TARGET}.hex",f"{TARGET}.lst",f"{TARGET}.map",f"{TARGET}.elf"]
|
||||
for item in tagets_list:
|
||||
if os.path.exists(item):
|
||||
shutil.move(item,f"{OUTPUT}/{item}")
|
||||
|
Reference in New Issue
Block a user