Hierarchy Chart

A HIPO chart is a description of the the various components of a project and their relationship to one and other in an implementation. HIPO stands for Hierarchy Input Process Output chart. So, to create such a chart, you must describe each of the processes in a project, the data that is given to them and that data they produce. The following is a hierarchy chart for the assembler. It only describes the processes.  This technique is not very applicable to object oriented programming.

1. Initialize - give initial values to all global variables, get the name of the program file and open it.
2. Pass I - get addresses for all labels.

2.1 Get Next Line. 2.1.1 Read the next line from the source file.
2.1.2 Detect comments and blanks lines.
2.1.3 Parse the statement into label, operation code, and operand.

2.2 Add Label to Symbol Table - adds a label and its address to the symbol table.
2.3 Get Location of Next Instruction - get the address of the next instruction.

2.3.1 Op Code Lookup - look up the op code.
2.3.2 Is Number
2.3.3 Convert Number - convert an ASCII string to an integer.

3. Sort Symbol Table and detect and report multiply defined labels. Record 999999 for their addresses. We will substitute ???? for the addresses when the translation is completed.
4. Pass II - generate the machine language equivalent of the assembler language program and display error messages.

4.1 Rewind Source File - prepare to reread the source file.
4.2 Get Next Line.
4.2.1 Read the next line from the source file.
4.2.2 Detect comments and blanks lines.
4.2.3 Parse the statement into label, operation code, and operand.

4.3 Generate Instruction - display the original assembler instruction and its machine language equivalent.

4.3.1 Validate label. Report error if illegal format.
4.3.2 Op Code Lookup. Report error if illegal op code.
4.3.3 Validate operand. Report error if illegal.
4.3.4 Symbol Table Lookup - look up a symbol in the symbol table.
Report error if it does not exist.
4.3.5 Display instruction - display original source code and translation on the screen.

4.4 Get Location of Next Instruction. Report error if we have exceeded to maximum memory size.