# Andrew S. Tanenbaum (OS) Edition 4 Exercise 3 Question 21 (Page No. 256)

42 views

Below is an execution trace of a program fragment for a computer with $512-byte$ pages. The program is located at address $1020,$ and its stack pointer is at $8192\:\:($the stack grows toward $0).$ Give the page reference string generated by this program. Each instruction occupies $4$ bytes $(1 \text{word})$ including immediate constants. Both instruction and data references count in the reference string.

• Load word $6144$ into register $0$
• Push register $0$ onto the stack
• Call a procedure at $5120,$ stacking the return address
• Subtract the immediate constant $16$ from the stack pointer
• Compare the actual parameter to the immediate constant $4$
• Jump if equal to $5152$

## Related questions

1
32 views
A student in a compiler design course proposes to the professor a project of writing a compiler that will produce a list of page references that can be used to implement the optimal page replacement algorithm. Is this possible? Why or why not? Is there anything that could be done to improve paging efficiency at run time?
1 vote
A machine has $48-bit$ virtual addresses and $32-bit$ physical addresses. Pages are $8\: KB.$ How many entries are needed for a single-level linear page table?
How can the associative memory device needed for a $TLB$ be implemented in hardware, and what are the implications of such a design for expandability?
A computer whose processes have $1024$ pages in their address spaces keeps its page tables in memory. The overhead required for reading a word from the page table is $5\: nsec.$ To reduce this overhead, the computer has a $TLB,$ which holds $32$ (virtual page, physical page frame) pairs, and can do a lookup in $1\: nsec.$ What hit rate is needed to reduce the mean overhead to $2\: nsec?$