Page 187 - DCAP507_SYSTEM_SOFTWARE
P. 187

Unit 11: Programming Languages Concept (II)




                                                                                                Notes
             060    push   word   [cs:taskstates+bx+8]   ;   flags   of   new   taskpush   word
             061    [cs:taskstates+bx+6] ; cs of new taskpush word [cs:taskstates+bx+4] ; ip of new
             062    taskmov ax, [cs:taskstates+bx+0] ; ax of new task mov bx, [cs:taskstates+bx+2] ;
             063    bx of new taskiret ; return to new task
             064
             065
             066

             067    start:     mov     word    [taskstates+10+4],   taskone   ;   initialize
             068               mov     ip[taskstates+10+6],   cs   ;   initialize   csword
             069               mov     [taskstates+10+8],  0×0200  ;  initialize  flagsword
             070               mov     [taskstates+20+4],   tasktwo    ;    initialize
             071               mov     ip[taskstates+20+6],   cs   ;   initialize   csword
             072               mov     [taskstates+20+8],  0×0200  ;  initialize  flagsword
             073               mov     [current], 0 ; set current task index
             074

             075    xor mov cli        ax, ax es, ax         ; point es to IVT base
             076
             077
             078    mov  mov  mov  mov  word        [es:8*4],  ;  hook  timer  interrupt  ;
             079    xor sti            timer[es:8*4+2],   csax,  point  es  to  video  base;
             080                       0xb800 es, axbx, bx   initialize bx for tasks
             081
             082
             083
             084
             085    jmp $                           ; infinite loop

          The space where all registers of a task are accumulated is known as the process control block or
          PCB. Actual PCB comprises a few more things that are not applicable to us now. INT 08 that is
          saving and restoring the registers is known as the scheduler and the whole event is known as a
          context switch.

          Self Assessment

          Fill in the blanks:

          12.  In real meaning multitasking is simple, even though we have to be enormously cautious
               when ................................ it.
          13.  We prefer multitasking to understand the power of ................................

          14.  If we have two ................................ programs A and B. Program A is busted, its state saved,
               and returned to B rather than A.
          15.  To obtain control from the program without the program knowing regarding it, we can
               utilize the ................................ highest priority interrupt that is from time to time coming to
               the processor.






                                           LOVELY PROFESSIONAL UNIVERSITY                                   181
   182   183   184   185   186   187   188   189   190   191   192