flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Easy UTF16 string creation. |
Author |
|
JohnFound 02 Jan 2005, 13:12
Use "du" instead of "dw".
|
|||
02 Jan 2005, 13:12 |
|
Chewy509 02 Jan 2005, 22:19
Thanks.
|
|||
02 Jan 2005, 22:19 |
|
Chewy509 03 Jan 2005, 01:45
Here is the final version of the macro...
Code: macro utf16_pascal_str name, [string] { common name: local label, label2 dw ( label - label2 ) / 2 label: dw 0feffh ;This is the Unicode Byte Order Mark forward du string common label2: } Usage: Code: utf16_pascal_str string2, 02126h, ' This is the symbol for ohm' will produce a correctly formatted UTF16 string. eg Quote: Ω This is the symbol for ohm The NULL terminated version would be: Code: macro utf16_str name, [string] { common name: dw 0feffh ;This is the Unicode Byte Order Mark forward du string common dw 0 } Same usage applies. Note: The Pascal version uses a word, instead of a byte for string length. Strings upto 64K characters are now possible (using upto 128K of memory). Note2: The first word is the Unicode Byte Order Mark, to define the endian mode. |
|||
03 Jan 2005, 01:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.