I'm trying to learn how to implement interrupts in C code for a Z80 controller board I made with a CTC and SIO/0 to get the console port running. I'm not having much success to figure out how to code this. I was wondering if there were any C code examples for the Z80 that I could use as a reference as the sdcc manual doesn't seem to describe this.
I've normally worked with assembly code to get something like this running on my other vintage computers - some using the 8080, 6502 or 6800. Now that I have SDCC installed, I like to learn how to do this in C code - much like what I do with present-day microcontrollers, such as the AVR. This is just a generic Z80 board that I made, not any home microcomputer.The serial port has a Z80A CTC and Z80A SIO/0 with a Z80A running at 4Mhz. I have 32KB peprom at 0x0000 and 32KB Sram at 0x8000. The wiring on this board has the standard configuration that I used from the SIO manual with the IEI and IEO wired from the CTC to the SIO/0. The I/O ports for the CTC is 0xE0 and teh SIO/0 is 0xC0 What I'm not sure is how to organize and code the proper syntax needed for the interrupt service routines on the SIO/0 interrupts. I'm familiar now with how SDCC lets me organize the I/O ports in C code. Using the "__sfr __at " syntax to define the I/O ports. As this board also has a 8255 PIO, at I/O port oxF0. And I've written some C code to test this and I can write and read to all 3 ports on the 8255. I used this part versus the Z80PIO because I can get 24 bits of I/O with one part instead of 16bits with the Z80PIO. any info is appreciated thanks, Dan ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user