Newsgroups: comp.arch.embedded,comp.robotics,alt.comp.hardware.homebuilt
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!zombie.ncsc.mil!gmi!msunews!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!nntp.brisnet.org.au!hitech.com.au!
From: clyde@hitech.com.au (Clyde Smith-Stubbs)
Subject: Re: Z80 code on a Z80180?
Organization: HI-TECH Software
Date: Mon, 17 Apr 95 23:10:06 GMT
Message-ID: <clyde.798159935@trojan>
References: <D6s2Cn.F6t@serval.net.wsu.edu> <4c7cb$c2531.2d6@news.imagauto.com>
Sender: @hitech.com.au
Lines: 24
Xref: glinda.oz.cs.cmu.edu comp.arch.embedded:648 comp.robotics:20013

jay@iai.mv.com (Jay Francis) writes:

>Just be carefull with the Z180's I/O instructions. It can address 64K of 
>I/O space (as opposed to the Z80's 256). You MUST use the Z180's special 
>16bit I/O instructions to access internal I/O ports (ie. serial and 

This is not strictly true. The Z80 can address 64K of I/O space, but to
do so requires that you use B as the upper part of the I/O address. Thus
the instruction ld (c),a is really ld (bc), a. The direct addressing in and
out instructions are not useful when decoding 16 bit addressing, since the
contents of the accumulator gets output on the high order address lines.

But there is no reason why you can't use the indirect instructions, like
ld (c),a on either a Z80 or Z180. The Z180 just adds in0 and out0 to allow
use of direct I/O port addressing. The internal I/O ports do use
16 bit addressing (they are based at either 0 or 80h) so you must use
either the indirect instructions or the special direct instructions to access
them. Any external I/O ports must also decode the upper address byte at least
partially to avoid conflict with the internal ports.
--
 Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 300 5011
 clyde@hitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 300 5246
                          | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 300 5235
                    HI-TECH C: Compiling the real world...
