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

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...

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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?

Login to leave a comment.