HI,Dear all, I did'nt want to use the SRC and ASM,How can Gen the JC instruction in keil?such as following. I used three byte,but used the union struct must define a double word var,You know,The Keil will gen a assemble code more waste the CPU time.So I have following code,to finish a add with 3-byte,but the keil compiler is not smart. CY = 0; V_0 += 0x07; if(CY) { CY = 0; V_1 += 1; if(CY) { CY = 0; V_2 += 1; } } ********************************** ; CY = 0; ; SOURCE LINE # 1254 CLR CY ; V_0 += 0x07; ; SOURCE LINE # 1255 MOV A,#07H ADD A,V_0 MOV V_0,A ; ; if(CY) ; SOURCE LINE # 1257 JNB CY,?C0017 ; { ; SOURCE LINE # 1258 ; CY = 0; ; SOURCE LINE # 1259 CLR CY ; V_1 += 1; ; SOURCE LINE # 1260 INC V_1 ; ; if(CY) ; SOURCE LINE # 1262 JNB CY,?C0017 ; { ; SOURCE LINE # 1263 ; CY = 0; ; SOURCE LINE # 1264 CLR CY ; V += 1; ; SOURCE LINE # 1265 INC V_2 ; }
Uhhh. The Keil compiler supports the long and unsigned long types which are 32-bit. They are already fully implemented and supported. Why re-create the wheel? Jon