flat assembler
Message board for the users of flat assembler.
Index
> Windows > error: value out of range. |
Author |
|
revolution 25 Nov 2015, 14:09
Are you trying to make fasmw a Unicode application? Or a UTF8 application? Or something else?
|
|||
25 Nov 2015, 14:09 |
|
revolution 25 Nov 2015, 14:21
The problem can be reduced to this:
Code: include 'encoding/utf8.inc' du <'abc',0> |
|||
25 Nov 2015, 14:21 |
|
Tomasz Grysztar 25 Nov 2015, 15:09
revolution wrote: The problem can be reduced to this: Code: _ equ ,09h, Code: du '&Redo' _ 'Ctrl+Shift+Z' |
|||
25 Nov 2015, 15:09 |
|
l_inc 25 Nov 2015, 15:21
Tomasz Grysztar
Quote: Probably the only solution would be to create additional "du" wrapper containing "match" to force evaluation of symbolic constant before proceeding to split the parameters. I don't see any reason, why you process the arguments in a forward block. common or even the ampersand feature seems like the most suitable solution. P.S. Sorry, disregard the comment. I just took a short look at the macro without putting any understanding into the problem. _________________ Faith is a superposition of knowledge and fallacy |
|||
25 Nov 2015, 15:21 |
|
jiangfasm 27 Nov 2015, 04:15
I finally found the reason.
'&Redo' _ 'Ctrl+Shift+Z' -> By Du macros as not a string. You must write 2 characters, put dw. '&Redo' _ 'Ctrl+Shift+Z' -> '&R' _ 'Ct' Can compile. |
|||
27 Nov 2015, 04:15 |
|
jiangfasm 27 Nov 2015, 05:10
Quote: _ equ ,09h, Why the preceding code without warning? |
|||
27 Nov 2015, 05:10 |
|
revolution 27 Nov 2015, 06:18
jiangfasm wrote: I finally found the reason. |
|||
27 Nov 2015, 06:18 |
|
jiangfasm 28 Dec 2015, 04:51
Code: macro du [arg] { local current,..input,char virtual at 0 ..input:: du arg count = $ end virtual current = 0 while current < count load char byte from ..input:current+1 if char = 0 load char byte from ..input:current wide = char current = current + 1*2 if char > 0C0h if char < 0E0h wide = char and 11111b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) current = current + 1*2 else if char < 0F0h wide = char and 1111b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) current = current + 2*2 else if char < 0F8h wide = char and 111b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+2*2 wide = wide shl 6 + (char and 111111b) current = current + 3*2 else if char < 0FCh wide = char and 11b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+2*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+3*2 wide = wide shl 6 + (char and 111111b) current = current + 4*2 else wide = char and 1 load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+2*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+3*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+4*2 wide = wide shl 6 + (char and 111111b) current = current + 5*2 end if end if else wide = char shl 8 load char byte from ..input:current wide = wide + char current = current + 1*2 end if if wide < 10000h dw wide else dw 0D7C0h + wide shr 10,0DC00h or (wide and 3FFh) end if end while } Final method!! Edit by revolution: Used code tags |
|||
28 Dec 2015, 04:51 |
|
Roman 28 Dec 2015, 14:58
jiangfasm how use you macro ?
Show example. |
|||
28 Dec 2015, 14:58 |
|
jiangfasm 31 Dec 2015, 14:44
Sorry Roman, macro I feel a little bug, let me think about it!
|
|||
31 Dec 2015, 14:44 |
|
jiangfasm 31 Dec 2015, 15:18
newest modification
Code: macro du [arg] { local current,..input,char virtual at 0 ..input:: du arg count = $ end virtual current = 0 while current < count load char byte from ..input:current+1 if char = 0 load char byte from ..input:current wide = char current = current + 1*2 if char > 0C0h if char < 0E0h wide = char and 11111b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) current = current + 1*2 else if char < 0F0h wide = char and 1111b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) current = current + 2*2 else if char < 0F8h wide = char and 111b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+2*2 wide = wide shl 6 + (char and 111111b) current = current + 3*2 else if char < 0FCh wide = char and 11b load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+2*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+3*2 wide = wide shl 6 + (char and 111111b) current = current + 4*2 else wide = char and 1 load char byte from ..input:current wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+1*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+2*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+3*2 wide = wide shl 6 + (char and 111111b) load char byte from ..input:current+4*2 wide = wide shl 6 + (char and 111111b) current = current + 5*2 end if end if if wide < 10000h dw wide else dw 0D7C0h + wide shr 10,0DC00h or (wide and 3FFh) end if else wide = char shl 16 load char byte from ..input:current wide = wide + char current = current + 1*2 dd wide end if end while } example Quote:
Quote:
|
|||
31 Dec 2015, 15:18 |
|
jiangfasm 01 Jan 2016, 04:05
jiangfasm wrote:
I'm sure this is correct. |
|||
01 Jan 2016, 04:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.