Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cgopi24
Beginner
40 Views

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

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
40 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?