UNIT-III DEPARTMENT OF INFORMATION TECHNIOLOGY::SVECW Page 14 3.12 Overlapping Register windows
3.13 Circular Buffer Organization of Overlapping Windows The circular organization is shown in Figure 3.13, which depicts a circular buffer of six windows. The buffer is filled to a depth of 4 (A called BB called CC called D) with procedure D active. The current- window pointer (CWP) points to the window of the currently active procedure. Register references by a machine instruction are offset by this pointer to determine the actual physical register. The saved-window pointer (SWP) identifies the window most recently saved in memory. If procedure
D now calls procedure E, arguments for E are placed in D’s temporary registers (the overlap between wand wand the CWP is advanced by one window. If procedure E then makes a call to procedure F, the call cannot be made with the current status of the buffer. This is because F’s window overlaps A’s window. If F begins to load its temporary registers,
preparatory to a call, it will overwrite the parameter registers of AA. in. Thus, when CWP is incremented (modulo 6) so that it becomes equal to SWP, an interrupt occurs, and As window is saved. Only the first two portions (A. in and A.loc) need be saved. Then, the SWP is incremented and the call to F proceeds. A similar interrupt can occur on returns. For example, subsequent
to the activation of F, when B returns to A, CWP is decremented and becomes equal to SWP. This causes an interrupt that results in the restoration of A’s window.
Share with your friends: