Advertisement
Guest User

Assembler.h

a guest
Apr 25th, 2011
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. /******************************************************************************
  2. Filename: Assembler.h
  3. By: Matthew DeBord and Ronald Radut
  4. Created: 04/11/2011
  5. Last Modified: 04/20/2011
  6. Description: This header contains class declarations for the Assembler
  7. ******************************************************************************/
  8.  
  9.  
  10.  
  11. #include <cstdlib>  // for exit()
  12. #include <iostream>
  13. #include <fstream>
  14. #include <string>
  15. #include <sstream>  // for istringstream
  16. #include <vector>
  17. using namespace std;
  18.  
  19. class Assembler {
  20.     private:
  21.         string line, opcode;
  22.         int rd, rs, constant, address, optemp, imm;
  23.         void defineInst(string line); // takes line from getLine and parses it to define the instruction
  24.         int buildFormat1(int opcode, int rd, int rs, int imm);
  25.         int buildFormat2(int opcode, int rd, int imm, int tail);
  26.  
  27.     public:
  28.         Assembler();
  29.         vector<int> v;
  30.         void assemble(); // grabs a line from the .s file and sends it to defineInst(), line by line until eof.
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement