home *** CD-ROM | disk | FTP | other *** search
/ MS DOS Archives 1 / MS-DOS_Archives_Volume_One_Walnut_Creek.iso / msdos / graphics / grafxlib.arc / GRAFLIB.ASM < prev    next >
Assembly Source File  |  1987-08-31  |  1KB  |  94 lines

  1. ;
  2. ; grafix --- graflib.asm
  3. ;
  4. ; miscellaneous assembly routines
  5. ;
  6. ; Written 4/87 by Scott Snyder (ssnyder@romeo.caltech.edu or @citromeo.bitnet)
  7. ;
  8. ; Modified 5/29/87 by sss to allow for different memory models
  9. ;
  10.  
  11.     title    graflib
  12.  
  13. include    macros.ah
  14.  
  15. buflen equ 32768
  16.  
  17. sseg
  18. endss
  19.  
  20. dseg
  21. endds
  22.  
  23. buf    segment public 'BUF'
  24.     db buflen dup(?)
  25. buf    ends
  26.  
  27.     df    g_fmemcpy
  28.     df    g_fmemset
  29.     df    g_bufseg
  30.  
  31. cseg    _graflib
  32.  
  33. pBegin    g_bufseg
  34.  
  35.     mov    ax, buf
  36.     ret
  37.  
  38. pEnd    g_bufseg
  39.  
  40. pBegin    g_fmemcpy 
  41.  
  42.     push    bp
  43.     mov    bp,sp
  44.     push    di
  45.     push    si
  46.     push    ds
  47.  
  48.     cld 
  49.     les    di,[bp+argbase]
  50.     lds    si,[bp+argbase+4]
  51.     mov    cx,[bp+argbase+8]
  52.     shr    cx, 1
  53.     jnc    c1
  54.     movsb
  55. c1:    rep    movsw
  56.   
  57.     pop    ds
  58.     pop    si
  59.     pop    di
  60.     mov    sp,bp
  61.     pop    bp
  62.     ret
  63.  
  64. pEnd    g_fmemcpy
  65.  
  66. pBegin    g_fmemset
  67.  
  68.     push    bp
  69.     mov    bp,sp
  70.     push    di
  71.     push    si
  72.  
  73.     cld 
  74.     les    di,[bp+argbase]
  75.     mov    al,[bp+argbase+4]
  76.     mov    ah,al
  77.     mov    cx,[bp+argbase+6]
  78.     shr    cx,1
  79.     jnc    s1
  80.     stosb
  81. s1:    rep    stosw
  82.   
  83.     pop    si
  84.     pop    di
  85.     mov    sp,bp
  86.     pop    bp
  87.     ret
  88.  
  89. pEnd    g_fmemset
  90.  
  91. endcs    _graflib 
  92.  
  93.     end
  94.