#168357 - moonlightcheese - Fri Apr 24, 2009 6:57 pm
i've tried asking at OSdev.org and there appears to be a problem with the assembler in devKitPro... here's the code.
load.s
load.h
ret is a pretty common instruction, but dkp apparently doesn't like it:
c:/public/projects/CS3243_os_proj/elf_load/elf_v.02/source/load.s:8: Error: bad instruction `ret'
make[1]: *** [load.o] Error 1
make: *** [build] Error 2
so i tried this instruction to return
mov pc, lr
and this doesn't work either. execution simply halts. it doesn't seem like it should be this difficult just to call an assembly subroutine and return a value to C... what am i doing wrong?
load.s
Code: |
.global load
load: mov r0, #5 ret |
load.h
Code: |
extern short load(short address); |
ret is a pretty common instruction, but dkp apparently doesn't like it:
c:/public/projects/CS3243_os_proj/elf_load/elf_v.02/source/load.s:8: Error: bad instruction `ret'
make[1]: *** [load.o] Error 1
make: *** [build] Error 2
so i tried this instruction to return
mov pc, lr
and this doesn't work either. execution simply halts. it doesn't seem like it should be this difficult just to call an assembly subroutine and return a value to C... what am i doing wrong?