void main() { unsigned char value; unsigned int ivalue; unsigned long lvalue; //unsigned int crc; //unsigned char crc8; //HotC51汇编数组宏全面支持带参数输入输出的"数组函数"
//0.无输入参数,无结果返回 macroInterface.Vtbl.macroFunction1();
//1.单输入参数,无结果返回 macroInterface.Vtbl.macroFunction2(0x5a); macroInterface.Vtbl.macroFunction3(0x1234); macroInterface.Vtbl.macroFunction4(0x12345678L);
//2.双输入参数,无结果返回 macroInterface.Vtbl.macroFunction5(0x55, 0xaa); macroInterface.Vtbl.macroFunction6(0x55, 0x1234); macroInterface.Vtbl.macroFunction7(0x1234, 0x12); macroInterface.Vtbl.macroFunction8(0x1234, 0x5678);
//3.三输入参数,无结果返回 macroInterface.Vtbl.macroFunction9(0x12, 0x34, 0x56); macroInterface.Vtbl.macroFunction10(0x12, 0x34, 0x1234);
//80.无输入参数,单字节返回 value = macroInterface.Vtbl.macroFunction11();
//81.单输入参数,单字节返回 value = macroInterface.Vtbl.macroFunction12(0x5a); value = macroInterface.Vtbl.macroFunction13(0x1234); value = macroInterface.Vtbl.macroFunction14(0x12345678L);
//82.双输入参数,单字节返回 value = macroInterface.Vtbl.macroFunction15(0x55, 0xaa); value = macroInterface.Vtbl.macroFunction16(0x55, 0x1234); value = macroInterface.Vtbl.macroFunction17(0x1234, 0x12); value = macroInterface.Vtbl.macroFunction18(0x1234, 0x5678);
//83.三输入参数,单字节返回 value = macroInterface.Vtbl.macroFunction19(0x12, 0x34, 0x56); value = macroInterface.Vtbl.macroFunction20(0x12, 0x34, 0x1234);
//三输入参数,单字返回 ivalue = macroInterface.Vtbl.macroFunction21(0x1234, 0x1234, 0x1234); //三输入参数,双字返回 lvalue = macroInterface.Vtbl.macroFunction22(0x1234, 0x1234, 0x1234); ///////// }
//hotmacro.h V1.09 /*-------------------------------------------- 定义COM接口 --------------------------------------------*/ //com函数指针表 interface { load_comPointer(macroFunction1);//装载汇编数组"函数"指针 load_comPointer_U8(macroFunction2, arg1);//装载汇编数组"函数"指针 load_comPointer_U16(macroFunction3, arg1);//装载汇编数组"函数"指针 load_comPointer_U32(macroFunction4, arg1);//装载汇编数组"函数"指针
load_comPointer_U8U8(macroFunction5, arg1, arg2);//装载汇编数组"函数"指针 load_comPointer_U8U16(macroFunction6, arg1, arg2);//装载汇编数组"函数"指针 load_comPointer_U16U8(macroFunction7, arg1, arg2);//装载汇编数组"函数"指针 load_comPointer_U16U16(macroFunction8, arg1, arg2);//装载汇编数组"函数"指针
load_comPointer_U8U8U8(macroFunction9, arg1, arg2, arg3);//装载汇编数组"函数"指针 load_comPointer_U8U8U16(macroFunction10, arg1, arg2, arg3);//装载汇编数组"函数"指针
load_comPointerU8(macroFunction11);//装载汇编数组"函数"指针 load_comPointerU8_U8(macroFunction12, arg1);//装载汇编数组"函数"指针 load_comPointerU8_U16(macroFunction13, arg1);//装载汇编数组"函数"指针 load_comPointerU8_U32(macroFunction14, arg1);//装载汇编数组"函数"指针
load_comPointerU8_U8U8(macroFunction15, arg1, arg2);//装载汇编数组"函数"指针 load_comPointerU8_U8U16(macroFunction16, arg1, arg2);//装载汇编数组"函数"指针 load_comPointerU8_U16U8(macroFunction17, arg1, arg2);//装载汇编数组"函数"指针 load_comPointerU8_U16U16(macroFunction18, arg1, arg2);//装载汇编数组"函数"指针
load_comPointerU8_U8U8U8(macroFunction19, arg1, arg2, arg3);//装载汇编数组"函数"指针 load_comPointerU8_U8U8U16(macroFunction20, arg1, arg2, arg3);//装载汇编数组"函数"指针
load_comPointerU16_U16U16U16(macroFunction21, arg1, arg2, arg3);//装载汇编数组"函数"指针 load_comPointerU32_U16U16U16(macroFunction22, arg1, arg2, arg3);//装载汇编数组"函数"指针
}IHotMacroCom_Vtbl_Interface, *pIHotMacroCom_Vtbl_Interface;
//com函数调用的com接口 interface { const IHotMacroCom_Vtbl_Interface Vtbl;//com函数指针表 }IHotMacroCom_Interface, *pIHotMacroCom_Interface;
//声明汇编数组“函数”接口 extern code const IHotMacroCom_Interface macroInterface;
//hotmacro.c #include "hotmacro.h"
macro_Proc (macroFunction1) { macro_return() }; macro_Proc_U8 (macroFunction2, HotASMU8_ARGUMENT1) { macro_return() }; macro_Proc_U16 (macroFunction3, HotASMU16_ARGUMENT1) { macro_return() }; macro_Proc_U32 (macroFunction4, HotASMU32_ARGUMENT1) { macro_return() }; macro_Proc_U8U8 (macroFunction5, HotASMU8_ARGUMENT1, HotASMU8_ARGUMENT2) { macro_return() }; macro_Proc_U8U16 (macroFunction6, HotASMU8_ARGUMENT1, HotASMU16_ARGUMENT2) { macro_return() }; macro_Proc_U16U8 (macroFunction7, HotASMU16_ARGUMENT1, HotASMU8_ARGUMENT2) { macro_return() }; macro_Proc_U16U16 (macroFunction8, HotASMU16_ARGUMENT1, HotASMU16_ARGUMENT2) { macro_return() }; macro_Proc_U8U8U8 (macroFunction9, HotASMU8_ARGUMENT1, HotASMU8_ARGUMENT2, HotASMU8_ARGUMENT3) { macro_return() }; macro_Proc_U8U8U16 (macroFunction10, HotASMU8_ARGUMENT1, HotASMU8_ARGUMENT2, HotASMU16_ARGUMENT3) { macro_return() };
macro_ProcU8 (macroFunction11) { macro_return() }; macro_ProcU8_U8 (macroFunction12, HotASMU8_ARGUMENT1) { macro_return() }; macro_ProcU8_U16 (macroFunction13, HotASMU16_ARGUMENT1) { macro_return() }; macro_ProcU8_U32 (macroFunction14, HotASMU32_ARGUMENT1) { macro_return() }; macro_ProcU8_U8U8 (macroFunction15, HotASMU8_ARGUMENT1, HotASMU8_ARGUMENT2) { macro_return() }; macro_ProcU8_U8U16 (macroFunction16, HotASMU8_ARGUMENT1, HotASMU16_ARGUMENT2) { macro_return() }; macro_ProcU8_U16U8 (macroFunction17, HotASMU16_ARGUMENT1, HotASMU8_ARGUMENT2) { macro_return() }; macro_ProcU8_U16U16 (macroFunction18, HotASMU16_ARGUMENT1, HotASMU16_ARGUMENT2) { macro_return() }; macro_ProcU8_U8U8U8 (macroFunction19, HotASMU8_ARGUMENT1, HotASMU8_ARGUMENT2, HotASMU8_ARGUMENT3) { macro_return() }; macro_ProcU8_U8U8U16 (macroFunction20, HotASMU8_ARGUMENT1, HotASMU8_ARGUMENT2, HotASMU16_ARGUMENT3) { macro_return() };
macro_ProcU16_U16U16U16 (macroFunction21, HotASMU16_ARGUMENT1, HotASMU16_ARGUMENT2, HotASMU16_ARGUMENT3) { macro_return() };
macro_ProcU32_U16U16U16 (macroFunction22, HotASMU16_ARGUMENT1, HotASMU16_ARGUMENT2, HotASMU16_ARGUMENT3) { macro_return() };
code const IHotMacroCom_Interface macroInterface =//物理分配的COM接口 { load_MacroProc(macroFunction1),//装载汇编数组"函数"
load_MacroProc_U8(macroFunction2, arg1),//装载汇编数组"函数" load_MacroProc_U16(macroFunction3, arg1),//装载汇编数组"函数" load_MacroProc_U32(macroFunction4, arg1),//装载汇编数组"函数"
load_MacroProc_U8U8(macroFunction5, arg1, arg2),//装载汇编数组"函数" load_MacroProc_U8U16(macroFunction6, arg1, arg2),//装载汇编数组"函数" load_MacroProc_U16U8(macroFunction7, arg1, arg2),//装载汇编数组"函数" load_MacroProc_U16U16(macroFunction8, arg1, arg2),//装载汇编数组"函数"
load_MacroProc_U8U8U8(macroFunction9, arg1, arg2, arg3),//装载汇编数组"函数" load_MacroProc_U8U8U16(macroFunction10, arg1, arg2, arg3),//装载汇编数组"函数"
load_MacroProcU8(macroFunction11),//装载汇编数组"函数"
load_MacroProcU8_U8(macroFunction12, arg1),//装载汇编数组"函数" load_MacroProcU8_U16(macroFunction13, arg1),//装载汇编数组"函数" load_MacroProcU8_U32(macroFunction14, arg1),//装载汇编数组"函数"
load_MacroProcU8_U8U8(macroFunction15, arg1, arg2),//装载汇编数组"函数" load_MacroProcU8_U8U16(macroFunction16, arg1, arg2),//装载汇编数组"函数" load_MacroProcU8_U16U8(macroFunction17, arg1, arg2),//装载汇编数组"函数" load_MacroProcU8_U16U16(macroFunction18, arg1, arg2),//装载汇编数组"函数"
load_MacroProcU8_U8U8U8(macroFunction19, arg1, arg2, arg3),//装载汇编数组"函数" load_MacroProcU8_U8U8U16(macroFunction20, arg1, arg2, arg3),//装载汇编数组"函数"
load_MacroProcU16_U16U16U16(macroFunction21, arg1, arg2, arg3),//装载汇编数组"函数" load_MacroProcU32_U16U16U16(macroFunction22, arg1, arg2, arg3),//装载汇编数组"函数"
};
|