Lab1-Comments

Lab1-Comments - COMP 4300 Computer Architecture Lab 1...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 COMP 4300 Computer Architecture Lab 1 – Common Problems Dr. Xiao Qin Auburn University http://www.eng.auburn.edu/~xqin xqin@auburn.edu Fall, 2008
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Bad Data Structures 1 class Memory { public: string text[140]; int t_index; int t_size; mem_word data[140]; int d_index; int d_size; mem_word stack[140]; int s_index; int s_size; long pc; string dictionary[200]; int dic_index;
Background image of page 2
3 Bad Data Structures 2 class StackBased { public: // funtions needed to solve the quadratic equation read in from a file vector<string> loadText(); vector<string> loadMemory(); vector<string> loadData(); string getADR(string); string getADR(int); void pushItem(string x); void addItems(string x, string y); void mulItems(string x, string y); void encodeStruct(); // varibles for the stack based machine // holds the position as i search through the file and vectors int position; // holds the entire original file vector<string> Memory;
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Poor Readability if (toM.read_instr(code_base+toM.getPC()).substr(0,4).compare("LOAD") == 0)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

Lab1-Comments - COMP 4300 Computer Architecture Lab 1...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online