Discussion:
_CHP
(too old to reply)
Byron Blue
2013-07-19 19:06:50 UTC
Permalink
I'm using Watcom 11.0c to add inline assembly to my code.
I used WDIS to disassemble a small object file and am coding it back into
the main code.
Unfortunately, I get the following error:
E1011: Symbol '_CHP' has not been declared
My compiler does not accept the -zri switch for floating point rounding.
What can I do?
Any help is appreciated,
Byron Blue
Jiri Malak
2013-07-21 10:41:54 UTC
Permalink
Please, could you give here code which generate this message.
The problem is related to your code.
Compiler use __CHP symbol for FP rounding, not _CHP.

Jiri
Post by Byron Blue
I'm using Watcom 11.0c to add inline assembly to my code.
I used WDIS to disassemble a small object file and am coding it back into
the main code.
E1011: Symbol '_CHP' has not been declared
My compiler does not accept the -zri switch for floating point rounding.
What can I do?
Any help is appreciated,
Byron Blue
Jiri Malak
2013-07-22 16:43:19 UTC
Permalink
Please don't send reply to my e-mail, use news group to reply.

You send me useless assembly code fragment (only 3 lines).
I need full source file which exhibit your problem, because many things may
be broken.
It is uncleare what you are trying to do from 3 assembly lines.
1. are you trying to use C source file with inline assembly code?
2. are you trying to create assembly source file compilable by WASM?

Anyway -zri option has nothing to do with this problem

Jiri
Post by Byron Blue
I'm using Watcom 11.0c to add inline assembly to my code.
I used WDIS to disassemble a small object file and am coding it back into
the main code.
E1011: Symbol '_CHP' has not been declared
My compiler does not accept the -zri switch for floating point rounding.
What can I do?
Any help is appreciated,
Byron Blue
Byron Blue
2013-07-23 11:35:28 UTC
Permalink
Sorry about that Jiri
Attached is the complete .c file.
It is case #1: Inline assembly.
Thank you once again for your kind help,
Byron

"Jiri Malak" wrote in message news:ksjnf8$pue$***@www.openwatcom.org...

Please don't send reply to my e-mail, use news group to reply.

You send me useless assembly code fragment (only 3 lines).
I need full source file which exhibit your problem, because many things may
be broken.
It is uncleare what you are trying to do from 3 assembly lines.
1. are you trying to use C source file with inline assembly code?
2. are you trying to create assembly source file compilable by WASM?

Anyway -zri option has nothing to do with this problem

Jiri
Post by Byron Blue
I'm using Watcom 11.0c to add inline assembly to my code.
I used WDIS to disassemble a small object file and am coding it back into
the main code.
E1011: Symbol '_CHP' has not been declared
My compiler does not accept the -zri switch for floating point rounding.
What can I do?
Any help is appreciated,
Byron Blue
Jiri Malak
2013-07-23 18:02:36 UTC
Permalink
The problem is caused by incorrect declaration of __CHP function.
You should replace your code
#pragma aux (cdecl) __CHP;
by this one

extern void __CHP( void );
#pragma aux __CHP "*";

It should fix your problem.
But calling __CHP function is danger, because it is internal code generator
function and may not be available if some compiler options are used, by
example option -fpc.
Proper solution is to remove calling to __CHP and including rounding code to
your asm function or put unrounded floating point number back to C part and
round it implicitly by code generated by C compiler.

Jiri
Byron Blue
2013-07-23 18:41:04 UTC
Permalink
Thank you so much.
I will try this.
Have a wonderful day,
Byron

"Jiri Malak" wrote in message news:ksmgft$4q7$***@www.openwatcom.org...

The problem is caused by incorrect declaration of __CHP function.
You should replace your code
#pragma aux (cdecl) __CHP;
by this one

extern void __CHP( void );
#pragma aux __CHP "*";

It should fix your problem.
But calling __CHP function is danger, because it is internal code generator
function and may not be available if some compiler options are used, by
example option -fpc.
Proper solution is to remove calling to __CHP and including rounding code to
your asm function or put unrounded floating point number back to C part and
round it implicitly by code generated by C compiler.

Jiri

Continue reading on narkive:
Loading...