I wrote the following experimental program:
//file c_function.h #ifndef c_function_h #define c_function_h int add_int(int a, int b); #endif
//file c_function.c #include "c_function.h" int add_int(int a, int b) { return (a+b); }
//file c_from_assem.a51 ?PR?main?TEST SEGMENT CODE ?DT?main?TEST SEGMENT DATA EXTRN CODE (_add_int) EXTRN CODE (?C_STARTUP) RSEG ?DT?main?TEST ?main?BYTE: result: DS 2 RSEG ?PR?main?TEST USING 0 main: MOV R7,#054H MOV R6,#023H MOV R5,#07BH MOV R4,#00H LCALL _add_int MOV result,R6 MOV result+01H, R7 LOOP: AJMP LOOP RET END