Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
1078 Discussions

Why only CS, IP and EFLAGS are saved while interrupt??

cgopi24
Beginner
136 Views
I am new to assembly programming. I was reading about 386 Interrupt. I came to know that only CS, IP and EFLAGS are saved as a part of interrupt, they pop back when we have iret. But I am wondering, why they didnt save all the visible registers, segments register etc.,???

Please excuse me, if I understood something wrong.

Thanks for your effort in helping me...
0 Kudos
1 Reply
SHIH_K_Intel
Employee
136 Views
Quoting - cgopi24
I am new to assembly programming. I was reading about 386 Interrupt. I came to know that only CS, IP and EFLAGS are saved as a part of interrupt, they pop back when we have iret. But I am wondering, why they didnt save all the visible registers, segments register etc.,???

Please excuse me, if I understood something wrong.

Thanks for your effort in helping me...

Saving only the minimal set of resources to facilitate iret to return control provides more flexibility for programmers to implement interrupt handler without carrying unnecessary overhead.

If a handler modifies ES, for example, it has the responsibility to restore its value prior to iret.

If a handler didn't need to touch ES, would you want the HW for impose the overhead?
Reply