Professional Documents
Culture Documents
Aim:
Algorithm:
STEP 1: Start the program for performing create, insert, modify, search, display and exit option
in symbol table.
STEP 3: Enter the choice for performing the operations in the symbol Table.
STEP 5: If the entered choice is 2, then a new symbol is inserted into the symbol table.
STEP 6: If the symbol is already present, it displays "variable already exists, enter another
variable". Else, insert the symbol and the corresponding address in the symbol table.
STEP 7: If the entered choice is 3, the symbol to be modified is searched in the symbol table.
The label or address or both can be modified.
STEP 8: If the entered choice is 4, the symbol to be searched is searched in the symbol table.
Aim:
Algorithm:
STEP 1: Open the files fp1 and fp4 in read mode and fp2 and fp3 in write mode
Read the source program
STEP 2: If the opcode read in the source program is START, the variable location counter is
initialized with the operand value.
STEP 4: The source program is read line by line until the reach of opcode END.
STEP 5: Check whether the opcode read is present in the operation code table.
STEP 7: If the opcode read is WORD, the location counter is incremented by3.
STEP 8: If the opcode read is RESW, the operand value is multiplied by 3 and then the location
counter is incremented.
STEP 9: If the opcode read is RESB, the location counter value is incremented by operand value.
STEP 10: If the opcode read is BYTE, the location counter is auto incremented.
STEP 11: The length of the source program is found using the location counter value.
DATE: IMPLEMENTATION OF PASS TWO OF A TWO PASS
ASSEMBLER
EXPT NO:
Aim :
Algorithm:
STEP 2: Use the symbol table file and choose it for two pass assembler
STEP 4: In the intermediate file,compare the opcode with file and get the corresponding opcode
value
STEP 5: Append this value with its corresponding location counter and store
label,opcode,operand,object code in a new file
STEP 6: Create a file to store and generate the object program format by using the object code
generated in pass1
STEP 7:Display the new file with its contents as header,text and end records.
DATE:
Aim:
Algorithm:
.
DATE:
Aim:
Algorithm:
STEP 3:The symbol is entered in the symbol table with ‘$’ pin
STEP 4: When the definition is encountered, program address is inserted in a list associated with
the symbol
STEP 5: continue the process fill the end of program fill all the forward references
DATE:
Aim:
Algorithm:
STEP 7: Write the starting location counter value of a blocks of object code and the
corresponding internal representation to the output file
Aim:
Algorithm:
STEP 5: Using while loop perform the loop until character is not equal to E
while(strcmp(input,"E")!=0)
STEP 9: And perform the for loop for starting zero to up to len
Get the opcode ,addr and assign relocbit to bitmask
STEP 10: If relocabit is zero
STEP 10.1: Then
actual address=address;
STEP 10.2: else
Add the address and start value