home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / DISKMAGS / IMPHOB_9.ZIP / IMP9_EX!.ZIP / UNR_TWST.ZIP / INC.INC < prev    next >
Encoding:
Text File  |  1994-12-30  |  3.1 KB  |  190 lines

  1. ;══════════════════════════════════════════════════════════════════════════════
  2.  
  3. ULoop MACRO what, where
  4.         dec what
  5.         jnz where
  6. ENDM
  7.  
  8. IFF     MACRO   s,ofs,ss
  9.     mov    ax,s
  10.     mov    ds,ax
  11.     mov    si,offset ofs
  12.     mov    ax,ss
  13.     mov    es,ax
  14.     call    Show2Sc
  15.     ENDM
  16. RAMK PROC
  17.     pusha
  18.     mov    dx,03dah
  19. C:    in    al,dx
  20.     test    al,8
  21.     jz    c
  22. C1:    in    al,dx
  23.     test    al,8
  24.     jnz    c1
  25.     popa
  26.     ret
  27. RAMK ENDP
  28. SetMode MACRO scrmode
  29.     mov    ax,scrmode
  30.     int    10h
  31.     ENDM
  32.  
  33. Wait4Key:
  34.     in    al,60h
  35.     cmp    al,1
  36.     jne    Wait4Key
  37.     ret
  38.  
  39. IfESC MACRO XCV
  40.         in  al,60h
  41.         cmp al,1
  42.         je  XCV
  43. ENDM
  44.  
  45. WaitESC MACRO XYZ
  46.  
  47.         in  al,60h
  48.         cmp al,1
  49.         jne XYZ
  50. ENDM
  51.  
  52.  
  53. Quit    MACRO errorcode
  54.     mov    ah,4ch
  55.     mov    al,errorcode
  56.     int    21h
  57.     ENDM
  58.  
  59. SetPal MACRO wherefrom, whereform
  60.     mov    dx,3c8h
  61.     mov    al,0
  62.     out    dx,al
  63.     inc    dx
  64.     mov    ax,wherefrom
  65.     mov    ds,ax
  66.     mov    si,offset whereform
  67.     mov    cx,300h
  68.     rep    outsb
  69.     endm
  70.  
  71. OpenF    MACRO    SEGGY, wh_param, wh_handle
  72.     mov    ah,3dh            ; Open file
  73.     mov    dx,SEGGY
  74.     mov    ds,dx
  75.     mov    dx,offset wh_param    ; Adress to ASCIIZ filename
  76.     mov    al,0            ; Read
  77.     int    21h
  78.     mov    wh_handle,ax        ; handle
  79.     endm
  80.  
  81. ChLenF  MACRO wh_handle, lengthf    ;check length of a file
  82.     mov    bx,wh_handle
  83.     mov    ax,4202h        ; Set to end of file
  84.     mov    cx,0            ; We do it to know the length
  85.     mov    dx,0            ; of a file.
  86.     int    21h
  87.     mov    cx,ax            ; Length of file in cx
  88.     push    cx            ; store for usage
  89.     mov    bx,wh_handle        ; Set counter back to position 0
  90.     mov    ax,4200h
  91.     mov    cx,0
  92.     mov    dx,0
  93.     int    21h
  94.     pop    cx
  95.     mov    lengthf,cx
  96.     endm
  97.  
  98. REadF    MACRO    HowMany, ReadWhS, ReadWhO, Handlerek
  99.     mov    cx, HowMany
  100.     mov    ax,seg ReadWhS        ; segment whereto
  101.     mov    ds,ax
  102.     mov    dx,offset ReadWhO    ; offset whereto
  103.     mov    ah,3fh
  104.     mov    bx,handlerek        ; handle
  105.     int    21h            ; Read cx bytes
  106.     endm
  107.  
  108. WriteF    MACRO    WhereRS, WhereRO, hand00, savesize
  109.     mov    bx,hand00        ; Restore handle
  110.     mov    ax,WhereRS
  111.     mov    ds,ax
  112.     mov    dx,offset Wherero
  113.     mov    cx,savesize
  114.     mov    ah,40h            ; Write 768 bytes of palette
  115.     int    21h
  116.     endm
  117.  
  118. CreateF MACRO    CrWhS, CrWhO, handle0
  119.         mov     ah,3ch
  120.     mov    cx,0
  121.     mov    dx,CrWhS
  122.     mov    ds,dx
  123.     mov    dx,offset CrWhO
  124.     int    21h
  125.     mov    handle0,ax        ; Store handle
  126.     endm
  127.  
  128. CloseF    MACRO    handle1
  129.     mov    ah,3eh            ; Close file
  130.     mov    bx,handle1
  131.     int    21h
  132.     endm
  133.  
  134. COPYDD    MACRO    ASEG, AOFS, BSEG, BOFS, SIZE_DOUBLE
  135.     mov    ax,ASEG
  136.     mov    ds,ax
  137.     mov    si,offset AOFS
  138.     mov    ax,BSEG
  139.     mov    es,ax
  140.     mov    di,offset BOFS
  141.     mov    cx,SIZE_DOUBLE
  142.     rep    movsd
  143.     endm
  144.  
  145. FILLDD    MACRO    AxSEG, AxOFS, SIZE_DOUBLE, WHAT
  146.     mov    ax,AxSEG
  147.     mov    es,ax
  148.     mov    di,offset AxOFS
  149.     mov    eax,WHAT
  150.     mov    cx,SIZE_DOUBLE
  151.     rep    stosd
  152.     endm
  153.  
  154. BlankPal MACRO    ZeroCol, HowMany
  155. LOCAL Locke
  156.     mov    dx,3c8h
  157.     mov    al,ZeroCol
  158.     out    dx,al
  159.     inc    dx
  160.     mov    cx,howmany
  161.  
  162. Locke:    mov    al,0
  163.     out    dx,al
  164.     out    dx,al
  165.     out    dx,al
  166.     loop    Locke
  167.     endm
  168.  
  169. SetBlock MACRO  setsize
  170.         mov     ah,4ah
  171.         mov     bx,setsize
  172.         int     21h
  173. ENDM
  174.  
  175. Alloc MACRO amount, where
  176.         mov     ah,48h
  177.         mov     bx,amount
  178.         int     21h
  179.         mov     where,ax
  180. ENDM
  181.  
  182. Free MACRO  segm
  183.         mov     ah,49h
  184.         mov     bx,segm
  185.         mov     es,bx
  186.         int     21h
  187. ENDM
  188.  
  189. ;══════════════════════════════════════════════════════════════════════════════
  190.