Toisella puolella suomeksi
Computer Organization I, course exam 28.4.2008
Write in each answer sheat your name and signature, student id number, course name, and page nr.
- [9 p] Program, processor and system
- In what form is the program in execution seen by the processor?
- How is the program in execution executed by the processor?
- In what form is the program in execution seen by the operating system?
- How is the program in execution executed by the operating system?
- [9 p] Processor privileged execution mode.
- What is privileged execution mode and what is it used for?
- How does the privileged execution mode differ from the (normal) user mode? Give two machine language examples.
- When and how is the execution mode changed from user mode to privileged mode?
- When and how is the execution mode changed from privileged mode to user mode?
- [9 p] I/O implementation. We have
user level process (P), that wants to write a 512 byte data segment on disk.
We use indirect I/O and I/O is implemented with device driver (D)
and device controller process (C).
Processes
P and D execute on the normal processor (CPU) where as C executes on the device controller.
- How and when does the device driver D know what it should do? Who gives I/O-tasks to D and how?
- How and when does the device controller C know what it should do? Who gives instructions to C and how?
- How and when does the device driver D know that the data has been written on disk? Who tells that to D and how?
- How and when does the application P know that the data has been written on disk? Who tells that to P and how?
- [9 p] Titokone, TitoTrainer and ttk-91. Function PosSum(T, N) returns the sum of positive
(>0) numbers in N-element array T. T is a call-by-reference parameter and N is a call-by-value parameter. Variable X and 50 element array Weights[50] are defined in main program level.
- Use symbolic ttk-91 assembly language to implement statement X = PosSum (Weights, 50).
- Use symbolic ttk-91 assembly language to implement function PosSum.
- Assume now that we want to compute the sum of positive values in array Weights, but only considering array elements Weights[10], ..., Weights[30].
Implement this with symbolic ttk-91 assembly language with proper call to function PosSum.
Follow the recommended subroutine (function) call mechanism.
TTK-91 assembly language instructions are:
NOP, STORE, LOAD, IN, OUT,
ADD, SUB, MUL, DIV, MOD,
AND, IR, XOR, SHL, SHR, COMP,
JUMP,
JNEG, JZER, JPOS, JNNEG, JNZER, JNPOS,
JLES, JEQU, JGRE, JNLES, JNEQU, JNGRE,
CALL, EXIT, PUSH, POP, PUSHR, POPR,
SVC