Department of Computer Science and Information Technology
Operating System: SSWTZC364/ CSIWZC364/ SEWIZC364
Lab Work Sheet-01
Problem Statement 1: Execute the following program, which computes the average of two numbers
in the CPU simulator. Refer to Lab Sheet 1.2 -Introduction to CPU-OS simulator.
MOV #5, R00
MOV #5, R01
ADD R00, R01
MOV R01, R02
DIV #2, R02
STB RO2, 0
HLT
Answer the following questions:
1) Present the snapshot of the program entered in the CPU simulator.
2) What is the program's starting address S(State both physical and logical address)?
Physical address: 0100
Logical address: 0000
3) How many bytes of memory are required to store this program? (Hint: HLT is 1 byte instruction) 35
bytes of memory are required to store the program
4) Show the content of various registers used in the program. (present the snapshot)
5) What is the outcome of the program? Which register holds the result
Problem Statement 2: Compile the following source code and load it in the main
memory. Replace with your firstname. Refer to Lab Sheet 1.3 - Introduction to
Compiler Simulator.
Answer the following questions:
1) Give the snapshot PROGRAM SOURCE (INPUT) Window of the compiler simulator.
2) Give the snapshot of the PROGRAM CODE (OUTPUT) window of the compiler simulator.
3) Give the snapshot of the COMPILER PROGRESS Window of the compiler simulator.
4) Run the program and give a snapshot of the various registers used in the program.
5) In which register the value of ‘x’ is stored? The Value of X is store in R02 register