label.pl 313 B

12345678910111213141516171819
  1. #!/usr/bin/perl
  2. #
  3. # Generate a test case for label lookup performance
  4. #
  5. ($len) = @ARGV;
  6. $len = 100000 unless ($len);
  7. print "\tbits 32\n";
  8. print "\tsection .data\n";
  9. print "\n";
  10. for ($i = 0; $i < $len; $i++) {
  11. print "l$i:\n";
  12. for ($j = 0; $j < 8; $j++) {
  13. print "\tdd l", int(rand($i+1)), "\n";
  14. }
  15. }