summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-09-03 23:44:31 +0200
committerAraq <rumpf_a@web.de>2013-09-03 23:44:31 +0200
commit891f871ba71b0b6e136fea13e5be0bd3e0860fea (patch)
tree27397b95f2c50ef77677f8d8171effc82e817416 /doc
parent39da6979add895cf58e9c6f883ef8df465975cd6 (diff)
downloadNim-891f871ba71b0b6e136fea13e5be0bd3e0860fea.tar.gz
better support for GNU's assembler
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/manual.txt b/doc/manual.txt
index 0a2009961..bc4e13e8e 100644
--- a/doc/manual.txt
+++ b/doc/manual.txt
@@ -2166,6 +2166,33 @@ specified in the statement's pragmas. The default special character is ``'`'``:
       theEnd:
     """
 
+If the GNU assembler is used, quotes and newlines are inserted automatically:
+
+.. code-block:: nimrod
+  proc addInt(a, b: int): int =
+    asm """
+      addl %%ecx, %%eax
+      jno 1
+      call `raiseOverflow`
+      1:
+      :"=a"(`result`)
+      :"a"(`a`), "c"(`b`)
+    """
+
+Instead of:
+
+.. code-block:: nimrod
+  proc addInt(a, b: int): int =
+    asm """
+      "addl %%ecx, %%eax\n"
+      "jno 1\n"
+      "call `raiseOverflow`\n"
+      "1: \n"
+      :"=a"(`result`)
+      :"a"(`a`), "c"(`b`)
+    """
+
+
 If expression
 -------------