/*---------------------------------------------------------------------------
功能: 查找汉字起始地址 输入: 汉字机内码 输出: 该汉字的首地址 ---------------------------------------------------------------------------*/ static INT8U* GetHzModelInMem(INT16U uiHZCode) { #define hzNum 7
INT8U hzIndex[hzNum] = { //汉字机内码定义 0xb0,0xe6,0xb1,0xbe,0xb1,0xe3,0xb2,0xc9, 0xb3,0xfd,0xb6,0xaf,0xb6,0xc8,0xb7,0xb6, 0xb7,0xe5,0xba,0xc5,0xbc,0xc6,0xbc,0xd3, 0xbc,0xe4,0xbd,0xe2,0xc0,0xad,0xc1,0xa6, 0xc1,0xe3,0xc2,0xca,0xc7,0xe5,0xc9,0xe8, 0xca,0xb1,0xca,0xbd,0xcb,0xd9,0xcd,0xc6, 0xce,0xa7,0xd0,0xaf,0xd0,0xcd,0xd1,0xf9, 0xd6,0xb5,0xd6,0xc3,0xd6,0xd8,0xd7,0xd4 }; INT8U code_n = 0; INT8U *code_ptr = hzdot;
for( code_n = 0;code_n<hzNum;code_n++ ) { if (uiHZCode == hzIndex[code_n] ) { //-找到地址 break; } } return(code_ptr + (code_n*32) ); }
#endif
INT8U * ptr = GetHzModelInMem('便'); //'便'字的首地址
没有办法.想要方便得多出这些 INT8U hzIndex[hzNum] = { //汉字机内码定义 0xb0,0xe6,0xb1,0xbe,0xb1,0xe3,0xb2,0xc9, 0xb3,0xfd,0xb6,0xaf,0xb6,0xc8,0xb7,0xb6, 0xb7,0xe5,0xba,0xc5,0xbc,0xc6,0xbc,0xd3, 0xbc,0xe4,0xbd,0xe2,0xc0,0xad,0xc1,0xa6, 0xc1,0xe3,0xc2,0xca,0xc7,0xe5,0xc9,0xe8, 0xca,0xb1,0xca,0xbd,0xcb,0xd9,0xcd,0xc6, 0xce,0xa7,0xd0,0xaf,0xd0,0xcd,0xd1,0xf9, 0xd6,0xb5,0xd6,0xc3,0xd6,0xd8,0xd7,0xd4 }; ROM不够的像这我样定义,RAM不够的加code |