page and page mask calculation tool