Invalid string literal in ASM

Basile B. b2.temp at gmx.com
Mon Oct 1 10:45:25 UTC 2018


On Monday, 1 October 2018 at 09:24:47 UTC, Basile B. wrote:
> On Monday, 1 October 2018 at 08:14:07 UTC, dokutoku wrote:
>> I get a compiler error when I try to put non-ASCII characters 
>> in a string literal in the inline assembler.
>>
>> Is this part of the specifications?
>
> It's not clear, see https://dlang.org/spec/iasm.html#raw_data:
>
> "if an operand is a string literal, it is as if there were 
> length operands, where length is the number of characters in 
> the string"
>
> db "e"; // ok
> db "é"; // error
>
> it seems that the second case should be accepted as db 195 db 
> 169

BUG imo. length is 2. "é" should be interpreted as the 2 bytes of 
its data.
Something with decoding is wrong here.


More information about the Digitalmars-d-learn mailing list