برنامه نویسی

DSEG    SEGMENT 'DATA'
      ; add your data here!
      file  db  'c:\test.dat',00h
      n dw  ?
      p dw 20 dup (?)
      max   dw  ?
      str db  'ok','$'
      a db  ?
      b db   ?
      c db  ?
     
DSEG    ENDS

SSEG    SEGMENT STACK   'STACK'
      db   256  DUP(0)
SSEG    ENDS

CSEG    SEGMENT 'CODE'
   START   PROC    FAR
      ; set segment registers:
      MOV AX, DSEG
      MOV DS, AX
      MOV ES, AX
     
      mov   ah,6h
      mov   al,25
      mov   ch,0
      mov   cl,0
      mov   dh,24
      mov   dl,79
      mov   bh,1fh
      int   10h
       mov  a,0
       mov  b,0
      ; add your code here
      ;######################################## max record ##########################
      ;call  open
      ;call  read
      ;mov   max,0
      ;mov  bx,0
      ;lea   di,file
      ;pj:mov   dl,[di]
      ;cmp   dl,24h
      ;je    e
      ;add   max,1
      ;pj2:
      ;inc   di
      ;jmp   pj
      ; e:
      ;############################################################################
      call  open
      call  read
      mov   max,0
      mov   n,0
      lea   di,file
      ff:mov   dl,[di]
      cmp   dl,24h
      je    exit
      cmp   dl,20h
      je    f
            add   a,10
             ; mov  ah,02h
             ; mov  bh,0
             ; mov  dh,0
             ; mov  dl,a
             ; int  10h
            mov dl,[di]
            cmp dl,'a'
            jne fs;agar #a# nabob boro be check #s#
            fa:
            ;call tabe chap karakter #a# farakhani
            call    testa
            ; boro be f
            fs:
            mov   dl,[di]
            cmp  dl,'s'
            jne  fnot;agar s nabod karakter ba rang mamoli chap kon
            ;call tabechap #s# ra farakhani
            call    tests
            ; boro be f
            fnot:
            ; agar na #a# na #s# ba rang mamolo chap con
           mov  ah,02h
   mov  bh,0
   mov  dh,0
   mov  dl,a
   int  10h
   mov  al,[di]
   cmp  al,20h
   je f
   mov  ah,09h
   mov  bl,7
   mov  cx,1
   int 10h
   inc  di
   add a,1
    jmp fnot
  
          
      f:inc di
     
   
 
      ;makan nama ra peyda mikonim
      ;meghdar ra ba 10 jam mikonim
      jmp   ff
      exit:
      mov   ah,1h
      int   21h
      MOV AX, 4C00h ; exit to operating system.
      INT 21h   
   START   ENDP

+ نوشته شده در  سه شنبه بیست و ششم خرداد ۱۳۸۸ساعت 22:8  توسط ابراری |