This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can generate the JC instruction with the Keil C compiler

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
; }

Parents
  • The day that a C compiler is "perfect" will never happen. By the old rule 80% of the improvement can be acieved by 20% of the effort and with the market for customers willing to pay 5 times more than currently for a C compiler being minuscule, do not expect the comiler makers to milk every little bit of efficiency.

    Erik

Reply
  • The day that a C compiler is "perfect" will never happen. By the old rule 80% of the improvement can be acieved by 20% of the effort and with the market for customers willing to pay 5 times more than currently for a C compiler being minuscule, do not expect the comiler makers to milk every little bit of efficiency.

    Erik

Children
No data