There are two segments supported by the hardware. Address spaces are small (1KB), and the amount of physical memory on the system is 16KB. Assume that the segment-0 base register has the value 1KB, and its bounds (size) is set to 300 bytes; this segment grows upward. Assume the segment 1-base register has the value 5KB in it, and its bound is also 300; this segment grows downward (the negative direction). Assume we have the following program:
int main() {
void *ptr = 20;
while (ptr<= 1024) {
int x = (int *) *ptr; // LINE 1: read what is at address ’ptr’
ptr = ptr + 20; // LINE 2: increment ’ptr’ to a new address
}
This program will run for __________ iterations before crashing due to a segmentation fault?