Optimize printing functions

This saves 508 bytes in the HOME area by:
- Getting rid of the expensive hex array indexing
- Having print_short and print_long delegate to print_byte

This is at the expense of increasing the stack depth a tiny bit.
Stack usage isn't an issue so far since I see ~96 bytes of
untouched stack memory.
This commit is contained in:
Tobias Diedrich
2026-03-01 12:45:31 +01:00
parent 23e2f5a99e
commit 9bd2d446d7
2 changed files with 35 additions and 24 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ extern __xdata struct uip_eth_addr uip_ethaddr;
// Headers for calls in the common code area (HOME/BANK0)
void print_string(__code char *p);
void print_string_x(__xdata char *p);
void print_long(__xdata uint32_t a);
void print_long(uint32_t a);
void print_short(uint16_t a);
void print_byte(uint8_t a);
void itoa(uint8_t v);