diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-02-25 15:29:37 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-25 15:29:37 -0800 |
commit | 9fa2e72997b698107b7c5a02e8f03e84e8d8fb74 (patch) | |
tree | 7de3095e072a8b4a88631fc31055b17ab82a375f /test/utf.asm | |
parent | 5a24fdd547f4c02fe46c37b84a020febfa41bfd2 (diff) | |
download | nasm-9fa2e72997b698107b7c5a02e8f03e84e8d8fb74.tar.gz nasm-9fa2e72997b698107b7c5a02e8f03e84e8d8fb74.tar.bz2 nasm-9fa2e72997b698107b7c5a02e8f03e84e8d8fb74.zip |
Add support for UTF-16BE and UTF-32BE
Add support for bigendian UTF-16 and UTF-32, and (for symmetry) add
explicitly littleendian operators.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'test/utf.asm')
-rw-r--r-- | test/utf.asm | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/utf.asm b/test/utf.asm index 4b894f8..00207dc 100644 --- a/test/utf.asm +++ b/test/utf.asm @@ -2,6 +2,10 @@ ;Testname=error; Arguments=-fbin -outf.bin -DERROR; Files=stdout stderr utf.bin %define u(x) __utf16__(x) %define w(x) __utf32__(x) +%define ul(x) __utf16le__(x) +%define wl(x) __utf32le__(x) +%define ub(x) __utf16be__(x) +%define wb(x) __utf32be__(x) db `Test \u306a\U0001abcd\n` dw u(`Test \u306a\U0001abcd\n`) @@ -21,10 +25,58 @@ mov ebx,u(`\U0001abcd`) mov ecx,w(`\U0001abcd`) + db `Test \u306a\U0001abcd\n` + dw ul(`Test \u306a\U0001abcd\n`) + dd wl(`Test \u306a\U0001abcd\n`) + + db `\u306a` + db `\xe3\x81\xaa` + + dw __utf16le__ "Hello, World!" + + nop + + mov ax,ul(`a`) + mov bx,ul(`\u306a`) + mov cx,ul(`\xe3\x81\xaa`) + mov eax,ul(`ab`) + mov ebx,ul(`\U0001abcd`) + mov ecx,wl(`\U0001abcd`) + + db `Test \u306a\U0001abcd\n` + dw ub(`Test \u306a\U0001abcd\n`) + dd wb(`Test \u306a\U0001abcd\n`) + + db `\u306a` + db `\xe3\x81\xaa` + + dw __utf16be__ "Hello, World!" + + nop + + mov ax,ub(`a`) + mov bx,ub(`\u306a`) + mov cx,ub(`\xe3\x81\xaa`) + mov eax,ub(`ab`) + mov ebx,ub(`\U0001abcd`) + mov ecx,wb(`\U0001abcd`) + %ifdef ERROR dw __utf16__ 33 dw __utf16__, 46 dw __utf16__("Hello, World!",16) dw __utf16__("Hello, World!",16 dw u(`\xff`) + + dw __utf16le__ 33 + dw __utf16le__, 46 + dw __utf16le__("Hello, World!",16) + dw __utf16le__("Hello, World!",16 + dw ul(`\xff`) + + dw __utf16be__ 33 + dw __utf16be__, 46 + dw __utf16be__("Hello, World!",16) + dw __utf16be__("Hello, World!",16 + dw ub(`\xff`) %endif |