/* Program to demonstrate compile-time math to calculate upper and lower parts of MIPS address. Written by Dan Stearns Date: 10/10/01 */ #include main() { unsigned int address = 0xfeedface; unsigned short upperPart = address / 65536; unsigned short lowerPart = address * 65536 / 65536; printf ("%s%x\n","upper = ", upperPart); printf ("%s%x\n","lower = ", lowerPart); } /* Output upper = feed lower = face */