home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!nsd20463
- From: nsd20463@uxa.cso.uiuc.edu (Nicolas S. Dade)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: problem with movea.l
- Message-ID: <BtrqJF.D7B@news.cso.uiuc.edu>
- Date: 29 Aug 92 23:28:26 GMT
- Article-I.D.: news.BtrqJF.D7B
- References: <1992Aug28.024446.2322@panix.com>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: University of Illinois at Urbana
- Lines: 73
-
- jwp@panix writes:
-
- >> [more move v. movea confusion]
-
- >Actually, a move <something>,An _is_ a movea <something>,An.
-
- >Here's the coding for a move.l <something>,<somethingelse>
-
- >%0010 xxx xxx xxx xxx
- > ^ ^ ^ ^ ^
- > | | | | |
- > | | | | source register
- > | | | source mode
- > | | destination mode
- > | destination register
- > opcode
-
- >Here are the modes and register values--
- >Addressing mode mode register syntax
- >Data reg. direct 000 (number) Dn
- >Address reg. direct 001 (number) An
- >Address reg. indirect 010 (number) (An)
- >Address reg. indirect w/ postincre. 011 (number) (An)+
- >Address reg. indirect w/ predecrem. 100 (number) -(An)
- >Address reg. indirect w/ displacem. 101 (number) d(An)
- >Address reg. indirect w/ index 110 (number) d(An,Xi)
- >Absolute short address 111 000 xxx.W
- >Absolute long address 111 001 xxx.L
- >Program conter w/ displacement 111 010 d(PC)
- >Program conter w/ index 111 011 d(PC,Xi)
- >Immediate data 111 100 #xxx
- >Status register 111 100 SR or CCR
-
- >* Immediate data may only be used for a source operand, and the status
- >register may only be used for a destination operand.
-
- you need another "*" here: not all the address modes may be used for
- the source, and not all the address modes may be used for the destination,
- and the prescription is more complicated than what you've indicated:
-
- On a 68000 the source can be anything except the CCR. (However using
- the SR as the source should not be done unless you've checked the
- AttnFlags and know that you are on a plain 68000 system, or if you
- know you are in supervisor mode. Use GetSR() instead)
-
- However the destination may _not_ _be_ _address_ _register_ _direct_,
- any PC relative mode, or, obviously, immeadiate.
-
- Also the move instructions involving the SR and CCR are not part of the
- general move instruction, as they change the CCR in a quite different way
- than the general move does, or they don't change it at all, and they do
- not have a general addressing mode & register bit pattern. (If you place
- the bit pattern you list above into your instruction you don't get a
- move.w SR,xx or move.w xx,CCR or move.w xx,SR instruction.)
-
-
- >Using those, here is a move.l (a5)+,a0
-
- >%0010 000 001 011 101
-
- All this talk is fine, but what happens when you feed this to a 68000?
- I'll tell you: it punts, and heads straight for the Illegal Op Code
- exception vector. There ain't no such instruction.
-
-
- > [perfectly correct movea explanation & example]
-
- >The only difference is that a movea must move to a address register. (and
- >movea.b is illegal)
-
- and movea does not change the condition codes.
-
- -Nicolas Dade
-