A question for the developers:
Does SDCC for 8051 ever use any of the BCD instructions (DA and XCHD)? Are they used in the libraries?
DA A is used in printf_fast and printf_tiny. But it is never generated by SDCC.
XCHD is never used nor generated.
I am curious why you ask this.
I'm may be wrong, but I remember, what xchd instruction used as part of fixed-shift (like a >>= 3; ) realization by compiler.
I ask because the BCD opcode implementation is optional in some FPGA 8051 cores; leaving them out saves a few percentage points of area.
If the opcodes are used in some library functions, I guess I can profile my application code to make sure they're not used before turning off their implementation. Though I think it's easier and safer to just implement them unconditionally.
Thank you for the information.
Log in to post a comment.