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

Re: 65C02 : deduce addressing from opcode ?



Peter Ibbotson - spambox@ibbotson.co.uk :

> I used to know this, but if you look in the Apple ][ Redbook (this is
> online somewhere) the monitor listing contains the disassembler Woz
> wrote. This has details on the exact patterns allowed.

Yes good idead, I'll try to find it with Google...

So far, I've just done some tries with the help of tech ref manuals found 
on 6502.org...

On every opcode I keep the bit 2,3 and 4 with a (OpCode & 0x1F) >> 2

I made a mistake in my post, there are 16 addressing mode (at least from 
the doc)...

Keeping bit 2,3 and 4 give me this :

3 for absolute
7 for absolute,x
6 for absolute,y and zp,y
1 for accumulator and zp
2 for immediate and implied and stack
4 for relative and (zp),y
0 for (zp,x) and (zp) 
5 for zp,x


Some values make sense (found same value for absolute,y and zp,y) but some 
seems to be wrong (4, 0) and some others seems strange 

Don't know if (OpCode & 0x1F) >> 2 is the right way