On 9/3/11, Philipp Klaus Krause <p...@spth.de> wrote: > And if yes, why? > > As far as I can see this just ensures that the upper 8 bits of the > address bus are 0 whenever doing I/O, instead of undefined as in the > default --portmode=z80. Is there a use case for this? > > Philipp
Phillipp, I'm the loon that added the --portmode switch. The intention was to allow swithing between the usage of the standard Z80 I/O in/out instructions and the Z180 I/O in0/out0 instructions. The use of these instructions simplifies the access to the internal registers in the Z180/64180 as the I/O decoding for these 'relocatable' ports is 16 bit - regardless of how the rest of the I/O is done. Not forgetting that the 'sfr' definitions can be made 16 bit or 8 bit addressed within the code itself (almost) completely independand of the portmode setting. You are correct in the assumption that all that is achieved is ensuring A15-A8 are 0 during the I/O cycle. As I recall the value output on A15-A8 is determined by the register used to provide the lower 8 bits; ie if C is used B provides the upper 8 bits. I am unsure what using 'A' or a constant gives just now. This was an undocumented behaviour of the orignal Z80 that is documented for the Z180. I certainly have no objection to a fully fledged z180 target ie '-mz180' or such replacing the 'portmode' option - it was merely a mechanism to an end at the time. In fact I probably should have headed that direction in the first place. PeterT :-> PS: I don't know if this rambling helps - but I though I should thow in my $0.02 worth. ------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user