|
Slide 14.9: Calling C/C++ functions (cont.) Slide 14.11: Calling C/C++ functions (cont.) Home |
|
bool and char values are returned in AL.
short int values are returned in AX.
int and long int values are returned in EAX.
EAX.
float, double, and long double values are pushed on the floating-point stack as 4-, 8-, and 10-byte values, respectively.
main.cpp:
main( ) is the entry point of main.cpp.
It ensures the execution of required C++ language initialization code.
DisplayFactors performs the following tasks:
askForInteger that inputs an integer n from the user.
n to 1.
showInt if the remainder is zero.
ECX must be pushed and popped before calling showInt because Visual C++ functions may use general-purpose registers and do not save and restore them.
askForInteger( ) returns its result in the EAX register.
showInt displays an integer with a specified width by using setw.