From: Peter T. <Pet...@ta...> - 2003-07-15 23:37:05
|
Just a quick comment regarding the port access methods (or lack there = of) in the Z80 port of SDCC. I find Philipp's solution very useful and helpfull, but I wonder if the = implementations of inp/outp (or inb/outb which ever suits) might not be = better implemented as built-in functions in the compiler. =20 The mechanism for doing built-in functions seems to be there in the = files src/z80/main.c and src/z80/gen.c ( function genBuiltIn()) but this = code does not seem to be used (at all). There seems to be code there = for built-in strcpy() & memcpy() which may be able to be used (assuming = it works) and there are definately a number of examples of = implementation in the 8051 versions of the same file. An other alternative would be to emulate the use of the special words = (like xdata etc) and implement a specific 'port' addressing mode with = usage such as 'port at (0x42) unsigned char CtrlPort;' say. Admittedly = such a change would required a great deal deeper understanding of the = SDCC code-base than I currently have. Anyone else have any other (possibly better) ideas ? Peter Townson. |