         ⢮ ࠧ  㪨 㡫 

᪨ 㤠⢥  ଠ⨪  ஭
______________________________________________________________________

                 ୮ ஥஢










                        ᭨⥫쭠 ᪠

                       ᮢ ஥  ⥬

                 "ࠡ⪠  "







                                                                 믮
                                                        㤥 .410703

                                                           ᥭ ..

                                                      㪮⥫ ࠡ

                                                            ਭ᪨ ..










                               1996








                                ঠ



1.  孨᪮  .................................

2. ࠡ⪠ ⬠ ........................................

3. ࠡ⪠   .................................

4. ஢ ⬠ .......................................

5. ஢  ⫠ ணࠬ ............................

祭 .....................................................

 .....................................................

ਫ .....................................................



































                                 

     ய஢  60-  易   ࠧࠡ⪮  -
⥣ࠫ 奬 ().  ⥣ࠫ 奬 ꥤ﫨  ᥡ  ࠧ
஭      ᨫ 稯. ࠡ-
稪 ⠭   稯 ன⢮,  饥  ப-
,   稫   㭪樮 ⥬.   砫 70-  
ப   Intel 8008 ⨫   ࢮ  -
 ய஢.
     1974 .  ஥  ய஢ 饣  -
祭 Intel 8080.  ᯥ 㤨 㣨     ந
஢ Intel 8080  .
     1878 . ଠ Intel ⨫    쥣    -
Intel 8086,   ᯥ稢  ᮢ⨬  8080   -
 ⥫ த ।   .    -
   ன  ᯥ祭 ᮢ⨬   ன⢠-
 -뢮 ⮣ ६ Intel ࠧࠡ⠫ ࠧ  -
 8086 -  8088,   1981 .   ࠭ ମ IBM 
 ᮭ ஢.
     ࠧ묨 ﬨ      8088  
80186,    8086 -  80186, 80286,  80386,  -
 ᯥ稫 ⥫   ᨫ 魮 ᫥-
.
    ࠭ ய஢ 㦨 稭 ᬮ -
襭   ᪬   ᭮ 稭. -,  ண-
ࠬ, ᠭ  몥 ᥬ,  ॡ ⥫쭮  -
   ६ 믮.  -,   몠 ᥬ  
१饣 設    ⥪ 設,  
狼 ᯥ稢  ࠡ   몠  ᮪  ஢.    
設⢮ ᯥ樠⮢   ணࠬ ᯥ祭  ࠧ-
ࠡ⪨  몠 ᮪ ஢, ⠪,  ᪠  ,  -
  ᠭ ணࠬ,    魮  䥪⨢  ணࠬ-
 ᯥ祭   筮 ᠭ  몥 ᥬ.





















                      1.  孨᪮ 

      ᮢ ஥ 室 ࠧࠡ ணࠬ  -
 ᥬ   Intel 8086 ॠ 㭪樨   -
 DIR  MKDIR.  ..   ணࠬ  ᮧ ⠫  c
㪠 ᪠    (㭪  MKDIR)   뢮,    㪠
짮⥬ ⠫. ६ ᮧ ⠫   
⠡ ࠧ饭 䠩 (FAT),   ⥬ ⮡ ᥪ,    ᯮ㥬
⨬ ⠫ 뫨 㯭 㣨 䠩.
     ஡  ᪮   ७ ᨨ DOS  -
 樨,    ᯮ짮 ப  ଠ ASCIIZ
 砫쭮 ⠭ ᪮,  㯠   䠩;  䠩-
     䠩; ᯥ樠  .
     ᮧ ⠫ ⮤  ਯ  䠩  ᯮ
㭪 39H 뢠 21H.  DS:DX  ப ASCIIZ , ᮤঠ-
饩 䨪 䠩 ( ࠬ 易⥫),  ப 
 00H, ਬ:
                  PATHNAME  DB  'C:\UTIL\NU.EXE',0
⭠  ( ﬠ ) ᯮ  ⢥ ࠧ⥫.
H㫥  (zero) 蠥 ப (  ASCIIZ).
     ᯥ譮 樨 ᮧ ⠫, 䫠 CF ⠭-
  0.   ᯥ譮 樨 䫠 CF ⠭  1,    -
 AX 頥  訡, 騩  樨 (⠡ 1.1), 
襬 砥, ᫨   㪠   ,    AX -
頥  訡 03.    ᮧ ⠫    
ᯮ짮 ᫥騥 ᨬ:
             " : ; / \ | ? * + = [ ] . , < >

                                              1.1
            Ŀ
             N        ᠭ 訡                 
            Ĵ
             01  訡  㭪樨                
             02                           
             03   㯠                 
             04   ᫨誮  䠩         
             05    ࠧ襭                   
             06  訡 䠩               
             07   ࠢ  ࠧ襭     
             08  H筮                   
             09  訡              
             10  訡 㤮                  
             11  訡 ଠ                       
             12  訡  㯠                  
             13  訡                         
             15  訡 ᪮                     
             16  ⪠ 㤠            
             17  H  ன⢮                      
             18  H  䠩                    
            




     ࣠樨 ࠡ,        
䠩 ⠫,  ਢ  ⠡ 1.2.

                                                  1.2
         Ŀ
          N  饭      祭            
              ()   ()                           
         Ĵ
         1      0        8     䠩                 
         Ĵ
         2      8        3    ७  䠩    
         Ĵ
         3      11       1     ਡ⮢ 䠩     
         Ĵ
         4      12       10   १ࢨ஢  DOS   
         Ĵ
         5      22       2    ६                     
         Ĵ
         6      24       2                          
         Ĵ
         7      26       2    ⮢    
         Ĵ
         8      28       4     䠩              
         

      㭪 ᮢ ஥ ( DIR),  㤥 ॠ-
   21- 뢠.  㭪樨 21- 뢠,    
㤥 ᯮ짮, ᬮ७  4 .

                         2. ࠡ⪠ ⬠

    ࠡ⠥   ࠧࠡ뢠 ணࠬ.   ண-
ࠬ 㤥 ।   ப.   㤥  ஢
 ப ᫥騬 ࠧ:
    1. ᫨  ப ,  뢮 ᪠;
    2. ᫨ 砥   /D -  뢮 ⥪騩 ४਩;
    3. ᫨ 砥   /M -  ନ㥬  짮⥫  
⮬,    㪠  ४,   ᮧ;
    4. ᫥ ⮣ 뢠   ࢮ ஡  ப PATH -
 㤥 ᪠ 䠩.
    5.  , ᬮਬ,  ᫨ ⮨ /D -  뢮 ४-
਩  ᪥, ᫨ ⮨ /M -  ᮧ ⠫  ᪥.
     奬 ⬠ ਢ  ਫ.

                      3. ࠡ⪠  

     ᮢ ஥ ⢮ ⢮ ६:

Ŀ
H  ঠ ६                                      
Ĵ
 HelpStr   ᪠                                            
 stringT    ᥣ   ᪥                               
 stringF    ᢮  ᪥                                   
 stringU  뢮 ᮤন ⠫                                 
 err_m1   訡  㭪樨!                                     
 err_m2     !                                            
 err_m3    㯠  !                                    
 err_m4    ᫨誮  䠩!                              
 ok_make  ⠫ ᮧ!                                         
 no_make  ⠫  ᮧ, ..   㪠  !          
           뢮 ᪠  ணࠬ  ࠬ஢.   
 str_f      㪠 !                                        
 str_k     㪠  !                                  
 totalKB  祩  ࠭ ꥬ ᪠                           
 freeKB   祩  ࠭ ࠧ ᢮                
 temp      ६                                         
 path     騩 ⠫ (  । - ⮩)               
 NewDTA   뢠  DTA                                    
 AttrF    ਡ 䠩                                              
 TimeF    ६ ᮧ 䠩                                       
 DateF     ᮧ 䠩                                        
 SizeF     䠩                                               
 NameF     䠩   ७                             


    楤, 室騥  ᮢ ஥:
Ŀ
 楤 뢠  뢮 ६ ᮧ 䠩/⠫           
 WrtTime                                                                 
Ĵ
 楤 뢠  뢮  ᮧ 䠩/⠫            
 WrtDate                                                                 
Ĵ
  ஡ ,  ஥ 뢠  䠩 (NameF)       
  室  ⮣, ⮡  뫮   䠩  뢮 
 ClrName                                                                 
Ĵ
 뢮  ⠫  ࠭                                           
 WrtDir                                                                  
Ĵ
 뢮  䠩  ࠭                                              
 WrtFile                                                                 
Ĵ
 뢮  ⥪饣 ᪠                                            
 WLabel                                                                  
Ĵ
 ந ॢ ப   ⪨                             
 crlf                                                                    
Ĵ
 뢮  ࠭ ⥪騩 ⠫                                        
 curdir                                                                  
Ĵ
 砥 ଠ  ᪥.  ᪠   ப ᪠         
 ᫥ 맮  AX - ⢮ ᥪ஢                        
               BX - ᫮ ᢮ ஢                           
               CX - ᫮ ⮢  ᥪ                              
               DX - ᫮ ஢  ᪥                            
 GetInfo                                                                 
                                                                         
Ĵ
 뢮 ࠧ ⥪饣 ᪠                                
 totsize                                                                 
Ĵ
 뢮 ࠧ ᢮ ࠭⢠                                  
 ⥪饣 ᪠                                               
 fresize                                                                 
Ĵ
 楤 뢮 ᫠  筮 ଠ                             
 Decimal                                                                 



                        4. ஢ ⬠

    襬 ࠧࠡ⠭      몥 ᥬ.
      ஡ 襬 ᭮ 뢠,  㤥 -
짮.
    ᭮ 뢠, ᯮ㥬  ணࠬ,   뢠-
 INT 21H (DOS Functions).  ᯮ㥬  㭪樨  ⮣  뢠
᫥騥:
 ࠬ     ᠭ

 室: AH    02H - 뢮  ᯫ
          DL    ᨬ  뫪  ⠭⭮ ன⢮
 室: 
 
 室: AH    09H - 뢮 ப  ᯫ
          DS:DX  ப, 稢  '$' (ASCII 24H)
 室: 
 
 室: AH    1aH - ⠭  DTA.
          DS:DX  DTA 
 室: 
 
 室:  AH    19H -  ଠ  ⥪饬 ᪥
 室: AL    DOS current default drive number (0=A, 1=B,  ..)
 
 室:  AH    36H -  ଠ  ᢮   ᪥
           DL    drive number (0=default, 1=A,  ..)
 室: AX    ffffH   ᫨ DL 뫮 invalid drive number
                     ⢮ ᥪ஢ ୮
           BX    ⢮ ᢮ ᥪ஢ (allocation units)
           CX      ᥪ (筮 512)
           DX    饥 ⢮ ᥪ஢  ᪥
 .ଠ: 室 ଠ 筮 뢠 
          騩 ࠧ ᪠  ⢮ ᢮   ᪥:

          ᫨ AX = ffffH,    ࠢ쭮 㪠 .

          ,  ᢮    = (AX * CX * BX)
                     騩 ࠧ    = (AX * CX * DX)

          ᫨ ᥪ  512 ,   뢠  :
                     ᢮     = (AX * BX) / 2
                     騩 ࠧ        = (AX * DX) / 2
 
 室: AH    3fH -  ⠫
          㭪 뢠  ࠭.
 
 室: AH    47H - ଠ  ⥪饬 ४ਨ
          DL    drive number (0=default, 1=A, etc.)
          DS:SI address of a local buffer to hold a pathname (64 bytes)
 室: AX    । 訡 ( 1.1)
 
 室: AH    4fH - H ᫥騩 ᮢ騩 䠩
          DS:DX    ।饣  4eH ᪠ 䠩
 
 室: AH    4eH - H  ᮢ騩 䠩
          DS:DX ப   䠩  ASCIIZ
          CX    ਡ 䠩  ᪠
 
 ஬ 21h 뢠  ᯮ짮 㭪 0eH 뢠 INT 10H:

     㭪 ᯥ稢 뢮 ᨬ    ०  -
⠩.  믮 ⮩ 㭪樨  AL  뢮 ᨬ, 
BL 梥 ⥪   ஭  BH. Hਬ, ᨬ: CR (0dH),  LF
(0aH), 㪮 ᨣ (07H)  ..   㭪 ⮬᪨ -
, ॢ ᨬ  ᫥ ப,  믮 ப -
  ࠭ ⥪騥 ਡ ࠭.
      ᯮ짮 뢠 INT 20H  室  DOS.   
 ࠬ஢.
     ⥪ ணࠬ ਢ  ਫ.


                   5. ஢  ⫠ ணࠬ

D:\ASM>kp.com  <>

KP v1.0, Copyright (c) 1997, , ᥭ ..

 ᪥  ࠬ஢ 뢮 
  ࠬ஬   :  kp :\⠫\᪠ [/D] [/M]
 ᪠ ( ᯮ짮 /D) -  ᨬ  ,  *  ?
          ( ᯮ짮 /M) -  ⠫.
/D - 뢮 ४  ᪥   /M - ᮧ ⠫  ᪥
ਬ:kp C:\LANG\BP\*.* /D - 뢮  䠩  ⠫  C:\LANG\BP
         kp C:\*  /D - 뢮 ⮫쪮 ⠫  ୥ ⠫ ᪠ C:
         kp C:\UTIL /M - ᮧ ⠫ UTIL  ୥ ᪠ :
         kp /D   - 뢮  䠩  ⠫  ⥪饬 
᫨  ᯮ /M,  㪠뢠  ⠫ 易⥫쭮!

D:\ASM>kp c:\cd\*.* /D  <>

뢮 ᮤন ⠫ c:\cd\*.*
⪠ ᪠ DIMKA 

.           <>   29/01/97   18:18:44
..          <>   29/01/97   18:18:44
read_me.txt      1834   19/11/96   17:58:40
rcdsim.com   6604   13/09/95   03:00:00
loadcd.exe   0352   13/09/95   03:00:00
rcdpc.sys        4231   13/09/95   03:00:00
run_me.bat     40   06/02/97   13:54:38

   307240  ᥣ   ᪥
   6160  ᢮  ᪥

D:\ASM>kp c:\cd\util /M  <>

c:\cd\util
⠫ ᮧ!

D:\ASM>kp c:\cd\*.* /D

뢮 ᮤন ⠫ c:\cd\*.*
⪠ ᪠ DIMKA 

.           <>   29/01/97   18:18:44
..          <>   29/01/97   18:18:44
UTIL        <>   10/04/97   19:57:48
read_me.txt      1834   19/11/96   17:58:40
rcdsim.com   6604   13/09/95   03:00:00
loadcd.exe   0352   13/09/95   03:00:00
rcdpc.sys        4231   13/09/95   03:00:00
run_me.bat     40   06/02/97   13:54:38

   307240  ᥣ   ᪥
   6152  ᢮  ᪥

D:\ASM>kp * /D   <>

뢮 ᮤন ⠫ *
⪠ ᪠ NPACD 

.         <>   19/02/97   19:20:34
..        <>   19/02/97   19:20:34
THELP6<>   07/04/97   22:08:48

   483552  ᥣ   ᪥
   8928  ᢮  ᪥

      ஢ 뫨 祭 ஡  뢮  ଠ-
樨  ࠡ  ⥬ WINDOWS95 (v4.0095).   ,    
室 ⥬ WINDOWS98 ஡  㤥.


                                祭

      믮 ᮢ ஥   ப 稫 -
樨 뢠 DOS  BIOS. H稫 ਬ   ࠪ⨪,   ⠪-
   ன ஥ ணࠬ,   ॠ饩  -
  .  H稫 짮 ࠢ筮   -
 ன.





                                

 1.  .   ⥬ ணࠬ஢

 2. 쥢 .H. 樮 ⥬ ,  誮, 1989

 3. ࠪ .  ᭮ ࣠樨    㭪樮஢  樮
⥬ 

 4. 类 .., ஢᪨ .. ⥬ ᯥ祭 ஝

 5. H⮭ .  ᮭ   IBM  樮 ⥬
MS-DOS

 6.  .. ⥫  ⥬ 㭪 MS-DOS

 7.  .  ᥬ  IBM PC  ணࠬ஢,  誮-
, 1992



                               ਫ

;----------------------------------------
;  ᮢ ஥  樯
; "⥬ ணࠬ ᯥ祭"
;  㤥 .410703 ᥭ ..
;          (c)1997 
;----------------------------------------
        .MODEL TINY
        .CODE
        ORG     100h
begin:  jmp     start

HelpStr db      13,10,'KP v1.0, Copyright (c) 1997, , ᥭ ..'
        db      13,10,13,10,' ᪥  ࠬ஢ 뢮 '
        db      13,10,'  ࠬ஬   :  kp :
\⠫\᪠ [/D] [/M]'
        db      13,10,' ᪠ ( ᯮ짮 /D) -  ᨬ 
 ,  *  ?'
        db      13,10,'          ( ᯮ짮 /M) - 
 ⠫.'
        db      13,10,'/D - 뢮 ४  ᪥
 /M - ᮧ ⠫  ᪥'
        db      13,10,'ਬ:kp C:\LANG\BP\*.* /D - 뢮  䠩
  ⠫  C:\LANG\BP'
        db      13,10,'         kp C:\*  /D - 뢮 ⮫쪮 ⠫ 
 ୥ ⠫ ᪠ C:'
        db      13,10,'         kp C:\UTIL /M - ᮧ ⠫ UTIL
 ୥ ⠫ ᪠ :'
        db      13,10,'         kp /D   - 뢮  䠩  ⠫ 
⥪饬 '
        db      13,10,'᫨  ᯮ /M,  㪠뢠 
 ⠫ 易⥫쭮!',13,10,'$'
stringT db      '  ᥣ   ᪥',13,10,'$'
stringF db      '  ᢮  ᪥',13,10,'$'
stringU db      13,10,'뢮 ᮤন ⠫ $'
err_m1  db      13,10,'訡  㭪樨! $'
err_m2  db      13,10,'  ! $'
err_m3  db      13,10,' 㯠  ! $'
err_m4  db      13,10,' ᫨誮  䠩! $'
ok_make db      13,10,'⠫ ᮧ! $'
no_make db      13,10,'⠫  ᮧ, ..   㪠  !'
        db      13,10,' 뢮 ᪠  ணࠬ 
ࠬ஢.',10,13,'$'
str_f   db      13,10,'  㪠 ! $'
str_k   db      13,10,' 㪠  ! $'
totalKB dd      0            ; 祩  ࠭ ꥬ ᪠
freeKB  dd      0            ; 祩  ࠭ ࠧ ᢮ 
space   db      '   $'       ; ப ࠧ
temp    dw      0            ;  ६

path    db      65 dup (0)   ; 騩 ⠫ (  । - ⮩)

NewDTA  db      21 dup (0)      ; 뢠  DTA
AttrF   db      0               ; ਡ 䠩
TimeF   dw      0               ; ६ ᮧ 䠩
DateF   dw      0               ;  ᮧ 䠩
SizeF   dd      0               ;  䠩
NameF   db      13 dup (0)      ;  䠩   ७

start:
        push    cs              ; ᨬ   ॣ ᥣ 
        pop     ds              ;
        push    cs              ;
        pop     es              ;

;஢塞 ப ࠬ஢

        mov     cl,ds:[80h]     ; ᫮ ᨬ ࠬ஢
        cmp     cl,0            ;  ࠢ- ᫮ ࠬ஢  ?
        je      help            ; ᫨ ࠬ஢ , 室
        cmp     cl,1            ; ᫨  ࠬ, ਬ 䠩 饭
        je      help            ;  Ctrl-Enter  NC,  ⮦ 室

        mov     al,ds:[82h]     ; ஢塞    ᪨
        cmp     al,'/'          ;   ?
        jne     not_help        ;  - 室
        mov     al,ds:[83h]     ;  - ᬮਬ 
        cmp     al,'M'          ; ᫨  /M
        je      not_m
        cmp     al,'D'          ; ᫨   /D
        je      noparam
        jmp     not_help
help:
        mov     ah,9            ; 뢮 ᪠
        lea     dx,HelpStr
        int     21h
        ret                     ; 室  DOS
not_m:
        mov     ah,9            ; ⠫  ᮧ ..  
        lea     dx,no_make      ; 㪠 
        int     21h
        ret                     ; 室  DOS
not_help:                       ; ᫨ ᪠ 
        mov     ch,0
        mov     di,81h          ;  ࢮ ᨬ ࠬ
        mov     al,' '          ; ஢ 㤥  ࢮ ஡
CheckParam:
        repe    scasb           ; ᪠ ᪠஢ ப
        jne     IsParam
IsParam:                        ; ᫨ ஡ 
        mov     si,di           ;  
        dec     si              ; 蠥  
        lea     di,path         ; ⠭  ப ࠬ஢
        inc     cl
MoveParam:
        lodsb                   ; 㦠  ᨬ ப ࠬ஢
        cmp     al,' '          ; ஢塞,  ࠢ   ஡
        je      EndMoveParam    ; ᫨ ࠢ,   ப
        stosb                   ;  뫠  ப ࠬ஢ - path
        loop    MoveParam       ;    ப

EndMoveParam:
        push    ax              ;࠭  直 砩
        lodsb                   ;㦠   ᨬ
        cmp     al,'/'          ;᫨  /
        je      okk
        mov     ah,9            ; 뢠  error
        lea     dx,str_F
        int     21h
        int     20h

okk:    lodsb                   ;㦠   ᨬ
        cmp     al,'D'          ;᫨  /D
        je      Dire            ;  DirE
        cmp     al,'M'          ;᫨  /M
        je      MakeE           ; ᪠ MakeE
        mov     ah,9            ; 뢠  error
        lea     dx,str_K
        int     21h
        int     20h

DirE:   pop     ax
        mov     al,0            ; 塞 ᨬ NUL  ப ࠬ஢
        mov     [di],al

        mov     ah,9            ; 㭪 뢮 ப
        lea     dx,stringU      ;  DX -  ப
        int     21h             ; 뢮 ப "騩 ⠫"

        mov     ah,40h          ; 뢮  ᪠
        mov     bx,01
        mov     cx,50
        lea     dx,path
        int     21h

        call    crlf            ; ॢ ப,  ⪨
        jmp     skip_curdir     ; 室 । ⥪饣 ⠫

NoParam:                        ; ᫨   ࠬ
        call    curdir          ; ।塞 ⥪騩 ⠫
skip_curdir:
        lea     dx,NewDTA       ; ⠭ 㪠⥫  ᢮  DTA
        mov     ah,1Ah
        int     21h

        call    WLabel          ; 뢮  ᪠

        mov     ah,4eh          ; 㭪 室  ⠫  ᪮ *.*
        mov     cx,10h          ;  CX - ਡ ⠫ - 10h
        lea     dx,path         ;  DX -   ᪠ ( । )
        int     21h
        jc      NowFiles        ; ᫨   ⠫ , 饬 䠩

        call    WrtDir          ; 뢮  ࢮ  ⠫
FindNextDir:
        mov     ah,4fh        ; 㭪 த ,  -樥 4eh
        int     21h
        jc      NowFiles        ; ᫨  ⠫ , 饬 䠩

        call    WrtDir          ; 뢮  ⠫
        jmp     FindNextDir     ; 室   ᫥饣

NowFiles:
        mov     ah,4eh          ; 㭪 室  䠩  ᪮ *.*
        mov     cx,27h          ;  CX - ਡ 䠩 - 27h (RO+Hid+Sys+Arc)
        lea     dx,path         ;  DX -   ᪠ 䠩
        int     21h
        jc      halt            ; ᫨ 䠩 ,   室

        call    WrtFile         ; ᫨ 䠩 , 뢮  

FindNextFile:
        mov     ah,4fh          ; 㭪 த  䠩
        int     21h
        jc      halt            ; ᫨  䠩 ,   室

        call    WrtFile         ; 뢮  䠩  ࠭
        jmp     FindNextFile    ; 室   ᫥饣 䠩

halt:   call    crlf            ; ॢ ப,  ⪨
        call    totsize         ; 뢮 ꥬ ᪠
        call    fresize         ; 뢮 ⠢襣 
        ret                     ; 室  DOS
;------------- ᮧ ⠫ ---------------------------------
MakeE:  pop ax                  ; ⠭ ax
        mov     al,0            ; 塞 ᨬ NUL  ப ࠬ஢
        mov     [di],al
        mov     ah,40h          ; 뢮  ᪠
        mov     bx,01
        mov     cx,50
        lea     dx,path
        int     21h
        mov     ah,39h          ; 㭪 ᮧ ⠫
        lea     dx,path
        int     21h             ; 믮
        cmp     ax,01h          ; ஢ઠ  訡 #1
        je      p_err1
        cmp     ax,02h          ; ஢ઠ  訡 #2
        je      p_err2
        cmp     ax,03h          ; ஢ઠ  訡 #3
        je      p_err3
        cmp     ax,04h          ; ஢ઠ  訡 #4
        je      p_err4
        mov     ah,9h           ; 訡 !
        lea     dx,ok_make      ; 뢮 ப - ⠫ ᮧ
        int     21h
        int     20h             ; 室  DOS
;-------- ࠡ⪠ 訡 --------------------------------
p_err1: mov     ah,9h
        lea     dx,err_m1
        int     21h
        int     20h
p_err2: mov     ah,9h
        lea     dx,err_m2
        int     21h
        int     20h
p_err3: mov     ah,9h
        lea     dx,err_m3
        int     21h
        int     20h
p_err4: mov     ah,9h
        lea     dx,err_m4
        int     21h
        int     20h             ; 室  DOS

;------------------------------------------------------------------------

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;:: 楤 뢠  뢮 ६ ᮧ 䠩/⠫ :::
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
WrtTime proc    near
        mov     ah,9
        lea     dx,space
        int     21h
        mov     ax,TimeF
        shr     ax,11
        call    DecWrt
        mov     ax,0e3ah
        int     10h
        mov     ax,TimeF
        shl     ax,5
        shr     ax,10
        call    DecWrt
        mov     ax,0e3ah
        int     10h
        mov     ax,TimeF
        shl     ax,11
        shr     ax,10
        call    DecWrt
        ret
WrtTime endp

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;::: 楤 뢠  뢮  ᮧ 䠩/⠫ :::
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
WrtDate proc    near
        mov     ah,9
        lea     dx,space
        int     21h
        mov     ax,DateF
        shl     ax,11
        shr     ax,11
        call    DecWrt
        mov     ax,0e2fh
        int     10h
        mov     ax,DateF
        shl     ax,7
        shr     ax,12
        call    DecWrt
        mov     ax,0e2fh
        int     10h
        mov     ax,DateF
        shr     ax,9
        add     ax,80
        call    DecWrt
        ret
WrtDate endp

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;  ஡ ,  ஥ 뢠  䠩 (NameF)       ::
;  室  ⮣, ⮡  뫮   䠩  뢮 ::
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ClrName proc    near
        lea     si,NameF        ; 砥   䠩
        mov     cx,1
rp:     cmp     cx,13           ; ᫨ CX=13,   ࠡ⠭ 
        je      vihod           ; ⮬ 室
        mov     al,0            ; ᨬ  ᨬ 0 (⮩ ᨬ)
        mov     [si],al         ; 뢠 ⮩ ᨬ  ப NameF
        inc     si              ; 稢  ப
        inc     cx              ; 稢 稪 ᠭ ᨬ
        jmp     rp              ; 塞 横
vihod:  ret
ClrName endp

;::::::::::::::::::::::::::::::::::::::
;::: 뢮  ⠫  ࠭ ::::
;::::::::::::::::::::::::::::::::::::::
WrtDir  proc    near
        cmp     AttrF,10h       ; ஢塞 ਡ: ᫨ 10h,  ⠫
        jne     exit1           ;   室

        mov     ah,40h          ; 㭪 뢮 ப
        mov     bx,01
        mov     cx,12           ; 뢮 13 ᨬ
        lea     dx,NameF        ;  DX -  ப 뢮
        int     21h

        mov     ah,9
        lea     dx,dirstr
        int     21h

        call    WrtDate
        call    WrtTime
        call    crlf            ; ॢ ப,  ⪨

exit1:  call    ClrName         ; ⨬  뢮
        ret
dirstr  db      '<>$'
WrtDir  endp


;:::::::::::::::::::::::::::::::::::::::
;::: 뢮  䠩  ࠭ ::::::::
;:::::::::::::::::::::::::::::::::::::::
WrtFile proc    near
        cmp     AttrF,10h     ; ஢塞 ਡ: ᫨  䠩,  室
        je      exit2
        lea     si,NameF      ; 㦠  ப  SI
        mov     cx,1
loop1:
        cmp     cx,13         ; ஢塞, ᫨ CX=13,  뢮 祭
        je      exit2         ; 室
        mov     al,[si]       ; ᨬ  AL 뢮 ᨬ
        cmp     al,65         ; ࠢ   'A'
        jl      skip1         ; ᫨ ,   ॢ   ॣ
        cmp     al,90         ; ࠢ AL  'Z'
        jg      skip1         ; ᫨ ,   ॢ   ॣ
        add     al,32         ; ॢ ᨬ   ॣ
skip1:
        mov     dl,al
        mov     ah,02           ; 㭪 뢮 ᨬ  ࠭
        int     21h
        inc     si              ; 稢 
        inc     cx              ; 稢 祭稪
        jmp     loop1           ; 室  ᫥騩 ᨬ
exit2:
        call    ClrName         ; ⨬  뢮

        mov     ax,word ptr SizeF
        mov     dx,word ptr SizeF+2
        call    Decimal

        call    WrtDate
        call    WrtTime
        call    crlf
        ret
WrtFile endp

;:::::::::::::::::::::::::::::::::::::::
;::: 뢮  ⥪饣 ᪠ ::::::
;:::::::::::::::::::::::::::::::::::::::
WLabel  proc    near
        call    ClrName         ; ⨬  뢮
        mov     ah,9            ; 㭪 뢮 ப  ࠭
        lea     dx,StringL      ;  DX -  ப
        int     21h

        lea     si,path4
        mov     ah,19h          ; 砥 ⥪騩 
        int     21h
        add     al,41h          ; ॢ   㪢
        mov     [si],al         ; ᨬ  ६ ப

        lea     si,path         ;  ᪠
        lea     di,path4        ; ६ ப
        mov     al,[si]         ; ६  ᨬ  ᪠
        cmp     al,65           ; 㪢 ᪠ 'A'?
        jl      not_xchg        ; ᫨ , 室
        cmp     al,122          ; 㪢 ᪠ 'z'?
        jg      not_xchg        ; ᫨ , 室
        cmp     al,91           ; ᫨ '[' - 室
        je      not_xchg
        cmp     al,92           ; ᫨ '\' - 室
        je      not_xchg
        cmp     al,93           ; ᫨ ']' - 室
        je      not_xchg
        cmp     al,94           ; ᫨ '^' - 室
        je      not_xchg
        cmp     al,95           ; ᫨ '_' - 室
        je      not_xchg
        cmp     al,96           ; ᫨ '`' - 室
        je      not_xchg

        mov     [di],al
not_xchg:
        mov     ah,4eh          ; 饬 䠩
        mov     cx,08h          ;  ਡ⮬ 08h, ..  ⮬
        lea     dx,path4        ;  DX -   ᪠
        int     21h

        mov     ah,40h          ; 㭪 뢮 ப  ࠭
        mov     bx,01
        mov     cx,13           ; 뢮 13 ᨬ
        lea     dx,NameF        ;  DX -  ப
        int     21h
        call    crlf            ; ॢ ப,  ⪨
        call    crlf            ; ॢ ப,  ⪨
        call    ClrName         ; ⨬  뢮
        ret
StringL db      '⪠ ᪠ $'
path4   db      'c:\*.*',0     ;  ᨬ 㤥   ⥪騩 
WLabel  endp

;::::::::::::::::::::::::::::::::::::::::::::::::::::::
;:::: ந ॢ ப   ⪨ :::::
;::::::::::::::::::::::::::::::::::::::::::::::::::::::
crlf    proc    near
        mov     ax,0e0dh        ; 㭪 뢮 ᨬ
        int     10h             ; 뢮 ᨬ 13  ࠭
        mov     ax,0e0ah        ; 㭪 뢮 ᨬ
        int     10h             ; 뢮 ᨬ 10  ࠭
        ret
crlf    endp

;::::::::::::::::::::::::::::::::::::::::::
;::: 뢮  ࠭ ⥪騩 ⠫ :::::
;::::::::::::::::::::::::::::::::::::::::::
curdir  proc    near
        mov     ah,9            ; 㭪 뢮 ப
        lea     dx,stringC      ;  DX -  ப
        int     21h             ; 뢮 ப "騩 ⠫"

        lea     si,path
        mov     ah,19h          ; 砥 ⥪騩 
        int     21h
        add     al,41h          ; ॢ   㪢
        mov     [si],al
        inc     si
        mov     al,58           ; 塞 ᨬ ':'
        mov     [si],al
        inc     si
        mov     al,92           ; 塞 ᨬ '\'
        mov     [si],al

        mov     ah,47h          ; 㭪 祭 ⥪饣 ⠫
        mov     dl,00
        lea     si,path+3       ; 塞   ⠫
        int     21h

        lea     si,path         ; ந ᨬ 뢮  
a10loop:
        cmp     byte ptr [si],0
        je      a20exit
        mov     al,[si]
        mov     dl,al
        mov     ah,02
        int     21h
        inc     si
        jmp     a10loop
a20exit:
; 塞  ⥪饬   *.*  ᪠ ⠫  䠩
        dec     si            ; 蠥   1  砥 ᫥
        mov     al,[si]       ; ᨬ,   NUL
        inc     si            ; 頥  SI
        cmp     al,92         ; ஢塞, ᫨ . ᨬ - ,  室
        je      skip_slash
        mov     al,92           ;  塞 ᨬ '\'
        mov     [si],al
        inc     si
skip_slash:
        mov     al,42           ; 塞 ᨬ '*'
        mov     [si],al
        inc     si
        mov     al,46           ; 塞 ᨬ '.'
        mov     [si],al
        inc     si
        mov     al,42           ; 塞 ᨬ '*'
        mov     [si],al
        inc     si
        mov     al,0            ; 塞 ᨬ NUL
        mov     [si],al
        call    crlf
        ret
stringC db      13,10,'騩 ⠫ $'
curdir  endp

Div1024 proc    near
        mov     cx,10
dd20:   shr     ax,1
        shr     dx,1
        jnc     dd30
        or      ah,10000000b
dd30:   loop    dd20
        ret
Div1024 endp

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;:: 砥 ଠ  ᪥.  ᪠   ப ᪠ :::
;:: ᫥ 맮  AX - ⢮ ᥪ஢                :::
;::               BX - ᫮ ᢮ ஢                   :::
;::               CX - ᫮ ⮢  ᥪ                      :::
;::               DX - ᫮ ஢  ᪥                    :::
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
GetInfo proc    near
        mov     dl,0            ;  DL ᨬ 0, .. ⥪騩 
        lea     si,path         ; 砥 㪢 ᪠   ᪠
        mov     al,[si]
        sub     al,40h          ; ॢ   

        cmp     al,0        ;  ᪠ 0 ?
        jl      not_1       ; ᫨ , 室
        cmp     al,26       ;  ᪠ 26 ?
        jg      again       ; ᫨ ,    ஢  㪢
        jmp     mov_val     ; 室  ࠡ
again:
        sub     al,32       ; ᫨ 㪢 ᪠ 筠, 㬥蠥  ࠧ
        cmp     al,0        ;  ᪠ 0 ?
        jl      not_1       ; ᫨ , 室
        cmp     al,26       ;  ᪠ 26 ?
        jg      not_1       ; ᫨ , 室
mov_val:
        mov     dl,al       ; ᨬ  ᪠
not_1:
        mov     ah,36h      ; 㭪 祭 ଠ樨  ᪥
        int     21h
        ret
GetInfo endp

;::::::::::::::::::::::::::::::::::::::::::::::::::
;:: 뢮 ࠧ ⥪饣 ᪠   ::::
;::::::::::::::::::::::::::::::::::::::::::::::::::
totsize proc    near
        call    GetInfo
        mov     temp,dx         ;  ᫮ ஢

        mul     cx              ;  ᫮ ᥪ஢  ࠧ ᥪ
        mul     temp            ;    ⢮ ஢

        call    Div1024         ;   1024  砥 ࠧ  
        mov     word ptr totalKB,ax     ;  襥  襥 ᫮
        mov     word ptr totalKB+2,dx   ; 祭 १

        call    Decimal

        mov     ah,9
        lea     dx,stringT
        int     21h
        ret
totsize endp

;:::::::::::::::::::::::::::::::::::::::::::::::
;::: 뢮 ࠧ ᢮ ࠭⢠ ::::
;::: ⥪饣 ᪠              ::::
;:::::::::::::::::::::::::::::::::::::::::::::::
fresize proc    near
        call    GetInfo

        mul     cx
        mul     bx

        call    Div1024
        mov     word ptr freeKB,ax
        mov     word ptr freeKB+2,dx

        call    Decimal

        mov     ah,9
        lea     dx,stringF
        int     21h
        ret
fresize endp

DecWrt  proc    near
        lea     si,outst        ; 頥 ப
        mov     cl,0
        mov     [si],cl
        mov     [si+1],cl

        lea     si,outst
        mov     cl,48
        mov     [si],cl
        mov     cx,0010
        lea     si,outst+1
a20:    cmp     ax,0010
        jb      a30
        xor     dx,dx
        div     cx
        or      dl,30h
        mov     [si],dl
        dec     si
        jmp     a20
a30:    or      al,30h
        mov     [si],al

        mov     ah,40h          ; 뢮 ப
        mov     bx,01
        mov     cx,02
        lea     dx,outst
        int     21h

        ret
outst   db      '  '
DecWrt  endp

;:::::::::::::::::::::::::::::::::::::::::::::::::::
;:: 楤 뢮 ᫠  筮 ଠ ::::
;:::::::::::::::::::::::::::::::::::::::::::::::::::
Decimal proc C uses es di bx cx dx ds
        mov     bx,10
        push    cs
        pop     es
        push    ax              ; 塞 ᨢ DecString ⠬ 00
        xor     ax,ax           ;
        cld                     ;
        mov     cx,3            ;
        lea     di,DecStr       ;
        rep     stosw           ;
        pop     ax              ;
        lea     di,DecStr+5     ; DI  ᫥  ᨢ
        std

        div     bx
        push    ax
        mov     ax,dx
        or      al,30h          ; ८ࠧ㥬  ASCII-ᨬ.
        stosb
        pop     ax
c10:
        xor     cx,cx
c20:
        cmp     ax,bx           ;   AX, ⥫  BX.
        jb      c30             ; ⭮   CX.
        sub     ax,bx           ;  ⮤ ⠭
        inc     cx              ; (  ९)
        jmp     c20
c30:
        or      al,30h          ; ॢ  ASCII
        stosb                   ; ᨬ  DecString
        mov     ax,cx
        cmp     ax,bx
        jae     c10
        or      al,0
        jz      c50
        or      al,30h
        stosb
c50:
        mov     ah,9
        lea     dx,space
        int     21h

        mov     ah,9
        lea     dx,DecStr
        int     21h
        ret
DecStr  db      6 dup (0)
        db      '$'
Decimal endp

        end     begin
                                                                                                                                                                                                     
  B      F*.FRM                                        *.MAC                                                          <       