Should r0-r12 be saved always in case of IRQ or lesser regs be saved

StackOverflow https://stackoverflow.com/questions/23325730

  •  10-07-2023
  •  | 
  •  

سؤال

A trivial question. In case of an IRQ should the irq_handler save r0-r12 on stack always or there can be exception to that.

AFAIK r0-r12 shd be saved.

هل كانت مفيدة؟

المحلول

As you can confirm from the table below except in FIQ mode, registers r0-r12 are shared thus newly entered mode is responsible for not destroying previous mode's registers.

Organization of general-purpose registers and Program Status Registers

Organization of general-purpose registers and Program Status Registers

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top