ASM extensions

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Tue Jul 18 08:54:58 PDT 2006


James Dunne wrote:
> Georg Wrede wrote:
>>
>>
>> James Dunne wrote:
>>
>>> BCS wrote:

[snip]

>>> If one of these ASM syntaxes involves the use of curly braces, then 
>>> finding the true end curly brace of the asm {} block itself might be 
>>> difficult without understanding the ASM syntax itself.
>>
>>
>> Actually it wouldn't, because the curly braces in _any_ syntax come in 
>> pairs. ;-)
>>
>> But that fact alone doesn't help the real issue.
> 
> Not if the curlies are in comments that don't take a form that D is 
> familiar with (such as those starting with -- or semicolon).  In 
> comments, all bets are off.
> 

http://www.digitalmars.com/d/statement.html#asm says the following:

      The format of the instructions is, of course, highly dependent on
      the native instruction set of the target CPU, and so is
      implementation defined. But, the format will follow the following
      conventions:

         * It must use the same tokens as the D language uses.
         * The comment form must match the D language comments.
         * Asm instructions are terminated by a ;, not by an end of
           line.

     These rules exist to ensure that D source code can be tokenized
     independently of syntactic or semantic analysis.

Note the second requirement: the asm syntax must use D comment syntax.
Curiously, it doesn't mention braces though. A small oversight maybe?



More information about the Digitalmars-d mailing list