@@.inc 658 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ; vim:ft=fasm:
  2. ; taken from: https://github.com/tgrysztar/fasmg
  3. ; Extended implementation of anonymous labels.
  4. ; Classic use like:
  5. ; @@: ; A
  6. ; je @f ; -> B
  7. ; loop @b ; -> A
  8. ; @@: ; B
  9. ; Additional sets of labels are available for more flexibility:
  10. ; @1: ; A
  11. ; je @1f ; -> C
  12. ; jg @2f ; -> B
  13. ; loop @1b ; -> A
  14. ; @2: ; B
  15. ; loop @2b ; -> B
  16. ; @1: ; C
  17. macro @INIT name,prefix
  18. macro name tail&
  19. match label, prefix#f?
  20. label tail
  21. prefix#b? equ prefix#f?
  22. prefix#r? equ prefix#f?
  23. end match
  24. local anonymous
  25. prefix#f? equ anonymous
  26. end macro
  27. define prefix#f?
  28. name
  29. end macro
  30. @INIT @@,@
  31. repeat 10, i:0
  32. @INIT @#i,@#i
  33. end repeat