flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Macro to convert string to unicode |
Author |
|
Tomasz Grysztar 30 May 2017, 11:43
Code: macro CONVERT_TO_UNICODE base*,str* { local ..str,..sz,..ch virtual at 0 ..str:: du str,0 ..sz = $/2 end virtual repeat ..sz load ..ch word from ..str:(%-1)*2 mov word [base+(%-1)*2],..ch end repeat } |
|||
30 May 2017, 11:43 |
|
alorent 31 May 2017, 09:29
Thanks a lot Tomasz! This is magic for me!
It works great, but I have a project that needs to use old FASM 1.69.29 and it reports the following compilation error: Error: invalid name Code: ..str:: du str, 0 Isn't that construction available for old FASM? I know that I should be punished for using that old version! Is there an equivalent for the old version? Thanks! |
|||
31 May 2017, 09:29 |
|
Tomasz Grysztar 31 May 2017, 10:20
It is possible with old version, though suboptimal:
Code: macro CONVERT_TO_UNICODE base*,str* { local ..sz,..ch virtual at 0 du str,0 ..sz = $/2 end virtual repeat ..sz virtual at 0 du str,0 load ..ch word from (%-1)*2 end virtual mov word [base+(%-1)*2],..ch end repeat } |
|||
31 May 2017, 10:20 |
|
alorent 31 May 2017, 15:38
Thanks again Tomasz! Amazing!!!
|
|||
31 May 2017, 15:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.