From: Rod B. <rod...@st...> - 2002-08-09 14:27:46
|
I'm sure this wont work on the Z80 as the Z80 has two separate memory maps 64K for ROM and RAM and 64K for IO it uses a separate control line to the addressing and everything. If you IO was memory mapped you maybe able to use a similar mechanism. I think if I remember my Z80 Peter is looking or an inp or outp assembly instruction similar to the 80x86 instructions. I will dig up what I have at home and play with this to see if I can get anything to work. Regards, Rod Boyce -----Original Message----- From: Aaron [mailto:aa...@bo...] Sent: Thursday, August 08, 2002 5:29 PM To: Peter Townson Cc: sdc...@li... Subject: Re: [Sdcc-user] z80 port questions Peter, I'm not familiar with the Z80 port (actually just getting started with SDCC with the PIC port), but I'd guess that you are looking for the 'sfr' command. Example: sfr at 0x0006 PORTB; For the pic16F877, this references the output port A, which just happens to be memory mapped to the register at 0x0006. Once you've defined something like this, you can do 'PORTB=0x55;' in the code somewhere and have it happen. Likely you'll want a header file with all the registers of your processor all laid out with sfr commands so that you have easy access to everything. Hopes this helps... and hope that I'm right. <grin> Aaron On Fri, 9 Aug 2002 08:10:16 +1000 Peter Townson <PTo...@ta...> wrote: > Hi, > I'm looking for some basic information about using the Z80 port of SDCC. > > Is there a high level method to access the Z80 port space ? ie in C syntax > rather than assembler (yes I know that this does not fall within the ANSI > standard). > > I have looked for such library funcitons of inp() & outp() but did/could not > find 'em. > > I have tried searching though the existing documentation without sucess > (there being very little about the Z80 port). > > I have attempted to use the 'ultimate documentation' method of reading the > code without sucess. > > Similarly, I have had very little sucess in attempts to define macros with > inlined-assembler to fullfill these functions. > > To re-iterate, I'm looking for the 'correct' method of achieving port access > with SDCC's z80 port. > > Any and all help would be appreciated. > > Peter Townson :-> ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Sdcc-user mailing list Sdc...@li... https://lists.sourceforge.net/lists/listinfo/sdcc-user |