flat assembler
Message board for the users of flat assembler.

Index > Main > Sse convert char txt to Unicode ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 14 Aug 2023, 14:02
Code:
Txt dB "12345678"
;in code
movups xmm1,dqword [Txt]

Do something and get in xmm1 Unicode text "1 2 3 4 5 6 7 8 "
And do back "1 2 3 4 5 6 7 8 " convert to "12345678"
    

How do this ?
Pshufb ?
Post 14 Aug 2023, 14:02
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2502
Furs 14 Aug 2023, 14:33
You could also use pmovzxbw.
Post 14 Aug 2023, 14:33
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 14 Aug 2023, 14:42
Or this PMOVSXBW
Post 14 Aug 2023, 14:42
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 14 Aug 2023, 14:42
How do PMOVSXWB ? Convert Unicode to char
Post 14 Aug 2023, 14:42
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 14 Aug 2023, 15:02
Convert Unicode to char:
PACKUSWB xmm1, xmm1
Post 14 Aug 2023, 15:02
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2502
Furs 15 Aug 2023, 12:30
Roman wrote:
Or this PMOVSXBW
That's not correct. It sign-extends, so any ASCII char > 127 will have upper byte (of UTF-16) set to all 1s.
Post 15 Aug 2023, 12:30
View user's profile Send private message Reply with quote
Flier-Mate



Joined: 26 May 2023
Posts: 88
Flier-Mate 16 Aug 2023, 09:25
I got an error when trying to run PMOVZXBW while debugging in IDA Free, later I figured out that maybe my old laptop doesn't support SSE 4.1 instruction. Razz


Description: Error in executing PMOVZXBW in IDA Free
Filesize: 6.89 KB
Viewed: 2206 Time(s)

Screenshot 2023-08-16 172305.png


Post 16 Aug 2023, 09:25
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 16 Aug 2023, 10:48
I think yes.
Not supported PMOVZXBW your pc
Post 16 Aug 2023, 10:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.