/** * @file arm9_isa.ac * @author Rodrigo Padilha RA:99226 Thaiane Lima Lopes RA:088867 * @version 0.0 * @date Fri, 02 november 2007 14:25:49 -0300 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ AC_ISA(arm9){ // Formato de instrucao // DATA PROCESSING ac_format Type_DPI = "%cond:4 %nus1:2 %if:1 %op:4 %sf:1 %rs:4 %rd:4 [ %shift_op:4 %imm:8 | %rt:4 ]" ; //colocar todas as formas de shift_op para dar 12 etc... // BRANCH INSTRUCTIONS //ac_format Type_BI = "%cond:4 %nus1:3 %lr:1 %offs1:24"; // SINGLE DATA TRANSFER //ac_format Type SDTI = "%cond:4 %nus1:2 %if:1 %ppi:1 %udf:1 %bwf:1 %wbf:1 %lsf:1 %rn:4 %rd:4 %offs1:12"; // NORMAL MULTIPLY //ac_format Type_NMI = "%cond:4 %nus1:7 %af:1 %sf:1 %rd:4 %rs:4 %nus2:4 %rm:4"; // LONG MULTIPLY //ac_format Type_LMI = "%cond:4 %nus1:5 %uf:1 %af:1 %sf:1 %rdhi:4 %rdlo:4 %rs:4 %nus2:4 %rm:4"; // Instrucoes relacionadas aos tipos de instrucoes ac_instr AND, EOR, SUB, RSB, ADD, ADC, SBC, RSC, TST, TEQ, CMP, CMN, ORR, MOV, BIC, MVN; // DATA PROCESSING //ac_instr B, BLX, BX; // BRANCH INSTRUCTIONS //ac_instr LDR, STR; // SINGLE DATA TRANSFER //ac_instr MUL, MLA; // NORMAL MULTIPLY //ac_instr SMLAL, SMULL, UMLAL, UMLL; // LONG MULTIPLY } // Declaracao das instrucoes ISA_CTOR(arm9){ // DATA PROCESSING INSTRUCTIONS ac_format Type_DPI = "%cond:4 %nus1:2 %if:1 %op:4 %sf:1 %rn:4 %rd:4 %shif_op:12"; // ADD, ADC, BIC, AND, CMN, CMP, MOV, MVN, EOR, ORR, RSB, RSC, SUB, SBC, TST, TEQ // BRANCH INSTRUCTIONS // ac_format Type_BI = "%cond:4 %nus1:3 %lr:1 %offs1:24"; // B (BL), BLX, BX // SINGLE DATA TRANSFER (LOAD AND STORE) INSTRUCTIONS // ac_format Type_SDTI = "%cond:4 %nus1:2 %if:1 %ppi:1 %udf:1 %bwf:1 %wbf:1 %lsf:1 %rn:4 %rd:4 %offs1:12"; // LDR, STR // NORMAL MULTIPLY INSTRUCTIONS // ac_format Type_NMI = "%cond:4 %nus1:7 %af:1 %sf:1 %rd:4 %rs:4 %nus2:4 %rm:4"; // MLA, MUL // LONG MULTIPLY INSTRUCTIONS // ac_format Type_LMI = "%cond:4 %nus1:5 %uf:1 %af:1 %sf:1 %rdhi:4 %rdlo:4 %rs:4 %nus2:4 %rm:4"; // SMLAL, SMULL, UMLAL, UMULL//AINDA N�O DECLARAMOS //Type_DPI ADD.set_asm("add %cond %rd %rs %rt"); ADD.set_decoder(opcode=0x04, func=0x00); SUB.set_asm("sub %cond %rd %rs %rt"); SUB.set_decoder(opcode=0x02, func=0x00); AND.set_asm("and %cond %rd, %rs, %rt"); AND.set_decoder(opcode=0x00 ,func=0x00); ORR.set_asm("orr %cond %rd, %rs, %rt"); ORR.set_decoder(opcode=0x0C ,func=0x00); BIC.set_asm("bic %cond %rd, %rs, %rt"); BIC.set_decoder(opcode=0x0E ,func=0x00); EOR.set_asm("eor %cond %rd, %rs, %rt"); EOR.set_decoder(opcode=0x01 ,func=0x00); }; };