ads2armasm_ms.pl 917 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env perl
  2. ##
  3. ## Copyright (c) 2013 The WebM project authors. All Rights Reserved.
  4. ##
  5. ## Use of this source code is governed by a BSD-style license
  6. ## that can be found in the LICENSE file in the root of the source
  7. ## tree. An additional intellectual property rights grant can be found
  8. ## in the file PATENTS. All contributing project authors may
  9. ## be found in the AUTHORS file in the root of the source tree.
  10. ##
  11. use FindBin;
  12. use lib $FindBin::Bin;
  13. use thumb;
  14. print "; This file was created from a .asm file\n";
  15. print "; using the ads2armasm_ms.pl script.\n";
  16. while (<STDIN>)
  17. {
  18. undef $comment;
  19. undef $line;
  20. s/REQUIRE8//;
  21. s/PRESERVE8//;
  22. s/^\s*ARM\s*$//;
  23. s/AREA\s+\|\|(.*)\|\|/AREA |$1|/;
  24. s/qsubaddx/qsax/i;
  25. s/qaddsubx/qasx/i;
  26. thumb::FixThumbInstructions($_, 1);
  27. s/ldrneb/ldrbne/i;
  28. s/ldrneh/ldrhne/i;
  29. s/^(\s*)ENDP.*/$&\n$1ALIGN 4/;
  30. print;
  31. }