Re: [Sdcc-user] Z80 Port I/O

2009-12-01 Thread Guy Hutchison
I have gotten the best results by writing the entire routine in assembly and then linking it with C code. The calling convention isn't well documented, but not hard to understand by looking at the list files. Here is a sample routine that takes a single 16 bit argument and returns a 32 bit result

[Sdcc-user] Z80 Port I/O

2009-12-01 Thread Indy Sams
Hello, I needed a Port I/O routine for the Z80 that would accept the address as a parameter, so I wrote 2 functions with inline ASM to do it. I would have used sfr, but the addresses need to be passed as a parameter (ie. I can't just #define or hardcode them). I'm pretty new to ASM, and wi