/************************************************************************
*									*
*                          Positional Division                          *
*									*
************************************************************************/

/*  Authors:  Saeid Nooshabadi and John Zaitseff
    Date:     8th March, 2003
    Version:  1.2

    This program calls the function posndiv(), written in assembly
    language in an external file, to calculate the result of a division.

    You can use "make -f posn-div-v2.s" to create the executable
    posn-div-v2.elf.  That executable uses this file as the main program
    and posn-div-v2.s as the file containing the function posndiv().

    Hint: You might want to consult the examples/intro directory on your
    CD-ROM for hints on how to write an external function in assembly
    language.
*/


/*  ---------------------------------------------------------------------
    Function prototypes
*/

extern int posndiv (int dividend, int divisor);
    /* Divide dividend by divisor and return the quotient */


/*  ---------------------------------------------------------------------
    Function:    main           - Main program entry point
    Parameters:  (none)         - No parameters are passed
    Returns:     int            - Result of a division calculation

    This program calculates the result of a division, using an externally-
    defined function posndiv().  The result is returned to the operating
    system as the exit code.
*/

int main (void)
{
    int a = 23;
    int b = 3;
    int c;

    c = posndiv(a, b);

    return c;
}

