dissi - indexed addressing



indexed adressing modes


Dissi generates data (instead of code), if the postbyte of an indexed instruction is not as described in the above official table.

To be exact here an extract of the dissi corresponding source code ("DASM6809.java"):

    reg=(pb>>5)&0x3;
    
    // filter out not allowed combinations
    // 1xxx 0111
    // 1xxx 1010
    // 1xxx 1110
    if ( ((pb & 0x8f) == 0x87) ||
        ((pb & 0x8f) == 0x8a) ||
        ((pb & 0x8f) == 0x8e) )
    {
        return incorrectDisassembleFoundAt(currentPC, "Illegal postbyte value for indexed addressing, bit combination of 4 lower bits.");
    }
    // filter out not allowed combinations
    // 1xx1 0010
    // 1xx1 0000
    if ( ((pb & 0x9f) == 0x92) ||
        ((pb & 0x9f) == 0x90) )
    {
        return incorrectDisassembleFoundAt(currentPC, "Illegal postbyte value ,-R or ,R+ not allowed for indirect indexed addressing.");
    }

    // filter out not allowed combinations
    // 1xx0 1111
    if ( ((pb & 0x9f) == 0x8f) )
    {
        return incorrectDisassembleFoundAt(currentPC, "Illegal postbyte value 16 bit extended not allowed in indexed (non indirect) addressing.");
    }
    // filter out not allowed combinations
    // 1011 1111
    // 1101 1111
    // 1111 1111
    if ( ((pb & 0xff) == 0xbf) ||
        ((pb & 0xff) == 0xdf) ||
        ((pb & 0xff) == 0xff) )
    {
        return incorrectDisassembleFoundAt(currentPC, "Illegal postbyte value 16 bit indirect indexed addressing expects bits 5 and 6 to be 0");
    }

    // 1xxx 1100
    // 1xxx 1101
    if (( (pb&0x8f) == 0x8d) || ( (pb&0x8f) == 0x8c))
    {
        // reg == PC!
        reg = 4;
        
        if ( ((pb>>4) & 0x6) != 0)
        {
                /*
                        1XX? ????
                        X bits can be anything,
                        asmj converts "sta <$30,pc"
                        to "ec 8c 30"
                        which is correct
                        but "ec ec 30"
                        but "ec dc 30"
                        but "ec bc 30" are also correct, but only the first 100% ressembles old binary
                        therefor the below three variants must be converted to DB, with comment not to convert to code!
                        this is true for both 16 bit or 8 bit variant!
                */
                return incorrectDisassembleFoundAt(currentPC, "Ambiguous pc index addressing, postbytes bit 5 and 6 are non zero (assi generates 0).");
        }
    }