Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Filename: Assembler.h
- By: Matthew DeBord and Ronald Radut
- Created: 04/11/2011
- Last Modified: 04/20/2011
- Description: This header contains class declarations for the Assembler
- ******************************************************************************/
- #include <cstdlib> // for exit()
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <sstream> // for istringstream
- #include <vector>
- using namespace std;
- class Assembler {
- private:
- string line, opcode;
- int rd, rs, constant, address, optemp, imm;
- void defineInst(string line); // takes line from getLine and parses it to define the instruction
- int buildFormat1(int opcode, int rd, int rs, int imm);
- int buildFormat2(int opcode, int rd, int imm, int tail);
- public:
- Assembler();
- vector<int> v;
- void assemble(); // grabs a line from the .s file and sends it to defineInst(), line by line until eof.
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement