TRESSEL Developer's Guide: Data Element Dictionary

TRESSEL Documentation > TRESSEL Developer's Guide > Data Element Dictionary

Table of Contents

1. Assembler elements
2. Linker elements
3. Simulator elements.


Data Elements

These are the elements used in the source of the TRESSEL assembler.

Variable Name Module Where Defined Data Type Local or Global Purpose
globalDirectiveTable global list<vector<string>> Global To store Directive Table.
globalInstructionTable global list<vector<string>> Global To store Instruction Table.
globalSymbolTable global list<vector<string>> Global To store Symbol Table.
globalObjectCodeTable global list<vector<string>> Global To store Object Code Table.
globalErrorTable global list<vector<string>> Global To store Error Table.
globalSourceListing global list<string> Global To list the Source.
globalErrorListing global list<vector<int>> Global To list the Error.
globalLinkingRecordTable
global
list<vector<string>>
Global
To list the Linking Records.
globalTextRecordTable
global
list<vector<string>>
Global
To List the Text Records.
globalEndRecord
global
vector<string>
Global
To list the End Records.
globalHeader
global
vector<string>
Global
To list the Header Record.
globalFatalError global bool Global Return 'true' if there is a Fatal Error; else it will return 'false.'
globalLABEL global string Global Keeping 'Label' from current line of source file.
globalLineNumber global int Global Keeping the current line number of source file being examined.
globalLC global int Global Keep information of current LC status.
globalIR global int Global Keep information of current IR status.
globalAR global int Global Keep information of current AR status.
globalBR global int Global Keep information of current BR status.
globalDEBUG global int Global Keep information of current DEBUG status.
globalProgramStart
global
int
Global
Holds the Start address of the program.
globalProgramLen
global
int
Global
Holds the length of the program.
SYMBOL global const int Global A constant to identify a Symbol.
DIRECTIVE global const int Global A constant to identify a Directive.
INSTRUCTION global const int Global A constant to identify an Instruction.
DIRECTIVEWITHOUTLABEL global const int Global A constant to identify a Directive Without a Label.
ERROR global const int Global A constant to identify an Error.
TYPE1 global const int Global A constant to identify a 'Type 1' type operand.
TYPE2 global const int Global A constant to identify a 'Type 2' type operand.
TYPE3 global const int Global A constant to identify a 'Type 3' type operand.
TYPE4 global const int Global A constant to identify a 'Type 4' type operand.
REFALL global const int Global A constant to identify a 'REF-ALL' type operand.
REF global const int Global A constant to identify a 'Reference' type operand.
REFSHARP global const int Global A constant to identify a '#Reference' type operand.
REFPERCENT global const int Global A constant to identify a '%Reference' type operand.
REFEXP global const int Global A constant to identify a 'Reference-Exp' type operand.
NONE global const int Global A constant to identify a line that does not need an operand.
EXP1 global const int Global A constant to identify an 'Expression 1' type operand.
EXP2 global const int Global A constant to identify an 'Expression 2' type operand.
EXP3 global const int Global A constant to identify an 'Expression 3' type operand.
ENTRY global const int Global A constant to identify an 'Entry' directive.
EXTERNAL global const int Global A constant to identify an 'External' directive.
WN global const int Global A constant to identify a 'word-num' directive.
WC global const int Global A constant to identify a 'word-chr' directive.
WB global const int Global A constant to identify a 'word-bin' directive.
WH global const int Global A constant to identify a 'word-hex' directive.
DEBBIE global const int Global A constant to identify an 'DEBUG' directive.
intTokenNoMoreTokens global const int Global A constant to identify if there are no more tokens left on the line.
intTokenSymbol global const int Global A constant to identify the token is a symbol. 
intTokenNumber global const int Global A constant to identify how many more tokens are left on the line.
intTokenEqu global const int Global A constant to identify an Equate operation within the token.
intTokenAdd  global const int Global A constant to identify an addition operation within the token.
intTokenSub global const int Global A constant to identify a subtraction operation within the token.
intTokenMul global const int Global A constant to identify a multiplication operation within the token.
intTokenDiv global const int Global A constant to identify a division operation within the token.
intTokenOp global const int Global A constant to identify a token Operator.
intTokenError global const int Global A constant to identify a token Error.
strExpNegativeFlag global string Global A flag for if the expression has a leading negative.
globalLiteralPool global vector<string> Global A vector containing all the literals processed, to be added at the end.
globalHalt global bool Global A global boolean to flag if HALT has been called.
globalEnd global bool Global A global boolean to flag if END has been called.
globalLineOperands[3] global string Global Array of operands for the current line in the intermediate table.
globalLineLiteral global string Global Literal for the current line in the intermediate table.
globalLineOperandsCount global int Global Number of operands in globalLineOperands[3] starting at 1.
i StringIsAlphabetical unsigned int local Being used as a counter.
vecstrNewLine AddSymbolTableLine vector<string> local Vector for the new line.
vecstrCurLine AddSymbolTableLine vector<string> local Vector for searching table.
strCurLabel AddSymbolTableLine string local String for searching table.
itrInsertAtIndex AddSymbolTableLine list<typename vector<typename string>>::iterator local Iterator for insertion index.
boolFoundIndex AddSymbolTableLine bool local To switch set when an alphabetical match is found in the table.
i AddSymbolTableLine list<typename vector<typename string>>::iterator local Used as an iterator counter.
vecstrCurLine EditSymbolTableLineByLabel vector<string> local Vector for searching table.
vecstrEditedLine EditSymbolTableLineByLabel vector<string> local Vector for storing edited line.
strCurLabel EditSymbolTableLineByLabel string local String for searching table.
boolFoundLine EditSymbolTableLineByLabel bool local To switch set when the target line is found in the table.
i EditSymbolTableLineByLabel list<typename vector<typename string>>::iterator local Used as an iterator counter.
vecstrCurLine EditSymbolTableLineByPurpose vector<string> local Vector for searching table.
vecstrEditedLine EditSymbolTableLineByPurpose vector<string> local Vector for storing edited line.
strCurPurpose EditSymbolTableLineByPurpose string local String for searching table.
boolFoundLine EditSymbolTableLineByPurpose bool local To switch set when the target line is found in the table.
i EditSymbolTableLineByPurpose list<typename vector<typename string>>::iterator local Used as an iterator counter.
vecstrCurLine ReturnSymbolTableAddressByLabel vector<string> local Vector for searching table.
strCurLabel ReturnSymbolTableAddressByLabel string local String for searching table.
strReturnAddress ReturnSymbolTableAddressByLabel string local String for storing match address for a given label.
boolFoundSymbol ReturnSymbolTableAddressByLabel bool local To switch set when the target line is found in the table.
i ReturnSymbolTableAddressByLabel list<typename vector<typename string>>::iterator local Used as an iterator counter.
vecstrCurLine ReturnSymbolTableAddressByPurpose vector<string> local Vector for searching table.
strCurLabel ReturnSymbolTableAddressByPurpose string local String for searching table.
strReturnAddress ReturnSymbolTableAddressByPurpose string local String for storing match address for a given purpose.
boolFoundSymbol ReturnSymbolTableAddressByPurpose bool local To switch set when the target line is found in the table.
i ReturnSymbolTableAddressByPurpose list<typename vector<typename string>>::iterator local Used as an iterator counter.
vecstrCurLine ReturnSymbolTableSubstitutionByLabel vector<string> local Vector for searching table.
strCurLabel ReturnSymbolTableSubstitutionByLabel string local String for searching table.
strReturnSubstitution ReturnSymbolTableSubstitutionByLabel string local String for storing match substitution for a given label.
boolFoundSymbol ReturnSymbolTableSubstitutionByLabel bool local To switch set when the target line is found in the table.
i ReturnSymbolTableSubstitutionByLabel list<typename vector<typename string>>::iterator local Used as an iterator counter.
int2str IntToString std::ostringstream local Used to treat the value of intInput(an integer) as an output stream and store it.
strOutput IntToString std::string local Used to store the value of int2str.
errorFiling AddErrorTableLine vector<int> local Used to manage the datas of an error line before being transferred to the Error Table.
table BuildList list<vector<string>> local Used as a table to store the list being generated.
input BuildList ifstream local Used to read the file being passed to it as input streams.
line[900] BuildList char local Create an array of lines.
table_buf BuildList char * local Used as a table buffer.
contents BuildList vector<string> local Temporarily store a line from the file after being tokenized..
tokenizer BuildList char * local Temporarily store a token of data from a line after being tokenized
contents PrintTable vector<string> local Temporarily store a line from the table.
i PrintTable list<typename vector<typename string>>::iterator local Used as an iterator counter.
i2 PrintTable vector<typename string>::iterator local Used as an iterator counter.
contents CheckTable vector<string> local Temporarily store a line from the table.
i CheckTable list<typename vector<typename string>>::iterator local Used as an iterator counter.
info CheckTable string local Used to store an Instruction or a Directive from a line of the source file given.
contents SaveTable vector<string> local Temporarily store a line from the table.
tablefile SaveTable fstream local To read/write data from tablefilename.
i SaveTable list<typename vector<typename string>>::iterator local Used as an iterator counter.
i2 SaveTable vector<typename string>::iterator local Used as an iterator counter.
labeltype CheckOp string local To store the type of a label.
newline AddObjectCodeTableLine vector<string> local Vector to store a new line.
junk CheckLabel int local To store unneeded value being passed when CheckTable function is called.
bin_val CheckLabel string local To store bin_val being return by CheckTable.
label_copy CheckLabel string local Make a copy of label value.
c isValid char local To store the current character from the token that is being analyzed.
i isValid int local Used as a counter.
check isValid string local To store the substitution of a label.
maxChar CheckOperand int local Maximum number of characters that word-chr directive can accept.
i CheckOperand int local To be used to store the value return form isValid function.
totalOperandLen CheckOperand int local Storing the length of characters of the operand string.
operandsLen CheckOperand int local The character's position of the operand currently being examined.
buf2 CheckOperand char * local It stores position information for strtok_s.
right CheckOperand string local Store the right part of the operand string.
left CheckOperand string local Store the left part of the operand string.
irVar CheckOperand int local Store the length of the string being examined.
check CheckOperand int local Used to store the value of 'token' that has been converted to integer.
counter CheckOperand int local Used to keep up the count of the operator signs appeared in the operand.
temp_str[900] CheckOperand char local Token will be assigned to this temporary variable.
temp_buf[900] CheckOperand char * local This will be used as a buffer for temp_str.
s CheckOperand string local To store the tokenized 'token' which is in temp_str.
c CheckOperand char local Temporarily store a character from the token to be analyzed.
start CheckOperand int local Indicate the start position of string to be analyzed.
length CheckOperand int local Indicate the length of the string to be analyzed.
pos CheckOperand int local Indicate the current position of the token that is being analyzed.
opnum CheckOperand int local Keep up the operator sign that appeared in the operand.
temp CheckOperand string local Temporarily store the string to be send to isValid function.
equalsign CheckOperand bool local To keep track if an equal sign has appeared in the operand being analyzed.
source main char[] local the source file name is read in and stored here
contents main vector<int> local temporary variable to store a row of a table while iterating through the table.
i main list<typename vector<typename int>>::iterator local iterator for global tables.
i2 main vector<typename int>::iterator local iterator for the 'contents' vector
col main int local A pointer to the selected column when printing table output.
i main list<string>::iterator local iterator for the 'globalSourceListing'
source main string local temporary variable to store a row from the 'globalSourceListing'
temp main int local read in a value at the end of the program so it doesn’t quit automatically
input Parser ifstream local input file stream for opening the source file that the user wants to compile.
line Parser char[] local each line read in from the source file will be stored
token Parser string local each tokenized string from the 'line' variable will be stored
buf Parser char*[] local It stores position information for strtok_s.
intTokensLen Parser int local the size of each token + all previous token from the line will be stored
intLineLen Parser int local the size of 'line' will be stored
ref_type Parser int local will represent the reference type if the token is an instruction or a Directive. Error number if the token is an error
bin_val Parser string local stores 6bit binary value for instructions; label type for directives; the preserved token for label, error;
labelcopy Parser string local stores the label(if there is one) of a line
ptoken Parser string local stores the current token; later used as previous token.
addressflags Parser string local address flag
directivecopy Parser string local stores the directive (if there is one) of a line
prevtoken Parser string local stores the current token; later used as previous token.
checkers Parser boolean local boolean value (true if operand is in a valid type false otherwise)
errorcheck Parser boolean local boolean value (true if operand is in a valid type false otherwise)
intTokensLen ParseFirstLine int local the size of each token + all previous token from the line will be stored
intLineLen ParseFirstLine int local the size of 'line' will be stored
sym_table ParseFirstLine vector<string> local the first line of code (start) will be stored then pushed back to globalSymbolTable
tokenizer ParseFirstLine string local tokenizer for the first line
checkint ParseFirstLine int local the type of the token will be stored
bin_val ParseFirstLine string local stores 6bit binary value for instructions; label type for directives; the preserved token for label, error;
pgm_name ParseFirstLine string local program name (the very first token)
scanner ParseFirstLine int local counter for token iteration
intChecker ParseFirstLine bool local true if the operand is in a valid range false otherwise
memLoc ParseFirstLine int local operand transformed to an int value stored here
s ParseFirstLine stringstream local Used for conversion from string to int
intDoFunction DoDirective int local strCheckFunction value is converted to int
intDoDirectiveReturn DoDirective int local returned value in default case (value = 999)
strCheckFunction DoDirective string local A temp variable used to check column values when iterating through global tables.
strCheckDirective DoDirective string local temp value for a name of a directive in directive table (for comparing with the input token)
strAddAddress DoDirective string local stored the globalLC value (if operand is *)
contents DoDirective vector<string> local temp value for a row of a table
i DoDirective list<typename vector<typename string>>::iterator local iterator for global tables
intOperandConverted DoDirective int local operands string is converted to int
strResult DoDirective string local store results of expression in operands
checkEQU DoDirective string local Check symbol for equate
entry_buf DoDirective char* local It stores position information for strtok_s.
chTokenizer DoDirective char* local tokenizes the operand by a comma (for Entry or External type directives)
external_buf DoDirective char* local It stores position information for strtok_s.
strBinaryOperand DoDirective string local converted operand value (from base 10 to base 2) is stored
dataWord DoDirective vector<string> local temp variable that holds strBinaryOperand (will be pushed back toglobal ObjectCodeTable
operands_array DoDirective char* local operands string is converted to type char*
i DoDirective int local iterator for operands_array
totalBinChar DoDirective string local represents the 24 bit representation of each instruction of directive
strBinaryChar DoDirective string local string of decimal numbers are converted to binary and stored here
strToConvert DoDirective string local the decimal number to be converted to binary
strBinaryHex DoDirective string local operands values (base 10) are converted to base 2 and stored here
inNum ConvertBase int local input number is converted to int value (from string of char)
outputNumber ConvertBase int local the result from the conversion
statuesquePos ConvertBase int local Keeps the length value for input in ConvertBase
pos ConvertBase int local determines the power for each digit
conversion ConvertBase int local A hexadecimal number is converted to decimal and stored here
power ConvertBase int local powers multiplied to each digit of a hexadecimal is calculated and stored here
remainder ConvertBase int local remainders from dividing the input number by the desired output base
startpos CountSpaceAfterToken int local The starting position, to use as a base to count spaces after the current token.
intCurpos CountSpaceAfterToken int local The current position, to use as a relative reference to count spaces after the current token.
intCount CountSpaceAfterToken int local A count Integer, to be used for iteration throughout the line.
intTokenType GetTokenType int local An Integer used to record the TokenType of the current token.
strNextToken GetNextToken string local A string containing the next token we were to find in the function.
boolStillReading GetNextToken bool local A boolean value to see if we are still scanning for the next token.
strFirstChar GetNextToken string local A character variable we use to compare with inputted characters, to determine if we have the next token.
strNextTokenChar GetNextToken string local The first character of the next token we find.
intReadCharCount GetNextToken int local An Integer used for storing the number of characters we have read so far.
intLiteralType GetLiteralType int local A value we use to simply store the fact that we are reading through a character string.
dataWord WriteLiteralPool vector<string> local For storing the actual literal number representation.
strCurLiteral WriteLiteralPool string local A string to hold the current literal we are adding to the symbol table.
stritrChop WriteLiteralPool string::iterator local An iterator we are using for scanning.
strCurLiteralCopy WriteLiteralPool string local A copy of the current literal; stored in a string.
strBinaryOperand WriteLiteralPool string local The binary operand representation of the literal.
strsizeFindComp; WriteLiteralPool size_t local The size of the computation string we are scanning through for the literal.
intLiteralType WriteLiteralPool int local The literal type stored using constant integer value comparisons.
strSpace
PrintHeader
string local
Spaces to be output at the end of the header.
intExtraSpace
PrintHeader
int
local
A value used to set the number of extra spaces in a header.
strHeaderText
PrintHeader
string
local
Contains the text to be output in the header.
line
CountSpaceAfterToken
string
local
The line of text which spaces are being counted from.
startpos
CountSpaceAfterToken
int
local
The starting position within the line to begin counting spaces from.
intCurpos
CountSpaceAfterToken int
local
The curent position within the line.
intCount
CountSpaceAfterToken
int
local
Number of spaces found after the token.
line
CountCommaAfterToken
string
local
The line of text which spaces are being counted from.
startpos
CountCommaAfterToken
int
local
The starting position within the line to begin counting spaces from.
intCurpos
CountCommaAfterToken
int
local
The curent position within the line.
intCount
CountCommaAfterToken
int
local
Number of commas found after the token.
entryName
AddLinkingRecordLine
string
local
Name of the label to be placed in the Linking Record.
address
AddLinkingRecordLine int
local
Address of the label.
container
AddLinkingRecordLine vector<string>
local
A vector to hold all the information contained in the Linking Record.
globalProgramName
AddLinkingRecordLine string
global
Name of the program to be placed in the Linking Record.
address
AddTextRecordLine
string
local
The Location Counter (address) value to be placed in the Text Record.
code
AddTextRecordLine
string
local
The Hex Code to be placed in the Text Record.
reloc
AddTextRecordLine
string
local
The Relocation type for the label to be placed in the Text Record.
name
AddTextRecordLine
string
local
The label to be placed in the Text Record.
sign
AddTextRecordLine
string
local
The arithmatic sign of the label to be placed in the Text Record.
container
AddTextRecordLine
vector<string>
local
A vector to hold all the information contained in the Text Record.
globalProgramName
AddTextRecordLine
string
global
Name of the program to be placed in the Text Record.
contents
PassTwo
vector<string>
local
Holds a line from the intermediate table.
contents2
PassTwo vector<string>
local
Holds a line from the object code table.
reloc
PassTwo string
local
The Relocation type for the label to be placed in the Text Record.
code
PassTwo string
local
The Binary Code to be placed in the Text Record.
hexCode
PassTwo string
local
The Hex Code to be placed in the Text Record.
hexAddr
PassTwo string
local
The Hex Address to be placed in the Text Record.
line
PassTwo int
local
A counter for the line number we are on.
boolNotWordNum
PassTwo bool
local
Used to check if the line of code is from an instruction or word-num.
boolSkipAdrComp
PassTwo bool
local
Used to determine if the instruction is an adr-comp.
i
PassTwo list<vector<string>>::iterator
local
Used to iterate through the intermediate table.
i2
PassTwo list<vector<string>>::iterator local
Used to iterate through the object code table.
globalProgramStart
PassTwo
int
global
The start address of the program.
globalProgramLen
PassTwo
int
global
The length of the program.
addr_val
PassTwo
int
local
Holds the address value from the intermediate table or -1 if error.
temp
PassTwo
string
local
Used to check if there is a '+' or '-' after '*' when using star addressing.
checka
PassTwo
int
local
Used to check that there was no error when using star addressing.
checker
PassTwo
int
local
Used to determine the operand type.
binaryRep
PassTwo
string
local
Holds the binary representation of the value in addr_val.
intOpNum
PassTwo
in
local
Used to get the Operands from the intermediate table.
adrcompRelocType
PassTwo string[4]
local
Stores the relocation types for each operand.
adrcompRelocSign
PassTwo string[4]
local
Stores the relocation sign for each operand.
adrcompRelocSymbol
PassTwo string[4]
local
Stores the relocation label for each operand.
strCurOperand
PassTwo string
local
Holds the value of the current operand being checked.
adrcompOps
PassTwo int
local
Used to keep track of the number of operands found.
k
PassTwo
int
local
Used as an iterator for a loop.
seconds
CreateHeaderRecord
time_t
local
Holds the current time in seconds.
time
CreateHeaderRecord string
local
Holds the current time.
year
CreateHeaderRecord string local
Stores the current year.
month
CreateHeaderRecord string local
Stores the current month.
date
CreateHeaderRecord string local
Stores the current date.
hour
CreateHeaderRecord string local
Stores the current hour.
minute
CreateHeaderRecord string local
Stores the current minutes.
second
CreateHeaderRecord string local
Stores the current seconds.
intDate
CreateHeaderRecord
int
local
Number of the current date.
ss
CreateHeaderRecord
ostringstream
local
Holds the number of the current date.
temp
CreateHeaderRecord
string
local
Holds the binary representation of various values.
intFindSourceLine
ReturnIntermediateTableLCBySourceLineNumber
int
local
The source line number that we are searching for.
vecstrCurLine
ReturnIntermediateTableLCBySourceLineNumber
vector<string>
local
Holds the current line from the intermediate table.
strCurSourceLineNum
ReturnIntermediateTableLCBySourceLineNumber
string
local
The source line number from the current intermediate table line.
strReturnLC
ReturnIntermediateTableLCBySourceLineNumber
string
local
The Location counter value from the correct line.
boolFoundLine
ReturnIntermediateTableLCBySourceLineNumber
bool
local
Checks if we have found the correct line yet.
strFindLC
ReturnObjectCodeTableLineByLC
string
local
The location counter number that we are searching for.
vecstrCurLine
ReturnObjectCodeTableLineByLC
vector<string>
local
Holds the current line from the object code table.
strCurObjectLC
ReturnObjectCodeTableLineByLC
string
local
The location counter number from the current object code line.
strReturnLC
ReturnObjectCodeTableLineByLC
string
local
The line of object code we were searching for.
boolFoundLine
ReturnObjectCodeTableLineByLC
bool
local
Checks if we have found the correct line yet.
lineNum
ReturnObjectCodeLineByLineNum
int
local
The line number we are looking for.
count
ReturnObjectCodeLineByLineNum int
local
A counter to determine when we have reached the correct line number.
holder
ReturnObjectCodeLineByLineNum vector<string>
local
Contains the line of Object Code that we were looking for.
i
ReturnObjectCodeLineByLineNum vector<string>::iterator
local
Used to iterate through the object code table.
j
PrintAssemblyListing list<string>::iterator
local Used to iterate through the source code table.
iText
PrintAssemblyListing list<vector<string>>::iterator
local Used to iterate through the Text Records.
TextRecord
PrintAssemblyListing vector<string>
local Contains a Line from the Text Records.
intSourceLineNum
PrintAssemblyListing int
local The current source line number we are on.
intermediateLine
PrintAssemblyListing int
local The current intermediate line number we are on.
intCurError
PrintAssemblyListing int
local The current error number we are on.
strFindLC
PrintAssemblyListing string
local Holds the LC value from the current intermediate table line.
strPrintLC
PrintAssemblyListing string local Holds the LC value from the current intermediate table line.
strPrintObj
PrintAssemblyListing string local Holds the hexadecimal object code from the current Text Record.
strPrintReloc
PrintAssemblyListing string local Holds the Relocation type from the current Text Record.
strPrintSourceLineNum
PrintAssemblyListing string local Holds the current source line number.
strPrintSource
PrintAssemblyListing string local Holds the current line of source code.
strPrintError
PrintAssemblyListing string local Holds the current Error.
strSourceLine
PrintAssemblyListing string local Holds the current line of source code.
strTempLC
PrintAssemblyListing string local Holds the hexadecimal LC value for the current line.
vecintCurErrorListingLine
PrintAssemblyListing vector<int>
local Holds the current line from the Error Listing.
intCurErrorListingLineNum
PrintAssemblyListing int
local Holds the current line number from the Error Listing.
i
PrintAssemblyListing list<vector<int>>::iterator
local Used to iterate through the Error Listing.
i2
PrintAssemblyListing vector<int>::iterator
local Used to Iterate throught the current line from the Error Listing.
vecstrCurErrTableLine
PrintAssemblyListing vector<string>
local Holds the current line from the Error Table.
boolFoundLine
PrintAssemblyListing bool
local Used to check if the correct Error Line has been found.
k
PrintAssemblyListing list<vector<string>>::iterator
local Used to iterate through the Error Table.
tablefilename
SaveObjTable
char*
local
The name of the output file that we are saving the object  table to.
vecCurLine
SaveObjTable vector<string>
local
Holds the current line of the object table.
Tablefile
SaveObjTable fstream
local
The output stream we use to ouput to a file.
j
SaveObjTable list<vector<string>>::iterator
local
Used to iterate through the Linking Records.
f
SaveObjTable int
local
Used to increment through the current line of the Records.
i
SaveObjTable list<vecotr<string>>::iterator
local
Used to iterate through the Text Record.
index
SaveObjTable int
local
Used to increment through the current line of the Records.

These are the elements used in the Linker.


name module type local or global purpose
globalErrorTable global list<vector<string>> global Linker Error Messages from linkerrors.txt
globalSymbolTable global list<vector<string>> global Linker symbol table
globalLoadFile global vector<string> global load file
globalIntermediateLoadFile global list<vector<string>> global Intermediate file - output of pass1
globalThisModule; global vector<string> global current module records in LinkPass1
globalLoadFileHeaderRecord; global string global Load File header Record
globalLoadFileEndRecord; global string global Load file End Record
globalLoadFileHeaderRecordModuleName; global string global First module linked
globalLoadFileRecordCountHex; global string global Records in load file in hex
globalLoadFileRecordCount; global int global Records in load file in decimal
globalLoadFilename; global string global loaded file name
globalErrorListing; global list<vector<string>> global loaded file errors
globalErrorModuleName; global string global Very unnecessary variable to hold a current module name that's used for add errors to error listing
globalErrorLineNum global int global same as above
globalFatalError global bool global boolean for checking for fatal errors
globalLoadAddrHex global string global stores Addr values
globalLoadLenHex global string global stores Lengths
globalLoadStartHex global string global stores Starting addresses
globalLoadModules global int global number of modules.
ADDSYMBOL_OK global const int global indicator for symbol is ok
ADDSYMBOL_EXIST global const int global indicator for symbol exists
SAVELOADFILE_OK global const int global indicator for load file saved
SAVELOADFILE_EMPTY global const int global indicator for load file is empty
globalModuleName global string global the current module name being processed in pass 1
globalRecordsCount=0 global int global number of records in the current module being processed in pass1
TEXTREC global const int global indicator for Text Record
LINKINGREC global const int global indicator for Linking Record
HEADERREC global const int global indicator for Header Record
ENDREC global const int global indicator for End recod
CHECKERROR global const int global indicator for invalid record
strSpace PrintFileHeader string local Unnecessary value
intExtraSpace PrintFileHeader int local Unnecessary value it is used to put a blank space at position 4 of strHeaderText
strHeaderText PrintFileHeader string local input parameter; Header Text to be printed
strSpace PrintHeader string local Unnecessary value
intExtraSpace PrintHeader int local Unnecessary value it is used to put a blank space at position 4 of strHeaderText
strHeaderText PrintHeader string local input parameter; Header Text to be printed
intInput IntToString int local input parameter; will be converted to string
int2str IntToString ostringstream local input is stored here as a string
strOutput IntToString string local int2str is stored here again for no reason
neg HexToDec bool local checker for sign
intReturn HexToDec int local return value stored
hexchar HexToDec int local each digit in the input is stored
hexstr HexToDec string local input parameter; will be converted to decimal integer value
i DecToHex int local stepper
decint DecToHex int local input parameter; will be converted to Hex
remainder DecToHex stack<int> local storage for remainders
hex DecToHex string local final value
temp DecToHex string local temp value
hexDigits DecToHex char[] local table for conversion
neg DecToHex bool local checker for sign
errorFiling AddErrorTableLine vector<string> local temp values stored before being actually added in
vecintErrTableLine PrintErrorTable vector<string> local temp for iterator which is not really worth it since you can directly access fields in the iterator pointer
i PrintErrorTable list<typename vector<typename string>>::iterator local iterator for Error listing
strErrNum PrintErrorTable string local stores current error's error number
i PrintErrorTable list<typename vector<typename string>>::iterator local iterator for Error table
boolFoundLine PrintErrorTable bool local true if line is found
vecintErrTableLine PrintErrorsForLine vector<string> local temp for iterator which is not really worth it since you can directly access fields in the iterator pointer
i PrintErrorsForLine list<typename vector<typename string>>::iterator local iterator for Error listing
strErrNum PrintErrorsForLine string local stores current error's error number
i PrintErrorsForLine list<typename vector<typename string>>::iterator local iterator for Error table
boolFoundLine PrintErrorsForLine bool local true if line is found
table BuildList list<vector<string>> local output of buildList
input BuildList ifstream local ifstream for opening a file
line BuildList char[] local temporary line of the file
table_buf BuildList char* local checking for more tokens
tokenizer BuildList char* local each token in the line
vecstrNewLine AddSymbolTable vector<string> local new line of the symbol table
vecstrSearcher AddSymbolTable vector<string> local temp value for comparing
strSearcher AddSymbolTable string local not even used in the function. It's just there to make my job harder; thanks chris
i AddSymbolTable list<typename vector<typename string>>::iterator local iterator for symbol table
i ReturnModuleBySymbol list<typename vector<typename string>>::iterator local symbol table iterator
vecstrNewLine ReturnAdjustByLabel vector<string> local new line of the symbol table
vecstrSearcher ReturnAdjustByLabel vector<string> local temp value for comparing
strSearcher ReturnAdjustByLabel string local not even used in the function. It's just there to make my job harder; thanks chris again
i ReturnAdjustByLabel list<typename vector<typename string>>::iterator local iterator for symbol table
vecstrNewLine ReturnLinkAddressByLabel vector<string> local new line of the symbol table
vecstrSearcher ReturnLinkAddressByLabel vector<string> local temp value for comparing
strSearcher ReturnLinkAddressByLabel string local not even used in the function. It's just there to make my job harder; thanks chris again&again
i ReturnLinkAddressByLabel list<typename vector<typename string>>::iterator local iterator for symbol table
curSymbolTableLine PrintLinkerSymbolTable vector<string> local temp for current line of symbol table
k PrintLinkerSymbolTable int local iterator for fieldlen
l PrintLinkerSymbolTable int local temp value
lmax PrintLinkerSymbolTable int local the max value will be stored
fieldlen PrintLinkerSymbolTable int[] local each fields length is stored
colnum PrintLinkerSymbolTable int local current column number
lzeroes PrintLinkerSymbolTable string local number of zeroes
i PrintLinkerSymbolTable list<typename vector<typename string>>::iterator local symbol table iterator
i2 PrintLinkerSymbolTable vector<typename string>::iterator local iterator foro curSymbolTableLine
spacedout PrintLinkerSymbolTable int local number of spaces needed for pretty printing
buf ReturnFieldFromRecordLine char* local used as a buf in tokenizer
intFieldStepper ReturnFieldFromRecordLine int local iterator for each field in a record
curField ReturnFieldFromRecordLine char * local pointer to the current field in the record
vecCurLine SaveLoadFile vector<string> local temp value used in iteration; not necessary but used anyways for no reason
loadfile SaveLoadFile fstream local file stream for opening a file
n SaveLoadFile vector<typename string>::iterator local iterator for globalLoadFile
strLoadLine SaveLoadFile string local temp value used in iteration; not necessary but used anyways for no reason
strReturn TrimLeadingZeroes string local stores return value
moduleName checkRecord string local Store current module name of the program being linked.
rec checkRecord char local Used as a pointer for record(which being passed to checkRecord function)
type checkRecord int local Used to get the first character(uppercased) from the 'rec' and to determine to which type of record it belongs to.
addr checkRecord int local Used to store the the decimal version of the hexadecimal address in a record.
i checkRecord int local Being used as an iterator in various places in checkRecord function.
hexchar checkRecord int local Being used to temporarily store characters(one characters at a time) from the hexadecimal address of the record to evaluate it to a decimal value.
rtcheck checkRecord int local Being used to temporarily store the relocation type of a symbol from Text Records.
tempstring checkRecord string local Used as a holder for the tokenized characters value from date and time in Header Record.
abe checkRecord int local Used as a holder to place the integer values of 'tempstring' to be evaluated.
lacheck checkRecord int local Used to store Assembler Assigned Load Address value in decimal.
tcheck checkRecord int local Store the number of Text Record(s) exists in a module.
TRESSEL checkRecord string local Used to compare and determine if the word 'TRESSEL' exists in the Header Record.
broken checkRecord bool local Used to signal if the Version# in Header Record following the right format.
symbol validateSymbol string local Used to store the characters from 'Symbol' part in Text Record(s) to be evaluated.
strModuleName LinkPass1 string local Used to store the module name from the text record being analyzed.
strModuleHeaderNumLinkingRecordsHex LinkPass1 string local Used to store the number of linking records(in module header) which is in hexadecimal.
strModuleHeaderNumTextRecordsHex LinkPass1 string local Used to store the number of text records(in module header) which is in hexadecimal.
strModuleEndNumRecordsHex LinkPass1 string local Used to store the number of records(in end record) which is in hexadecimal.
strModuleLoadAddrHex LinkPass1 string local Used to store the link address(hexadecimal) of the module.
strModuleLinkAddrHex LinkPass1 string local Used to store the load address(hexadecimal) of the module.
strModuleAdjustHex LinkPass1 string local Used to store the adjustment of the address(hexadecimal) of the module.
strModuleLenHex LinkPass1 string local Used to store the length(hexadecimal) of the module.
intModuleFoundNumTextRecords LinkPass1 int local Store the count of the text records exists in a module being analyzed.
intModuleFoundNumLinkingRecords LinkPass1 int local Store the count of the linking records exists in a module.
strEntryName LinkPass1 string local Used to store an Entry Name.
strEntryAsmAddrHex LinkPass1 string local Used to store the entry Assembler address(hexadecimal).
strEntryLinkAddrHex LinkPass1 string local Used to store the entry Linking address(hexadecimal).
input LinkPass1 ifstream local Used to get an input.
boolEndModule LinkPass1 bool local Used to indicate the line being analyzed is the end record.
line[900] LinkPass1 char local Declares a 'line' array of 900 characters
linenum LinkPass1 int local Indicate the line number being analyzed.
linenumprint LinkPass1 string local Indicate the line number in the form to be printed in the file.
ptrLine LinkPass1 char* local A pointer pointing to the array of 'line'.
intRecordOK LinkPass1 int local Used to indicate a line of record is valid.
intGlobalLoadLen LinkPass1 int local Store the global load length in integer form.
intModuleLen LinkPass1 int local Store the module length in integer form.
seconds LinkPass2 time_t local Used to get seconds from the C++ time function.
time LinkPass2 string local Used to get time from the C++ function.
year LinkPass2 string local Used to get year for the Header Record.
month LinkPass2 string local Used to get month for the Header Record.
date LinkPass2 string local Used to get the date for the Header Records.
hour LinkPass2 string local Used to get the hour for the Header Record.
minute LinkPass2 string local Used to get the minute for the Header Record.
second LinkPass2 string local Used to get the second for the Header Record.
linenum LinkPass2 int local Used to indicate the line number being examined.
linenumprint LinkPass2 string local Used to store the line number to be printed in 4 digit hexadecimal.
intDate LinkPass2 int local Used to store the integer value of 'date' from the C++ ctime.
pastFeb LinkPass2 bool local Used to indicate the month is after February; to help in the cases of leap year.
leapCheck LinkPass2 int local Used to store the integer value of 'year' to examine whether the year is in leap year or not.
ss LinkPass2 ostringstream local An output string stream used to stream 'intDate'.
i LinkPass2 list<typename vector<typename string>>::iterator local Used as an iterator.
k LinkPass2 vector<typename string>::iterator local Used as an iterator.
vecstrModule LinkPass2 vector<string> local Store the module being analyzed as a vector string.
strModuleLine LinkPass2 string local Used to store the current line from the module that is being analyzed.
strNewLoadTextRecord LinkPass2 string local Used to store the New Load Text Record from the module that is being analyzed.
strTHexAddr LinkPass2 string local Used to store the hexadecimal address from the line of the text record being analyzed.
strTObjectCode LinkPass2 string local Used to store the object code of the text record being analyzed.
strTRelocType[3] LinkPass2 string local Used to store the relocation type from the text record being analyzed.
strTRelocOp[3] LinkPass2 string local Used to store the relocation operation(+ or -) from the text record being analyzed.
strTRelocSym[3] LinkPass2 string local Used to store the relocation symbol from the text record being analyzed.
strTModuleName LinkPass2 string local Used to store the module name from the text record being analyzed.
strNewHexAddr LinkPass2 string local Used to store the new hexadecimal address from the text record being analyzed.
strCurModuleAdjustHex LinkPass2 string local Used to store the adjustment of the address of the object code of the module being analyzed.
strObjectAdjustHex LinkPass2 string local Used to store the current adjustment of the address(binary) of the module being analyzed.
strObjectAdjustResultBin LinkPass2 string local Used to store the current adjustment of the address(hexadecimal) of the module being analyzed.
strNewObjectCode LinkPass2 string local Used to store the New object code being analyzed.
strNewObjectCodeHex LinkPass2 string local Used to store the New object code being analyzed in hexadecimal.
strNewObjectCodeBin LinkPass2 string local Used to store the New object code being analyzed in binary.
strNewObjectCodeAddrHex LinkPass2 string local Used to store the New object code address being analyzed in hexadecimal.
strNewObjectCodeAddrBin LinkPass2 string local Used to store the New object code address being analyzed in binary.
strCurRelocType LinkPass2 string local Used to store the current relocation type being analyzed.
strCurRelocOp LinkPass2 string local Used to store the current relocation operation being analyzed.
strCurRelocSym LinkPass2 string local Used to store the current relocation symbol being analyzed.
strCurRelocSymLinkAddrHex LinkPass2 string local Used to store the current relocation symbol of Link address in hecadecimal.
intObjectAdjustResult LinkPass2 int local Used to help to adjust result of an object.
intTRelocType LinkPass2 int local Used to determine a relocation type in a text record.
intTRelocOp LinkPass2 int local Used to determine a relocation operation in a text record.
intTRelocSym LinkPass2 int local Used to determine a relocation symbol in a text record.
intTRelocFieldCount LinkPass2 int local Used to determine a relocation field count in a text record.
strRecord LinkPass2 string local Used to store the record line as a string.
strFindField LinkPass2 string local Used to help find the field in a line of a record.
strLastField LinkPass2 string local Used to help to find the last field in a line of a record.
k LinkPass2 int local Used as an iterator for the record field.
n LinkPass2 int local Used as a switch and count the relocation count.
x LinkPass2 int local Used as an iterator.
globalLoadStartDec PrintLoadMemory int global Indicate the start of the load memory in decimal.
globalLoadLenDec PrintLoadMemory int global Indicate the load memory length in decimal.
start PrintLoadMemory string local The start number of memory to be printed.
end PrintLoadMemory string local The end number of memory to be printed.
strCurAddrPrintHex PrintLoadMemory string local The string of the current address to be printed in hexadecimal.
strCurAddrRecordHex PrintLoadMemory string local The stirng of the current address record in hexadecimal.
loc PrintLoadMemory int local Used to indicate the location of the load memory to be printed.
ender PrintLoadMemory int local Indicate the end of the load memory to be printed.
endLoad PrintLoadMemory bool local A boolean to indicate the end if the load memory to be printed.
l PrintLoadMemory vector<typename string>::iterator local Used as an iterator.
x PrintLoadMemory int local Used as an iterator.
debugging main bool local This variable is being set to true to enable debugging output or else it is false in default.
intSaveLoadfile main int local Set to 0.
source main string local Used as a variable to receive input about the object files needed by user in 'cin'.
objFiles main vector<string> local Used to store the names of the object files.
file main string local Used to temporarily store the object file names being parsed from 'source'.
intFiles main int local Used to indicate how many object files inputted by the user.
s main int local Used to store 'source' length.
intFilenameStepper main int local A stepper to help in getting the filename of the object file(s) needed.
k main int local Used as an iterator.
i main list<typename vector<typename string>>::iterator local Used as an iterator.
k main vector<typename string>::iterator local Used as an iterator.
vecstrModule main vector<string> local Store the module being analyzed as a vector string.
strModuleLine main string local Used to store the current line from the module that is being analyzed.
n main vector<typename string>::iterator local Used as an iterator.
strLoadLine main string local Store the load line as a string.
temp main int local Used to help halting the display in Win32.











These are the elements used in the Simulator.

Variable Name    Module Where Defined  Data Type  Local or Global    Purpose
globalNegNum GLOBAL bool
global
Used to determine if ConvertBase is converting a negative number.
globalHeaderFound GLOBAL bool global Used to determine if the Linking Header was found in the load file.
globalEndFound GLOBAL bool global Used to determine if the Linking End was found in the load file.
globalFatalError GLOBAL bool global Used to determine if  a fatal error was encountered.
globalHalt GLOBAL bool global Used to determine if execution should end.
globalHaltValue GLOBAL int global Holds the value of the halt instruction that caused the simulator to end.
globalInitialStartAddress GLOBAL int global Used as the load point in memory for instructions.
globalExecutionStartAddress GLOBAL int global Used as the starting location when execution of instructions begins.
globalProgramLength GLOBAL int global The length of the program in words of memory.
globalBR GLOBAL int global The Base Register.
globalAC GLOBAL int global The Accumulator Register.
globalIR GLOBAL int global The Index Register.
globalAR GLOBAL int global The Alternative Register.
globalLC GLOBAL int global The Location Counter.
globalSR GLOBAL string global The Status Register.
newSR GLOBAL string global A temporary Status Register for the current instruction; gets swapped with globalSR.
mem[4096] GLOBAL string global Holds the 4096 words of memory for this system.
globalProgramName GLOBAL string global Holds the name of the program being executed.
ADD GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
SUB GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
MUL GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
DIV GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
LDN GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
ABS GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
MEM GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
SHIFT GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
ROTATE GLOBAL const int global Used to determine which overflow operation is being checked in CheckOverflow.
operand1 CheckOverflow double local The first operand in the operation being performed.
operand2 CheckOverflow double local The second operand in the operation being performed.
type CheckOverflow const int local The type of overflow being checked.
max_bits CheckOverflow int local The max number of bits of the Register being used.
max_val CheckOverflow double local Holds the max value that the current operation can hold.
min_val CheckOverflow double local Holds the min value that the current operation can hold.
opcode DoInstruction string local The binary opcode for the instruction
dec_val DoInstruction int local The memory address for the instruction.
strDecOpcode DoInstruction string local The decimal opcode in a string format for the instruction.
intOpcode DoInstruction int local The decimal integer opcode for the instruction.
bin_val DoInstruction string local The binary value of the contents of memory at the effective address for the current instruction.
decAdr DoInstruction string local The decimal value of the contents of memory at the effective address for the current instruction. 
strAC DoInstruction string local A binary string representation of the Register value.
tempAC DoInstruction string local A decimal string representation of the Register value.
strIR DoInstruction string local A binary string representation of the Register value.
tempIR DoInstruction string local A decimal string representation of the Register value.
strAR DoInstruction string local A binary string representation of the Register value.
tempAR DoInstruction string local A decimal string representation of the Register value.
strBR DoInstruction string local A binary string representation of the Register value.
tempBR DoInstruction string local A decimal string representation of the Register value.
operand DoInstruction string local Decimal string representation of the operand to be executed.
dec_str_val DoInstruction string local Decimal string representation of the operand to be executed.
SRstr DoInstruction string local Decimal string representation of the status register.
binAC DoInstruction string local A binary string representation of the Register value.
binIR DoInstruction string local A binary string representation of the Register value.
strHalt DoInstruction string local A decimal string representation of the halt instruction.
strTemp DoInstruction string local A binary string representation of the halt instruction.
intSR DoInstruction string local A decimal string representation of the status register.
isNeg DoInstruction bool local Used to determine of the number read is negative.
readNum DoInstruction string local The number read in from the console.
testNum DoInstruction int local Number used to test if it is within storage range.
bin_to_store DoInstruction string local Binary value of the string to be stored.
inTemp DoInstruction string local Temp storage of each character read in from the console.
outTemp DoInstruction string local Temp storage of each character in binary read in from the console.
output DoInstruction string local String to be output to the console.
outputNum DoInstruction int local Number to be output  to the console.
first DoInstruction string local Binary value of the first character to be output.
f DoInstruction string local Decimal value of the first character to be output.
fnum DoInstruction int local Integer of the first character to be output.
second DoInstruction string local Binary value of the second character to be output.
s DoInstruction string local Decimal value of the second character to be ouput.
sNum DoInstruction int local Integer of the second character to be output.
third DoInstruction string local Binary value of the third character to be output.
t DoInstruction string local Decimal value of the third character to be output.
tNum DoInstruction int local Integer of the third character to be output.
bin_val EFFADDR string local The 24 bit binary instruction.
addr_flags EFFADDR string local Holds the address flags contained within the binary instruction code.
addr_field EFFADDR string local Holds the address portion of the binary instruction code.
temp EFFADDR string local String to hold the address in decimal format.
dec_field EFFADDR int local Decimal integer of the address.
source main string local The load file being executed.
input main ifstream local Used to access the contents of the load file.
line[900] main char[ ] local Holds a line from the load file.
recordCount main int local Used to keep count of the number of records found.
k main int local Holds the current postition within the record being checked.
j main int local Used as an iterator.
storageSpot main int local Location in memory to store the current instruction.
hexCode main string local The hex code for the current instruction.
tempVal main string local Temp storage of the memory location in hex.
tempStorage main string local Temp storage of the memory location in hex.
binCode main string local The binary code for the current instruction.
loc main int local The starting location of memory where instructions are stored.
end_loc main int local The ending location of memory where instructions are stored.
outfile main string local Name of the output file.
output main fstream local Output stream to the output file.
start main string local Hex starting location of memory where instructionsa are stored.
end main string local Hex ending location of memory where instructionsa are stored.
dec_val main int local The effective address for the current instruction.
opCode main string local The opcode for the current instruction.
addr main string local The address of the current instruction.
hexaddr main string local The address in hex of the current instruction.
hexCode main string local The opcode in hex of the current instruction.
**NOTE: ConvertBase was not added to this table as it is already described in the assembler elements table.


Written by Group 3 of CSE 560 Autumn 2009 5:30 section
Chris Brainerd, Jarrod Freeman, Abe Kim, Abdul Modrokbi, and David Straily
The Ohio State University