//------------------------------------------------------------------- // gpastub.cpp // // This program is just a 'stub' for doing a quick test of our // assembly language function named 'gpacalc' which computes a // Grade-Point Average to the nearest hundredth (2-places). // // to compile-and-link: $ g++ gpastub.cpp gpacalc.s -o gpastub // // programmer: ALLAN CRUSE // written on: 08 APR 2009 //------------------------------------------------------------------- #include // for printf(), perror() extern "C" void gpacalc( void ); long credits, qpoints; char gpabuff[ 5 ]; int main( int argc, char **argv ) { credits = 51; qpoints = 132; gpacalc(); printf( "TOTAL CREDITS TAKEN: %d \n", credits ); printf( "TOTAL POINTS EARNED: %d \n", qpoints ); printf( "GRADE-POINT AVERAGE: %s \n", gpabuff ); }