Last active
August 29, 2015 14:01
-
-
Save kigawas/f57aa0ada28aca637839 to your computer and use it in GitHub Desktop.
operating system concepts problem 8.24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdlib.h" | |
#include "stdio.h" | |
typedef unsigned long long int ll; | |
int main( int argc, char * argv[] ) { | |
ll v_addr = atoll( argv[1] ); | |
ll page = v_addr; | |
ll offset = v_addr; | |
printf( "The address %llu contains:\n", v_addr ); | |
page = page >> 12; | |
printf( "page number = %llu\n", page ); | |
offset = offset & 0x0FFF; | |
printf( "offset = %llu\n\n", offset ); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment