@@ -390,6 +390,31 @@ $(H2 $(LNAME2 limitations, Limitations))
390
390
391
391
$(H2 $(LNAME2 extensions, Extensions))
392
392
393
+ $(H3 $(LNAME2 asmstatements, Asm statement))
394
+
395
+ $(P For the D language, `asm` is a standard keyword, and its construct is
396
+ shared with ImportC. For the C language, `asm` is an extension (J.5.10),
397
+ and the recommendation is to instead use `__asm__`. All alternative
398
+ keywords for `asm` are translated by the druntime file $(TT src/importc.h)
399
+ during the preprocessing stage.)
400
+
401
+ $(P The `asm` keyword may be used to embed assembler instructions, its
402
+ syntax is implementation defined. The Digital Mars D compiler only supports
403
+ the dialect of inline assembly as described in the documentation of the
404
+ $(LINK2 https://dlang.org/spec/iasm.html, D x86 Inline Assembler).)
405
+
406
+ $(P `asm` in a function or variable declaration may be used to specify the
407
+ mangle name for a symbol. Its use is analogous to
408
+ $(LINK2 https://dlang.org/spec/pragma.html#mangle, pragma mangle).)
409
+
410
+ $(CCODE
411
+ char **myenviron asm("environ") = 0;
412
+
413
+ int myprintf(char *, ...) asm("printf");
414
+ )
415
+
416
+ $(P Using `asm` to associate registers with variables is ignored.)
417
+
393
418
$(H3 $(LNAME2 forward-references, Forward References))
394
419
395
420
$(P Any declarations in scope can be accessed, not just
0 commit comments