Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS-401 Computer Architecture & Assembly Language Programming

Similar presentations


Presentation on theme: "CS-401 Computer Architecture & Assembly Language Programming"— Presentation transcript:

1 CS-401 Computer Architecture & Assembly Language Programming
Lecture-31 Multitasking

2 Lets revise the last lecture

3 Multitasking/Multithreading

4 Thread Initialization
CS:IP = thread entry point SS:SP = next free stack Flags = 0x0200 AX,BX,CX,DX,SI,DI,BP,ES = don’t care DS = depends upon registration mechanism

5 Thread Initialization
mov si,[nextpcb] mov cl,9 shl si,cl add si,256*2+stack mov ax,[bp+4] sub si,2 mov [si],ax

6 Thread Initialization
mov si,[nextpcb] 3 mov cl,9 shl si,cl add si,256*2+stack mov ax,[bp+4] sub si,2 mov [si],ax

7 Thread Initialization
mov si,[nextpcb] mov cl,9 shl si,cl add si,256*2+stack mov ax,[bp+4] sub si,2 mov [si],ax

8 Thread Initialization
mov si,[nextpcb] mov cl,9 shl si,cl add si,256*2+stack mov ax,[bp+4] sub si,2 mov [si],ax SI SI

9 Thread Initialization
mov ax,[pcb+28] mov [pcb+bx+28],ax mov ax,[nextpcb] mov [pcb+28],ax

10 Thread Initialization
mov ax,[pcb+28] mov [pcb+bx+28],ax mov ax,[nextpcb] mov [pcb+28],ax PCB 0 PCB 1

11 Thread Initialization
mov ax,[pcb+28] mov [pcb+bx+28],ax mov ax,[nextpcb] mov [pcb+28],ax PCB 0 PCB 1

12 Thread Initialization
mov ax,[pcb+28] mov [pcb+bx+28],ax mov ax,[nextpcb] mov [pcb+28],ax PCB 0 PCB 1

13 Thread Initialization
mov ax,[pcb+28] mov [pcb+bx+28],ax mov ax,[nextpcb] mov [pcb+28],ax PCB 0 PCB 1 PCB 2

14 Thread Initialization
mov ax,[pcb+28] mov [pcb+bx+28],ax mov ax,[nextpcb] mov [pcb+28],ax PCB 0 PCB 1 PCB 2

15 Thread Initialization
mov ax,[pcb+28] mov [pcb+bx+28],ax mov ax,[nextpcb] mov [pcb+28],ax PCB 0 PCB 1 PCB 2


Download ppt "CS-401 Computer Architecture & Assembly Language Programming"

Similar presentations


Ads by Google