home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 September
/
Chip_2002-09_cd1.bin
/
ctenari
/
Veber
/
src
/
macros.asm
< prev
next >
Wrap
Assembly Source File
|
2002-07-08
|
2KB
|
77 lines
; Universal macros for programming (Game Sputnik)
; Copyright (C) 2001 Jaromφr Veber
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
;###############################################################################
;;macros for Work with Display
; SI - string to print
%imacro writestr 1
invoke WriteStr_proc,word %1
%endm
;first = Xlocation; second = Ylocation; ;third sizeX
;fourth = Colour;
%imacro linex 4
invoke New_lineX,word %1,word %2,word %3,word %4
%endm
;first = Xlocation; second = Ylocation; ;third sizeY
;fourth = Colour;
%imacro liney 4
invoke lineY_proc,word %1,word %2,word %3,word %4
%endm
;first = Xlocation; second = Ylocation; ;third sizeX ;fourth = sizeY
;fifth = Colour;
%imacro rectangle 5
invoke New_Rectangle,word %1,word %2,word %3,word %4,word %5
%endm
%imacro clear_display 0
mov AX,MODE
int 10H
%endm
;###############################################################################
;;macros for work with Keyboard
%imacro Wait_char 0
xor AX,AX
int 16H
%endm
;###############################################################################
;;Debug macros
%imacro writeAL 0
call WriteAL_proc
%endm
%imacro writeAX 0
call Write_AX_proc
%endm
;###############################################################################
;procedure macros
%imacro invoke 1-*
%rep %0 - 1
%rotate 1
push %1
%endrep
%rotate 1
call %1
add sp,(%0-1) * 2
%endmacro