-4

I'm trying to port some ASM instructions in a source code I have in C and ASM. Can anyone help me to find an instruction set and to understand the uses of the instructions of ARMv7? Actually I'm handling interrupts, so I want to "translate":

iretq
int $0x80
int $0x04

I've never programmer in ARMv7 ASM.

Thanks!

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680
user1189104
  • 79
  • 1
  • 6
  • 2
    Wouldn't it be more productive to ask "what do these instructions do"? Then you would learn something and might be able to port the code yourself, rather than just asking for someone else to do the translation work for you – jalf Oct 27 '13 at 15:51
  • iretq = returns from interrupt; int = calls an interrupt, 1st argument is interrupt number on IDT. thanks anyway... ;) – user1189104 Oct 27 '13 at 15:53
  • 1
    `movs pc, lr` and `svc #0`. I am not sure how an answer is helpful. – artless noise Jul 11 '14 at 20:48

1 Answers1

3

The corresponding Intel intsructions are iret and int, respectively. That said, interrupt handling is highly CPU- and platform-specific; translating commands one-to-one most likely won't yield a working program. If you're developing an application, you shouldn't be messing with interrupts (even int 80h - there are better ways to perform a syscall). If you're developing a driver or an OS kernel, you should learn assembly systematically, rather than translating line by line.

The int command might be theoretically present in application code - it invokes an interrupt, that's an exotic but legitimate way of interacting with the OS. The iret command, on the other hand, should only be used in an interrupt handler. It's never used outside of kernelspace.

Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
  • Platform is Android, CPU is ARMv7 Processor rev 0 (v7l). I also want to know a how-to ASM for that configuration. I wasn't asking for translation if very hard to do with only that information. I want to learn. The problem isn't people think they know when they don't, the problem is I've never used ARM before ;) – user1189104 Oct 27 '13 at 16:21
  • 5
    If you're developing an application, you shouldn't be messing with interrupts (even `int 80h` - there are better ways to perform a syscall). If you're developing a driver or the OS kernel, you should learn assembly systematically, rather than translating line by line. – Seva Alekseyev Oct 27 '13 at 16:25