Why do my assembly language swi calls sometimes cause problems?
If you are using ARM SDT tools then you must make sure that you tell the compiler what registers are being used by bios swi code so that the compiler will know what registers will be safe and what registers will be destroyed by the swi. YOU MUST ALWAYS TELL THE COMPILER THAT THE LR REGISTER WILL BE DESTROYED. Read that last sentence one more time to commit it to memory. 😉 Here is the format for passing that info: swi 0x?, {input registers}, {output register}, {lr,destroyed registers} If the swi call requires no input or output registers, then use the following format as an example: swi 0x?