home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI05.ARJ / ictari.05 / C / CLINK_MC / C_CALLS.MC / CCALLMC.C next >
C/C++ Source or Header  |  1997-09-18  |  1KB  |  34 lines

  1. /*******************************************/
  2. /* Example Lattice C5  -  C link to 68k MC */
  3. /* ------------------     ---------------- */
  4. /* This example consists of :-             */
  5. /* CCALLMC.C     C source code             */
  6. /* CCALLMC1.S    68k Assembler source      */
  7. /* CCALLMC.LNK   LATTICE LINK DESCRIPTION  */
  8. /*                                         */
  9. /* Compile the C code. Assemble the MC     */
  10. /* NB: Use the lattice assembler NOT devpac*/
  11. /*     unless it's devpac 3. You NEED      */
  12. /*     LATTICE Linkable code !!!!!         */
  13. /* Then use the Lattice Linker to link to  */
  14. /* a .PRG file.  (ie) use LINK WITH on the */
  15. /*                    C file.              */
  16. /*******************************************/
  17.  
  18. extern int MC1(int value1, int value2, int value3); /* external function
  19.                                              prototype */
  20.  
  21. void main(void)
  22. {
  23. int value1 = 100;
  24. int value2 = 200;
  25. int value3 = 300;
  26. int ret = 0;
  27.  
  28.     ret = MC1(value1, value2, value3);        /* call machine code just
  29.                                        like any subroutine !  */
  30.  
  31.     printf("\n CALL MC1 returned %d", ret); /*Just to prove it worked.*/
  32.  
  33. /* you might want a pause after excecution - I couldn't be bothered */
  34. }