Re: A86: That crazy IX register


[Prev][Next][Index][Thread]

Re: A86: That crazy IX register






Stephen Horne wrote:

> I might have asked this before, but can one use the IX register like you
> would any other register?? If not, in what context is it used? I'd assume
> you can't split it up as I and X, but can do you things like ld ix,hl (for
> example.)

It can be used the same way as HL & can index in addition to that (it can
address a byte up to a distance of 128 bytes before it and 127 after it -- <ld
(ix-7),a>, for example).  You can use the high and low registers of IX, but not
with any innate instructions.  The high register of the IX pair is called IXH
and the low register of IX is called IXL.  If you use TASM to compile you can
edit the file TASM80.tab to include the "undocumented" opcodes, if you don't
use TASM, you will have to be content with inserting the opcodes into your
source w/ .dbs.For information on the undocumented opcodes, go to:
 http://www.geocities.com/SiliconValley/Peaks/3938/z80undoc.htm

The new opcodes for IX and IY are basicly the opcodes for instructions
employing H or L, but with $dd (for IX) or a $fd (for IY) added before it.
Example:

 and l        ;opcode: $a5
 and ixl     ;opcode: $dda5

>
>
> Also, is there an equivalent to ld hl,(sp)? I asked this on #ti, but didn't
> really get an answer. Thanks.

 pop hl / push hl        ;peek at hl

There's also the instruction <ex hl,(sp)>.

> _________________________________________________
> Stephen Horne -- HorneS@rpi.edu -- www.wickedquality.com
>
> :q :q! :wq :w :w! :wq! :quit :quit! :help help helpquit quit quithelp
> :quitplease :quitnow :leave ^X^C ^C ^D ^Z ^Q QUITDAMMIT
> _________________________________________________




References: