On 19 February 2015 at 16:04, Ildar Isaev <i...@inbox.ru> wrote: > A bit clumsy, but something like that. Qemu never gets to the code past stmda. > > -bash-4.1$ cat add.s > > > .text > mov r0, #5 > mov r1, #4 > add r2, r1, r0 > stmda sp, {r1, r2, r5, sp, lr, pc}^ > mov r0, #26 > mov r1, #30
Oh, I see. You're doing a store-multiple user-registers form with the PC in the register list. That's pretty weird, because in that case the PC stored is the current PC whereas the rest of the register are user-mode ones. QEMU mishandles this because it misidentifies it as being some kind of exception-return instruction (when in fact the exception-return insns are only the LDM-user-regs-with-PC encodings). This is a real bug, but your fix is wrong. I'll send out a patch. -- PMM