Language Assembler x86 (TASM Flavour)
(Demonstration of metaprogramming in TASM)
| Date: | 07/05/06 |
| Author: | Vladimir V. Kalashnikov |
| URL: | http://www.admin.ksue.edu.ua/ |
| Comments: | 2 |
| Info: | http://info.borland.com/borlandcpp/cppcomp/tasmfact.html |
| Score: |
;
; "99 Stanzas on how to drink beer ;-)" TASM v3.0 (x86 assembler)
;
.model tiny
.code
org 100h
start: call print
stanza macro howmany,what
db '&howmany','&what',13,10
display '&howmany&&what'
endm
bottles = 99
rept 99
stanza %bottles,< bottles of beer on the wall>
stanza %bottles,< bottles of beer>
stanza ,<take one down, pass it around>
bottles = bottles-1
stanza %bottles,< bottles of beer on the wall>
endm
stanza 0,< bottles of beer>
stanza ,<go to the store and buy some more>
db '$'
print: pop dx
mov ah,9
int 21h
ret
end start
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments