This topic contains 0 replies, has 0 voices, and was last updated by  EduGorilla 2 years, 6 months ago.

  • Author
    Posts
  • #1427817 Reply
     EduGorilla 
    Keymaster
    Select Question Language :


    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 ?

    Options :-

      Post your Training /Course Enquiry
      Are You looking institutes / coaching center for
      • IIT-JEE, NEET, CAT
      • Bank PO, SSC, Railways
      • Study Abroad
      Select your Training / Study category
    Reply To: There are two segments supported by the hardware. Address spaces are small (1KB), and the amount of ….
    Your information:




    Verify Yourself




    Log in with your credentials

    or    

    Forgot your details?

    Create Account