OpenCores
URL https://opencores.org/ocsvn/tv80/tv80/trunk

Subversion Repositories tv80

[/] [tv80/] [trunk/] [sc_env/] [z80_decoder.cpp] - Diff between revs 96 and 97

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 96 Rev 97
Line 3... Line 3...
char *table_r[] = { "B", "C", "D", "E", "H", "L", "(HL)", "A" };
char *table_r[] = { "B", "C", "D", "E", "H", "L", "(HL)", "A" };
char *table_cc[] = { "NZ", "Z", "NC", "C", "PO", "PE", "P", "M" };
char *table_cc[] = { "NZ", "Z", "NC", "C", "PO", "PE", "P", "M" };
char *table_rp[] = {"BC", "DE", "HL", "SP" };
char *table_rp[] = {"BC", "DE", "HL", "SP" };
char *table_rp2[] = {"BC","DE","HL","AF"};
char *table_rp2[] = {"BC","DE","HL","AF"};
char *table_alu[] = {"ADD A,","ADC A,","SUB","SBC A,","AND","XOR","OR","CP"};
char *table_alu[] = {"ADD A,","ADC A,","SUB","SBC A,","AND","XOR","OR","CP"};
 
char *table_im[] = {"0","0/1", "1", "2", "0", "0/1", "1", "2" };
 
 
void z80_decoder::op_print ()
void z80_decoder::op_print ()
{
{
        printf ("DECODE :[%04x] %s\n", op_addr, op_name);
        printf ("DECODE :[%04x] %s\n", op_addr, op_name);
}
}
Line 164... Line 165...
                                                        op_name = op_buf;
                                                        op_name = op_buf;
                                                        break;
                                                        break;
                                                case 4 :
                                                case 4 :
                                                        op_name = "CALL %04x";
                                                        op_name = "CALL %04x";
                                                        state = IMM2;
                                                        state = IMM2;
 
                                                        op_print();
                                                        break;
                                                        break;
                                                case 5 : state = PRE_DD; break;
                                                case 5 : state = PRE_DD; break;
                                                case 6 : state = PRE_ED; break;
                                                case 6 : state = PRE_ED; break;
                                                case 7 : state = PRE_FD; break;
                                                case 7 : state = PRE_FD; break;
                                        }
                                        }
                                        break;
                                        break;
 
                                case 6 :
 
                                        sprintf (op_buf, "IM %s", table_im[y]);
 
                                        op_name = op_buf;
 
                                        break;
 
                                break;
 
                                case 7 :
 
                                        switch (y) {
 
                                                case 0 : op_name="LD I,A"; break;
 
                                                case 1 : op_name="LD R,A"; break;
 
                                                case 2 : op_name="LD A,I"; break;
 
                                                case 3 : op_name="LD A,R"; break;
 
                                                case 4 : op_name="RRD"; break;
 
                                                case 5 : op_name="RLD"; break;
 
                                                case 6 : op_name="NOP"; break;
 
                                                case 7 : op_name="NOP"; break;
 
                                        }
 
                                break;
                        }
                        }
                break;
                break;
        }
        }
        /*FOR x=0
        /*FOR x=0
z=0
z=0
Line 249... Line 268...
                                op_print();
                                op_print();
                                break;
                                break;
                        case IMM1 :
                        case IMM1 :
                                imm = ((unsigned int) di) & 0xff;
                                imm = ((unsigned int) di) & 0xff;
                                sprintf (op_buf, op_name, imm);
                                sprintf (op_buf, op_name, imm);
                                //printf ("DECODE : %02x %s\n", (int) opcode, op_name);
 
                                op_name = op_buf;
                                op_name = op_buf;
                                op_print();
                                op_print();
                                break;
                                break;
                }
                }
        }
        }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.