-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to assamble the C code in asm code ? #178
Comments
Assuming it runs bare metal: You have to declare your function "foo" in a c file and then compile the assembly file and the c file separately. You need your own linker script as well Here is a good explanation (you just need to follow the upper part of the answer not all) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i want to build a asm code can call C function . but return some error , how can i assemble the C code in asm code ?
`.text
.global _start
.global foo
_start:
la sp, stack_end
li a0 ,1
li a1 ,2
call foo
stop:
j stop
nop
stack_start:
.rept 10
.word 0
.endr
stack_end:
.end`
ERROR: column 9: "foo" declared global label but not defined.
The text was updated successfully, but these errors were encountered: