home *** CD-ROM | disk | FTP | other *** search
- ;══════════════════════════════════════════════════════════════════════════════
-
- ULoop MACRO what, where
- dec what
- jnz where
- ENDM
-
- IFF MACRO s,ofs,ss
- mov ax,s
- mov ds,ax
- mov si,offset ofs
- mov ax,ss
- mov es,ax
- call Show2Sc
- ENDM
- RAMK PROC
- pusha
- mov dx,03dah
- C: in al,dx
- test al,8
- jz c
- C1: in al,dx
- test al,8
- jnz c1
- popa
- ret
- RAMK ENDP
- SetMode MACRO scrmode
- mov ax,scrmode
- int 10h
- ENDM
-
- Wait4Key:
- in al,60h
- cmp al,1
- jne Wait4Key
- ret
-
- IfESC MACRO XCV
- in al,60h
- cmp al,1
- je XCV
- ENDM
-
- WaitESC MACRO XYZ
-
- in al,60h
- cmp al,1
- jne XYZ
- ENDM
-
-
- Quit MACRO errorcode
- mov ah,4ch
- mov al,errorcode
- int 21h
- ENDM
-
- SetPal MACRO wherefrom, whereform
- mov dx,3c8h
- mov al,0
- out dx,al
- inc dx
- mov ax,wherefrom
- mov ds,ax
- mov si,offset whereform
- mov cx,300h
- rep outsb
- endm
-
- OpenF MACRO SEGGY, wh_param, wh_handle
- mov ah,3dh ; Open file
- mov dx,SEGGY
- mov ds,dx
- mov dx,offset wh_param ; Adress to ASCIIZ filename
- mov al,0 ; Read
- int 21h
- mov wh_handle,ax ; handle
- endm
-
- ChLenF MACRO wh_handle, lengthf ;check length of a file
- mov bx,wh_handle
- mov ax,4202h ; Set to end of file
- mov cx,0 ; We do it to know the length
- mov dx,0 ; of a file.
- int 21h
- mov cx,ax ; Length of file in cx
- push cx ; store for usage
- mov bx,wh_handle ; Set counter back to position 0
- mov ax,4200h
- mov cx,0
- mov dx,0
- int 21h
- pop cx
- mov lengthf,cx
- endm
-
- REadF MACRO HowMany, ReadWhS, ReadWhO, Handlerek
- mov cx, HowMany
- mov ax,seg ReadWhS ; segment whereto
- mov ds,ax
- mov dx,offset ReadWhO ; offset whereto
- mov ah,3fh
- mov bx,handlerek ; handle
- int 21h ; Read cx bytes
- endm
-
- WriteF MACRO WhereRS, WhereRO, hand00, savesize
- mov bx,hand00 ; Restore handle
- mov ax,WhereRS
- mov ds,ax
- mov dx,offset Wherero
- mov cx,savesize
- mov ah,40h ; Write 768 bytes of palette
- int 21h
- endm
-
- CreateF MACRO CrWhS, CrWhO, handle0
- mov ah,3ch
- mov cx,0
- mov dx,CrWhS
- mov ds,dx
- mov dx,offset CrWhO
- int 21h
- mov handle0,ax ; Store handle
- endm
-
- CloseF MACRO handle1
- mov ah,3eh ; Close file
- mov bx,handle1
- int 21h
- endm
-
- COPYDD MACRO ASEG, AOFS, BSEG, BOFS, SIZE_DOUBLE
- mov ax,ASEG
- mov ds,ax
- mov si,offset AOFS
- mov ax,BSEG
- mov es,ax
- mov di,offset BOFS
- mov cx,SIZE_DOUBLE
- rep movsd
- endm
-
- FILLDD MACRO AxSEG, AxOFS, SIZE_DOUBLE, WHAT
- mov ax,AxSEG
- mov es,ax
- mov di,offset AxOFS
- mov eax,WHAT
- mov cx,SIZE_DOUBLE
- rep stosd
- endm
-
- BlankPal MACRO ZeroCol, HowMany
- LOCAL Locke
- mov dx,3c8h
- mov al,ZeroCol
- out dx,al
- inc dx
- mov cx,howmany
-
- Locke: mov al,0
- out dx,al
- out dx,al
- out dx,al
- loop Locke
- endm
-
- SetBlock MACRO setsize
- mov ah,4ah
- mov bx,setsize
- int 21h
- ENDM
-
- Alloc MACRO amount, where
- mov ah,48h
- mov bx,amount
- int 21h
- mov where,ax
- ENDM
-
- Free MACRO segm
- mov ah,49h
- mov bx,segm
- mov es,bx
- int 21h
- ENDM
-
- ;══════════════════════════════════════════════════════════════════════════════
-