|
|
|||||||
|
Please use Code tags to maintain formatting and improve code readability. I have added them here. (admin) Code: void delay(unsigned char x); 编译中... HI-TECH C COMPILER (Holtek MCU) V9.10PL6 Copyright (C) 1984-2006 HI-TECH SOFTWARE licensed for evaluation purposes only this licence will expire on Tue, 04 Dec 2007 : 0: (800) undefined symbol "_delay" Compilation failed - error code 1 why? |
||||||||
|
|
|||||||
|
I don't use the Holtek toolchain, but HI-TECH's documentation for other processors has been pretty good about detailing the naming conventions required to interface C to ASM. Does your query originate because of a discrepancy between the toolchain documentation and the toolchain behavior? |
||||||||
|
|
|||||||
Quote:Our PRO compilers with OCG (of which the HOLTEK compiler is one) do very aggressive dead-code elimination and if a C function or variable is not accessed from within C code it will probably not exist in the output. Unless you've got a very good reason to do so, you should not try to do stuff with inline assembly code that can much more easily be done in C. By The Way, you should also avoid using #asm / #endasm close to C flow-control constructs like for, while, if, etc., as recommended in the manual. |
||||||||
|
|
|||||||
|
please explain me the rule of parameters' transmition (from asm to c) ex: xyz(unsigned char x,unsigned char y,unsigned char z) |
||||||||
|
|
|||||||
|
in other words,what's the difference between holtek c compile and HI-tech c compile about parameters'transmiting(from asm to c) |
||||||||
|
|
|||||||
|
I'm using the H8/300H compiler. For that compiler it's better to use the C-function asm() to have assembly lines included. In that way, many problems can be prevented. For example: asm("BCLR #7,@_SCI0_SSR"); // TDRE = 0 With kind regards from a rainy Holland. Cojan Prins. |
||||||||
|
|
|||||||
|
Unless you've got a very good reason to do so, you should not try to do stuff with inline assembly code that can much more easily be done in C. using by interrupt program......... |