Main()

int * Num1, * Num2, *Total
1. Show page table

Allocate( Num1, Num2, Total)
3. Show page table

Load( Num1, File2 )
5. Show page table

Load( Num2, File1 )
7. Show page table

Init( Total )
9. Show page table

Calc( Total, Num1, Num2 )
11. Show page table

Print( Total )
13. Show page table

Exit

Allocate( Num1, Num2, Total )

//Assume getmem is a system call outside of our virtual and real memory space.
//However, the memory allocated is part of our memory space.

Num1 = getmem(256) //Allocate memory for array

Num2 = getmem(256) //Allocate memory for array

Total = getmem(256) //Allocate memory for array

2. Show page table

Init( TArray )

For i = 0 to 255
    TArray[i] = 0
EndFor

8. Show page table

Return

Load( Array, Fname )

I = 0
Open Fname

While ( Not = EOF )
    Read Fname into Array[i]
EndFor

4. & 6. Show page table (called twice from main)

Return

Calc( TArray, Array1, Array2 )

For i = 0 to 255
    TArray[i] = Array1[i] + Array2[i]
EndFor

10. Show page table

Return

Print( Array )

For i = 0 to 255
    Print Array[i]
EndFor

12. Show page table

Return