[net.micro.68k] strange instruction.

liang@cvl.UUCP (Eli Liang) (02/06/85)

I'm posting this for a friend.  He has posed a very interesting question
and my own machine with a 68K is down because of power problems and I
can't try it out.

Does anyone here *KNOW* what the 68K will do when confronted with the
following instruction?

          move.w (A4)+,(A4)+

It seems that this could do any of a number of things, depending on the
actual microcode for the move instruction.  Please, no speculations.
There is enough of that sort of thing on the net :-)

-eli


-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eli Liang  ---
        University of Maryland Computer Vision Lab, (301) 454-4526
        ARPA: liang@cvl, eli@mit-mc, eli@mit-prep  CSNET: liang@cvl
        UUCP: {seismo,allegra,brl-bmd}!umcp-cs!cvl!liang

guy@rlgvax.UUCP (Guy Harris) (02/07/85)

> Does anyone here *KNOW* what the 68K will do when confronted with the
> following instruction?
> 
>           move.w (A4)+,(A4)+

For those of you with insatiable curiosity, it behaves in the "most
straightforward" way - it picks up whatever A4 points to, bumps A4 by
2, drops the picked-up value at the location where A4 now points, and
bumps A4 again.  (Tested on a real live 68000)

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy

shelby@rtech.ARPA (Shelby Thornton) (02/15/85)

> Does anyone here *KNOW* what the 68K will do when confronted with the
> following instruction?
> 
>           move.w (A4)+,(A4)+
> 

This instruction will take the contents of the address in A4 and duplicate
it at the contents of A4+1.

For example, if A4 points to the string "abcd", after this instruction is
executed, the string will be "abab".  To make sure I was correct I wrote a
simple test case and it did exactly this.


						Shelby Thornton
						Relational Technology