www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Invalid string literal in ASM

reply dokutoku <dokutoku example.com> writes:
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?
Oct 01 2018
parent reply Basile B. <b2.temp gmx.com> writes:
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
Oct 01 2018
parent reply Basile B. <b2.temp gmx.com> writes:
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.
Oct 01 2018
parent dokutoku <dokutoku example.com> writes:
On Monday, 1 October 2018 at 10:45:25 UTC, Basile B. wrote:
 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.
As a conclusion, is it OK to say DMD bug?
Oct 03 2018