Guest User

Untitled

a guest
Mar 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. class ADD_Instruction implements Instruction {
  2.  
  3. public final int rd, rs, rt;
  4.  
  5. public ADD_Instruction(int rd, int rs, int rt) {
  6. this.rd = rd;
  7. this.rs = rs;
  8. this.rt = rt;
  9. }
  10.  
  11. public void execute(Program p) {
  12. p.setRegister(this.rd, (p.getRegister(rs) + p.getRegister(rt)));
  13. }
  14. }
Add Comment
Please, Sign In to add comment