Skip to content

Commit

Permalink
Merge pull request #73 from Lynhu/patch-1
Browse files Browse the repository at this point in the history
Colocando o MOVWF.java
  • Loading branch information
trumae committed Jun 23, 2014
2 parents 381db54 + ba5851c commit fb9374b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions unipic/src/instrucoes/MOVWF.java
Expand Up @@ -4,16 +4,23 @@
import unipic.Memoria;

public class MOVWF extends Instrucao{
/***
* Inicia a instrução
* @param comando 0000 001f ffff
**/
@Override
public void setup(String comando){

// ** Vide Pagina 54 do manual da PIC **
setK(Integer.parseInt(comando.substring(7), 2));
}

/***
* Move o valor do registrador 'W' para o 'F'
* @param mem memória a ser alterada
* @param cpu serve para usar os registradores do processador
*/
public void run(Memoria mem, CPU cpu){

mem.set(this.f, cpu.getW());;
mem.setPCL((byte) (mem.getPCL() + 1));
}
}



0 comments on commit fb9374b

Please sign in to comment.