Undocumented opcode: AAX

Undocumented opcode: AAX

Post by C. Bon » Fri, 06 Aug 2004 00:10:56


The information I have gotten for the 'undocumented opcode'
called AAX or SAX,
(A & X) -> M, indicates that this opcode affects the N and
Z flags. My own tests suggest that
the flags are *not* affected, and this instruction behaves
like other store operations.

Has anyone tested this and formed an opinion about its
affect on the flags? I'm confused...
 
 
 

Undocumented opcode: AAX

Post by Thomas Ric » Fri, 06 Aug 2004 00:23:29

Hi,


What's the (hex) opcode for this?

As a side remark, some of the "extended" opcodes are not
properly documented as their precise function also depends
on "what's going on at the bus" while they're executed. Thus,
the behaivour may even vary.

Greetings,
Thomas

 
 
 

Undocumented opcode: AAX

Post by C. Bon » Fri, 06 Aug 2004 02:17:26


It comes in various addressing mode flavors, but I tested the
zero page version, opcode $87.
Apparently some undocumented codes are not generally useful,
since they have unknown or
unpredictable dependencies, as you noted. But a few of these
codes appear to be reliable,
and are sometimes used without problems. AAX (or SAX) seems
solid, but as I posted
the flags seem unaffected, contrary to the documents available
on the internet.
 
 
 

Undocumented opcode: AAX

Post by Thomas Ric » Fri, 06 Aug 2004 17:01:50

Hi,


You seem to be right, the flags are also unaffected according to
my own reference. I made a couple of tests back then for the atari++
emulator, found this opcode also reliable, but it doesn't alter the
flags here either. The reason why this opcode works is not because
it goes thru the AND unit of the ALU where it would set the status
flags. Instead, the CPU pushes the A and X register simultaneously
onto the bus, and due to the electrical characteristics of the
corresponding output drivers, the result is the binary AND of both
A and X register, so you shouldn't expect status flags to be set in
any way. Thus "SAX" is just a combined "STA" and "STX", and both
don't affect the status.

So long,
Thomas
 
 
 

Undocumented opcode: AAX

Post by C. Bon » Sun, 08 Aug 2004 02:15:21


Can you point me to a document which *correctly* explains the
undocumented opcodes?

If not, thanks for the the above anyway...
 
 
 

Undocumented opcode: AAX

Post by Thomas Ric » Sun, 08 Aug 2004 02:18:08

Hi,


Not really. *Sigh*. I wish there would be one. I've seen various on
the net and in magazines, and they're all wrong in one way or another.

And I should of course add this as a disclaimer to my
own guesswork as well. (-; It is likely incomplete and partially
incorrect.


You're welcome.

So long,
Thomas