|
Slide 14.8: Calling C/C++ functions Slide 14.10: Calling C/C++ functions (cont.) Home |
|
Irvine32 link library:
Irvine32's link library:
If the assembly language module will be calling procedures from the Irvine32 link library, you must add the C qualifier to the PROTO directive when declaring external C/C++ functions to be called by the assembly module:
INCLUDE Irvine32.inc askForInteger PROTO C showInt PROTO C, value: SDWORD, outWidth: DWORDAssembly language procedures called by the C++ program must use also the C qualifier so the assembler will use a naming convention the linker can recognize. For example,
DisplayFactors PROC C ... DisplayFactors ENDP
.MODEL directive:
If the assembly language code does not call Irvine32 procedures, you can tell the .MODEL directive to use the C calling convention:
; (do not INCLUDE Irvine32.inc) .586 .model flat, CNow you no longer have to add the C qualifier to the
PROTO and PROC directives:
askForInteger PROTO showInt PROTO, value: SDWORD, outWidth: DWORD DisplayFactors PROC ... DisplayFactors ENDP