home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / tools / pcmac / loop.asm < prev    next >
Assembly Source File  |  1991-05-22  |  827b  |  41 lines

  1. ;LOOP.ASM
  2. ;Demo program for looping directives
  3.  
  4. ;This file contains two macro definitions
  5. ;for the same purpose. The first version (DEFS)
  6. ;works when the argument is 0. The second one
  7. ;works only for argument greater then zero.
  8. ;This program can not be compiled because
  9. ;the last macro tries to generate 100000000 bytes.
  10. ;I don't think you can wait until it finishes.
  11. ;If you start the compilation of this program
  12. ;do use the option -l and when you are tired 
  13. ;looking the zeroes press CTRL+BREAK!
  14.  
  15. macro("DEFS *",NUMERIC)
  16. #ifndef defs
  17.     var defs
  18. #endif
  19. defs := #0
  20. #while defs>0
  21.     DB 0
  22.     defs := defs - 1
  23. #wend
  24. endm
  25.  
  26. macro("SKIP *",NUMERIC)
  27. #ifndef skip
  28.     var skip
  29. #endif
  30. skip := #0
  31. #repeat
  32.     DB 0
  33.     skip := skip - 1
  34. #until skip=0
  35. endm
  36.     DEFS    10
  37.     SKIP    10
  38.     DEFS    0
  39.     SKIP    0
  40. ;End of file LOOP.ASM
  41.