home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / ASM / GRDBDL17.ZIP / FILL.ASM < prev    next >
Encoding:
Assembly Source File  |  1998-10-26  |  911 b   |  69 lines

  1. ;
  2. ; GRDP
  3. ;
  4. ; Copyright(c) LADsoft
  5. ;
  6. ; David Lindauer, camille@bluegrass.net
  7. ;
  8. ;
  9. ; FILL.ASM
  10. ;
  11. ; Function: Fill memory
  12. ;
  13.     ;MASM MODE
  14.     .MODEL SMALL
  15.     .386
  16.  
  17.  
  18. include  eprints.inc 
  19. include  einput.inc 
  20. include  emtrap.inc 
  21. include  eoptions.inc
  22.  
  23.     PUBLIC fill
  24.  
  25.  
  26.     .CODE
  27. ;
  28. ; fill command
  29. ;
  30. fill    PROC
  31.     call    WadeSpace
  32.     jz    errx
  33.     call    ReadAddress        ; read start address
  34.     jc    errx
  35.     call    defDS            ; Get DS
  36.     call    WadeSpace
  37.     jz    errx
  38.     call    ReadNumber            ; read length
  39.     jc    errx
  40.     mov    ecx,eax
  41.     sub    ecx,ebx
  42.     jc    errx
  43.     call    WadeSpace
  44.     mov    al,0                   ; default fill = 0
  45.     jz    gotfill
  46.     call    ReadNumber        ; else read a fill val
  47.     jc    errx
  48.     push    ax
  49.     call    WadeSpace
  50.     pop    ax
  51.     jnz    errx
  52.     test    [optdwordcommand],1
  53.     jnz    gotfill
  54.     movzx    ebx,bx
  55.     movzx    ecx,cx
  56. gotfill:
  57.     push    es            ; fill mem
  58.     mov    es,dx
  59.     mov    edi,ebx
  60.     db    67h
  61.     rep    stosb
  62.     pop    es
  63.     clc
  64.     ret
  65. errx:
  66.     stc
  67.     ret
  68. fill    endp
  69. end