You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.8 KiB

7 months ago
  1. <!doctype html>
  2. <title>CodeMirror: Gas mode</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="gas.js"></script>
  8. <style>.CodeMirror {border: 2px inset #dee;}</style>
  9. <div id=nav>
  10. <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
  11. <ul>
  12. <li><a href="../../index.html">Home</a>
  13. <li><a href="../../doc/manual.html">Manual</a>
  14. <li><a href="https://github.com/codemirror/codemirror5">Code</a>
  15. </ul>
  16. <ul>
  17. <li><a href="../index.html">Language modes</a>
  18. <li><a class=active href="#">Gas</a>
  19. </ul>
  20. </div>
  21. <article>
  22. <h2>Gas mode</h2>
  23. <form>
  24. <textarea id="code" name="code">
  25. .syntax unified
  26. .global main
  27. /*
  28. * A
  29. * multi-line
  30. * comment.
  31. */
  32. @ A single line comment.
  33. main:
  34. push {sp, lr}
  35. ldr r0, =message
  36. bl puts
  37. mov r0, #0
  38. pop {sp, pc}
  39. message:
  40. .asciz "Hello world!<br />"
  41. </textarea>
  42. </form>
  43. <script>
  44. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  45. lineNumbers: true,
  46. mode: {name: "gas", architecture: "ARMv6"},
  47. });
  48. </script>
  49. <p>Handles AT&amp;T assembler syntax (more specifically this handles
  50. the GNU Assembler (gas) syntax.)
  51. It takes a single optional configuration parameter:
  52. <code>architecture</code>, which can be one of <code>"ARM"</code>,
  53. <code>"ARMv6"</code> or <code>"x86"</code>.
  54. Including the parameter adds syntax for the registers and special
  55. directives for the supplied architecture.
  56. <p><strong>MIME types defined:</strong> <code>text/x-gas</code></p>
  57. </article>