Skip to content

Instantly share code, notes, and snippets.

@kigawas
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kigawas/f57aa0ada28aca637839 to your computer and use it in GitHub Desktop.
Save kigawas/f57aa0ada28aca637839 to your computer and use it in GitHub Desktop.
operating system concepts problem 8.24
#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