Skip to content

Commit

Permalink
Merge pull request #23 from Host32/master
Browse files Browse the repository at this point in the history
Trocar tipo do array de instruções
  • Loading branch information
trumae committed May 8, 2014
2 parents 1be4e60 + 0454dba commit 418546e
Show file tree
Hide file tree
Showing 35 changed files with 266 additions and 531 deletions.
16 changes: 3 additions & 13 deletions unipic/src/instrucoes/ADDWF.java
Expand Up @@ -4,19 +4,9 @@
* Classe referente a instrucao ADDWF ...
*/
public class ADDWF extends Instrucao{
private String match = "^000111[0|1]{1}[0|1]{5}$";

@Override
public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
ADDWF inst = new ADDWF();
inst.setD(Integer.parseInt(comando.substring(6,7),2)); // base binario = inteiro
inst.setF(Integer.parseInt(comando.substring(7),2)); //

return inst;
public void setup(String comando){
this.setD(Integer.parseInt(comando.substring(6,7),2)); // base binario = inteiro
this.setF(Integer.parseInt(comando.substring(7),2)); //
}
}
22 changes: 7 additions & 15 deletions unipic/src/instrucoes/ANDLW.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class ANDLW extends Instrucao{
private String match = "^1110[0|1]{8}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
ANDLW inst = new ANDLW();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

public class ANDLW extends Instrucao{
@Override
public void setup(String comando){
ANDLW inst = new ANDLW();
// ** Vide Pagina 54 do manual da PIC **
}

}
10 changes: 1 addition & 9 deletions unipic/src/instrucoes/ANDWF.java
Expand Up @@ -2,18 +2,10 @@
import unipic.Instrucao;

public class ANDWF extends Instrucao{
private String match = "^000101[0|1]{1}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
public void setup(String comando){
ANDWF inst = new ANDWF();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

}
22 changes: 7 additions & 15 deletions unipic/src/instrucoes/BCF.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class BCF extends Instrucao{
private String match = "^0100[0|1]{3}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
BCF inst = new BCF();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

public class BCF extends Instrucao{
@Override
public void setup(String comando){
BCF inst = new BCF();
// ** Vide Pagina 54 do manual da PIC **
}

}
22 changes: 7 additions & 15 deletions unipic/src/instrucoes/BSF.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class BSF extends Instrucao{
private String match = "^0101[0|1]{3}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
BSF inst = new BSF();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

public class BSF extends Instrucao{
@Override
public void setup(String comando){
BSF inst = new BSF();
// ** Vide Pagina 54 do manual da PIC **
}

}
22 changes: 7 additions & 15 deletions unipic/src/instrucoes/BTFSC.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class BTFSC extends Instrucao{
private String match = "^0110[0|1]{3}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
BTFSC inst = new BTFSC();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

public class BTFSC extends Instrucao{
@Override
public void setup(String comando){
BTFSC inst = new BTFSC();
// ** Vide Pagina 54 do manual da PIC **
}

}
22 changes: 7 additions & 15 deletions unipic/src/instrucoes/BTFSS.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class BTFSS extends Instrucao{
private String match = "^0111[0|1]{3}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
BTFSS inst = new BTFSS();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

public class BTFSS extends Instrucao{
@Override
public void setup(String comando){
BTFSS inst = new BTFSS();
// ** Vide Pagina 54 do manual da PIC **
}

}
22 changes: 7 additions & 15 deletions unipic/src/instrucoes/CALL.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class CALL extends Instrucao{
private String match = "^1001[0|1]{8}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
CALL inst = new CALL();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

public class CALL extends Instrucao{
@Override
public void setup(String comando){
CALL inst = new CALL();
// ** Vide Pagina 54 do manual da PIC **
}

}
20 changes: 1 addition & 19 deletions unipic/src/instrucoes/CLRF.java
Expand Up @@ -2,27 +2,9 @@
import unipic.Instrucao;

public class CLRF extends Instrucao{

private String match = "^0000011[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
public void setup(String comando){
CLRF inst = new CLRF();
// ** Vide Pagina 53 do manual da PIC **

return inst;
}









}
10 changes: 1 addition & 9 deletions unipic/src/instrucoes/CLRW.java
Expand Up @@ -3,17 +3,9 @@
import unipic.Instrucao;

public class CLRW extends Instrucao{
private String match = "^000001000000$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
public void setup(String comando){
CLRW inst = new CLRW();
// ** Vide Pagina 53 do manual da PIC **

return inst;
}
}
22 changes: 7 additions & 15 deletions unipic/src/instrucoes/CLRWDT.java
@@ -1,21 +1,13 @@
package instrucoes;
import unipic.Instrucao;

public class CLRWDT extends Instrucao{
private String match = "^000000000100$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
CLRWDT inst = new CLRWDT();
// ** Vide Pagina 54 do manual da PIC **

return inst;
}

public class CLRWDT extends Instrucao{
@Override
public void setup(String comando){
CLRWDT inst = new CLRWDT();
// ** Vide Pagina 54 do manual da PIC **
}

}


22 changes: 7 additions & 15 deletions unipic/src/instrucoes/COMF.java
@@ -1,22 +1,14 @@
package instrucoes;
import unipic.Instrucao;

public class COMF extends Instrucao{
private String match = "^001001[0|1]{1}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
COMF inst = new COMF();
// ** Vide Pagina 53 do manual da PIC **

return inst;
}

public class COMF extends Instrucao{
@Override
public void setup(String comando){
COMF inst = new COMF();
// ** Vide Pagina 53 do manual da PIC **
}

}



28 changes: 10 additions & 18 deletions unipic/src/instrucoes/DECF.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class DECF extends Instrucao{
private String match = "^000011[0|1]{1}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
DECF inst = new DECF();
// ** Vide Pagina 53 do manual da PIC **

return inst;
}

}
import unipic.Instrucao;

public class DECF extends Instrucao{
@Override
public void setup(String comando){
DECF inst = new DECF();
// ** Vide Pagina 53 do manual da PIC **
}

}
24 changes: 8 additions & 16 deletions unipic/src/instrucoes/DECFSZ.java
@@ -1,19 +1,11 @@
package instrucoes;
import unipic.Instrucao;

public class DECFSZ extends Instrucao{
private String match = "^001011[0|1]{1}[0|1]{5}$";

public boolean matcher(String comando){
return comando.matches(match);
}

@Override
public Instrucao getInstrucao(String comando){
DECFSZ inst = new DECFSZ();
// ** Vide Pagina 53 do manual da PIC **

return inst;
}

}
public class DECFSZ extends Instrucao{
@Override
public void setup(String comando){
DECFSZ inst = new DECFSZ();
// ** Vide Pagina 53 do manual da PIC **
}

}

0 comments on commit 418546e

Please sign in to comment.