home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / ctenari / Veber / src / macros.asm < prev    next >
Assembly Source File  |  2002-07-08  |  2KB  |  77 lines

  1. ; Universal macros for programming (Game Sputnik)
  2. ; Copyright (C) 2001 Jaromφr Veber
  3. ;
  4. ; This program is free software; you can redistribute it and/or modify
  5. ; it under the terms of the GNU General Public License as published by
  6. ; the Free Software Foundation; either version 2 of the License, or
  7. ; (at your option) any later version.
  8. ;
  9. ; This program is distributed in the hope that it will be useful,
  10. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ; GNU General Public License for more details.
  13. ;
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ;
  18. ;###############################################################################
  19. ;;macros for Work with Display
  20.  
  21. ; SI - string to print
  22. %imacro writestr 1     
  23.             invoke WriteStr_proc,word %1
  24. %endm
  25.  
  26. ;first = Xlocation;  second = Ylocation; ;third sizeX
  27. ;fourth = Colour;
  28. %imacro linex 4
  29.   invoke New_lineX,word %1,word %2,word %3,word %4
  30. %endm
  31.  
  32. ;first = Xlocation;  second = Ylocation; ;third sizeY
  33. ;fourth = Colour;
  34. %imacro liney 4
  35.     invoke lineY_proc,word %1,word %2,word %3,word %4
  36. %endm
  37.  
  38. ;first = Xlocation;  second = Ylocation; ;third sizeX ;fourth = sizeY
  39. ;fifth = Colour;
  40. %imacro rectangle 5
  41.   invoke New_Rectangle,word %1,word %2,word %3,word %4,word %5
  42.  
  43. %endm
  44.  
  45. %imacro clear_display 0
  46.   mov AX,MODE
  47.   int 10H
  48. %endm
  49. ;###############################################################################
  50. ;;macros for work with Keyboard
  51. %imacro Wait_char 0
  52.   xor AX,AX
  53.   int 16H
  54. %endm
  55. ;###############################################################################
  56. ;;Debug macros
  57. %imacro writeAL 0
  58.         call WriteAL_proc
  59. %endm
  60.  
  61. %imacro writeAX 0
  62.     call Write_AX_proc
  63. %endm
  64.  
  65. ;###############################################################################
  66. ;procedure macros
  67. %imacro invoke 1-*
  68.  
  69. %rep %0 - 1
  70. %rotate 1
  71.         push %1
  72. %endrep
  73.  
  74. %rotate 1
  75.         call %1
  76.         add sp,(%0-1) * 2
  77. %endmacro