load.s
Code: Select all
ENTRY(load)
stmfd sp!, {r0, r14}
Code: Select all
extern void load(short address)
Code: Select all
ENTRY(load)
stmfd sp!, {r0, r14}
Code: Select all
extern void load(short address)
it compiles whether or not i compile in the load.s file in the sources... kind of weird.skyking wrote:Yes, and what happened?
Code: Select all
.globl load
load:
ok cool. i was going off examples so i had no idea what to do. everything works except the 'ret', for which i get a compiler error "bad instruction". do i need to define 'ret' myself?yemista wrote:I think entry is actually used to tell the linker that this will be the first thing to execute in the final code. What you want to do is in the assembly file
global some_func;
some_func:
ret
and in the c file
extern void some_func();
some_func();
There also might be some differences depending on the tools you are using.
yes, i've written assembly for SPARC and some for ARM but i'm just learning. i'm familiar with ret but the compiler gives me a bad instruction error... i was a bit confused. i'm using devKitPro (gcc 4.3 eabi for ARM). not sure why it won't compile...yemista wrote:Im sorry to ask this, but do you know assembly at all? ret is just a return instruction.
Code: Select all
.global load
load:
mov r0, #5
ret
Code: Select all
extern short load(short address);
yea, that's the same answer i got here:skyking wrote:Do you have handlers that will report aborts and undefined instructions? Do you mix thumb and arm instruction sets? In that case you should probably use the bx in order to return to the caller.