flat assembler
Message board for the users of flat assembler.
Index
> Main > [Solved]BEXTR crash |
Author |
|
macomics 01 May 2023, 18:53
Intel SDM 2a wrote:
Code: BEXTR eax,ebx,edx ; = BEXTR eax,ebx,2 Last edited by macomics on 01 May 2023, 18:55; edited 1 time in total |
|||
01 May 2023, 18:53 |
|
Roman 01 May 2023, 18:55
BEXTR eax,ebx,edx work !
But why compiled BEXTR eax,ebx,2 ? |
|||
01 May 2023, 18:55 |
|
macomics 01 May 2023, 19:07
This is not the instruction that fasm encoded
Code: use32 BEXTR eax, ebx, 2 nop nop nop BEXTR eax, ebx, edx Code: $ fasm test.asm -m 1024 flat assembler version 1.73.30 (1024 kilobytes memory) 1 passes, 17 bytes.
|
||||||||||
01 May 2023, 19:07 |
|
Roman 01 May 2023, 19:15
Code: mov eax,0 mov ebx,'tom1' mov edx,1024*8 BEXTR eax,ebx,edx ;eax='tom1' mov eax,0 mov ebx,'tom1' mov edx,1024*2 BEXTR eax,ebx,edx ;eax='t',0,0,0 I not understand how get to eax='om1',0 ? |
|||
01 May 2023, 19:15 |
|
Tomasz Grysztar 01 May 2023, 19:20
The immediate variant of BEXTR is part of the TBM extension, not supported by new CPUs.
|
|||
01 May 2023, 19:20 |
|
macomics 01 May 2023, 19:22
Try
Code: mov ebx, 'tom1' mov edx, 8+24*256 bextr eax, ebx, edx or (simple) Code: mov ebx, 'tom1' mov dl, 8 ; start mov dh, 24; len bextr eax, ebx, edx |
|||
01 May 2023, 19:22 |
|
Roman 01 May 2023, 19:27
Ha ! I do this !
Code: mov eax,0 mov ebx,'tom1' mov edx,1024*7+8 BEXTR eax,ebx,edx ;eax= "om1",0 Thanks. This is good explanation: mov dl, 8 ; start mov dh, 24; len. One char is 8. If we want get two chars dh=16 |
|||
01 May 2023, 19:27 |
|
Roman 01 May 2023, 19:35
Strange this.
Code: mov eax,'toke' mov ebx,'tom1' mov dl,8 ;start mov dh,24-8 ;len BEXTR eax,ebx,edx ;eax='om' but not 'omke'. ;BEXTR reset in eax,4 bytes and than copy. or eax,' ke' ;eax='omke' |
|||
01 May 2023, 19:35 |
|
macomics 01 May 2023, 20:34
Code: mov eax, 'toke' mov ebx, 'tom1' ror ebx, 8 shl eax, 16 shrd eax, ebx, 16 ; eax = 'omke' rol ebx, 8 |
|||
01 May 2023, 20:34 |
|
Roman 02 May 2023, 04:42
Replaced bextr variant
Code: mov eax, 'toke' mov ebx, 'tom1' and eax, 0xffff0000 and ebx, 0x00ffff00 shr ebx, 8 or eax, ebx ;eax='omke' |
|||
02 May 2023, 04:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.