100 likes | 238 Views
SI = 3. MOS Check. Master Mode Register Check. CheckRegisters. SI = 0. ExecuteUserProgram. CheckRegisters. CASE:. TI = 0, SI = 1. Read. TI = 0, SI = 2. Write. TI = 0, SI = 3. Terminate: No Error. Terminate: Time Limit Exceeded. TI = 2, SI = 1. Write, Terminate: Time Limit Exceeded.
E N D
SI = 3 MOS Check Master Mode Register Check CheckRegisters SI = 0 ExecuteUserProgram
CheckRegisters CASE: TI = 0, SI = 1 Read TI = 0, SI = 2 Write TI = 0, SI = 3 Terminate: No Error Terminate: Time Limit Exceeded TI = 2, SI = 1 Write, Terminate: Time Limit Exceeded TI = 2, SI = 2 Terminate: No Error TI = 2, SI = 3 HandleValid PageFault TI = 0, PI = 1 Terminate: Invalid Operation TI = 0, PI = 2 Terminate: Invalid Operand Yes TI = 0, PI = 3 Valid Page Fault? No TI = 2, PI = 1 Terminate: Time and Operation Errors Terminate: Invalid Page Fault TI = 2, PI = 2 Terminate: Time and Operand Errors TI = 2, PI = 3 Terminate: Time Limit Exceeded
HandleValidPageFault M[PTR + i] = Frame, IC = IC – 1, PI = 0 Frame = Rand(0, 29) * 10, i = 0 yes M[PTR + i] free? no i = i + 1
Read IR[4] = 0 M[RA… RA + 9] = $EOJ M[RA… RA + 9] allocated? Yes RA = AddressMap (IR[3, 4]) No PI = 3 Terminate: Out of Data Yes No M[RA… RA + 9] = Next Data Line, SI = 0
Write LLC = LLC + 1 Terminate: Line Limit Exceeded LLC > TTL? Yes No IR[4] = 0 M[RA… RA + 9] allocated? M[RA… RA + 9] printed to the output file Yes RA = AddressMap (IR[3, 4]) No PI = 3
Terminate Two blank lines printed to output file Load SI = 0
InitPageTable ExecuteUserProgram Load Print header $AMJ What type? Control card $DTA IC = 0 m = 0 Read next card End program $END m = 100 ? m … m +9 = card and m = m + 10 No Program card Yes End while loop Terminate: Memory Exceeded Re-enter Loop
InitPageTable PTR Register = Rand(0, 29) * 10 M[PRT… PTR + 9] allocated for the page table
ExecuteUserProgram IR = M[AddressMap(IC)], IC = IC + 1 TTC > TTL Terminate: Time Limit Exceeded No Yes No PI = 2 Is IR[3,4] valid / a number? yes else PI = 1 Examine IR[1,2] LR SR CR BT GD PD H R = M[AddressMap (IR[3,4])]? C = T? M[AddressMap(IR[34])] = R R = M[AddressMap(IR[34])] SI = 1 SI = 2 SI = 3 Yes No Yes IC = IR[3, 4] C = T C = F End Examine
Address Map Page = VA / 10, Offset = VA % 10 Real address = M[Frame + Offset] Frame = M[PTR + Page] Is M[PTR + Page] null? No Yes PI = 3