Re: A83: INI...


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

Re: A83: INI...




> >> I'm trying to use the INI instruction.
> >> Here is what I could find in AsmGuru:
> >>
> >>
> >>  Mnemonic   SZHPNC Description           Notes
> >>
> >>  INI        ?*??1- Input and Increment   (HL)=(C),HL=HL+1,B=B-1
> >>
> >>
> >> All tutorials Copyright (c) James Matthews 1998, unless specified.
> >>
> >>
> >> What does mean the (HL)=(C) ?
> >> What's the difference with (HL)=C ?
> >
> >Correct me if I'm wrong, but I believe it's the same thing as:
> >IN A,(C)
> >LD (HL),A
> >INC HL
> >DEC B
>
> Right, it's the same thing, but I don't understand what's the difference
> between (C) and C.

IN A,C is an incorrect notation.
When you want a load a byte from an adress you use LD HL,(nnnn), because if
you use LD HL,nnnn the value of HL will be the adress, and not the contents
of the adress.

IN A,(C) means load A with the CONTENTS of port C.
There is no other instruction which is represented by IN A,C, so
theoretically it would be possible to use that one, but it wouldn't be
consequent.

So: No () = load with value
() = load with CONTENTS of adress

What about JP (HL), eh?
It doesn't jump to the adress HL, no, it jumps to the adress which is at the
adress HL.


~Grauw


--
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
          email me: laurensh@geocities.com or ICQ: 10196372
             visit the Datax homepage at http://datax.cjb.net/
MSX fair Bussum / MSX Marathon homepage: http://msxfair.cjb.net/
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<



References: