-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecondPass.h
More file actions
44 lines (37 loc) · 1.64 KB
/
Copy pathsecondPass.h
File metadata and controls
44 lines (37 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file secondPass.h
* @brief Implementation of the second pass of the assembler.
*
* This file contains the implementation of the second pass of the assembler,
* where the code generated in the first pass is further analyzed to produce
* final machine code and resolve symbol references.
*
* If no errors occur, the second pass generates the following output files:
* - fileName.ob - machine code translation of the assembly code.
* - fileName.ent - list of entry symbols and their memory addresses.
* - fileName.ext - list of external symbol usage and memory locations for
* linker resolution.
*
* Enable DEBUG in settings.h to see additional debugging output.
*/
#ifndef _SECOND_PASS_H_
#define _SECOND_PASS_H_
#include "setting.h"
#include "fileStructures/fileStructures.h"
/**
* @brief Performs the second pass analysis of the assembler code.
*
* This function is responsible for conducting the second pass analysis of the assembler code.
* It checks for unresolved symbols and entries, printing corresponding errors if necessary.
* If there are no unresolved symbols or entries, and no other errors are detected,
* it updates the data symbol addresses and generates the final analysis
* report (files .ob, .ent, .ext)
*
* @param f Pointer to the file analysis structure.
* @return An exit_code representing the result of the second pass analysis:
* - SUCCESS if the analysis is successful and no errors are found.
* - ERROR if an error occurs during the analysis.
* - MEMORY_ERROR if a memory allocation error occurs during processing.
*/
exit_code secondPass (file_analyze *f);
#endif /* _SECOND_PASS_H_ */