Warning: file_get_contents(/home/www/coppershade.org/articles/Assembler/Macros.txt) [function.file-get-contents]: failed to open stream: No such file or directory in /home/www/coppershade.org/index.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home/www/coppershade.org/index.php:33) in /home/www/coppershade.org/index.php on line 105

Warning: Cannot modify header information - headers already sent by (output started at /home/www/coppershade.org/index.php:33) in /home/www/coppershade.org/index.php on line 106
Macros | Coppershade

Macros

Macros are a very powerful way to extend Assembly instructions. In a good Assembler, macros even allow you to write your own high-level language!

Advantages:

  • Runs at full processor speed, without layers, interpreters, or libraries
  • Can be used as plain inline code, or as a command generating just a call to a function you define
  • If used as inline code, it can be used for code folding
  • Allows optional parameters (also available in most but not all high-level languages)
  • Allows the dynamic generation of large sections of code or data tables, using mathematical formulas

This section will contain examples and tutorials on how to use macros to best effect.
How about this assembler program? :)
CLEARSCREEN 320,256
DRAWLINE 50,50,100,100
DRAWLINE 100,100,60,110
DRAWLINE 60,110,50,50
FILLRECT 50,50,100,110
SWAPBUFFER