flat assembler
Message board for the users of flat assembler.

Index > Main > How using blsfill ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1821
Roman 02 May 2023, 08:53
blcfill is cool command ! Encoding: XOP.LZ.09 01 /1 wath is mean and how get opcode ?
https://www.amd.com/system/files/TechDocs/40332.pdf
Quote:

The BLCFILL instruction finds the least significant zero bit in the source operand, clears all bits below
that bit to 0 and writes the result to the destination. If there is no zero bit in the source operand, the
destination is written with all zeros.
The BLSFILL instruction finds the least significant one bit in the source operand, sets all bits below
that bit to 1 and writes the result to the destination. If there is no one bit in the source operand, the
destination is written with all ones.


How i understood BLCFILL do this:
Code:
;BLCFILL reg32, reg/mem32

mov eax,'1',0,'234' ;4 bytes
BLCFILL eax ;eax='1',0,0,0
    


Last edited by Roman on 02 May 2023, 09:51; edited 2 times in total
Post 02 May 2023, 08:53
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1821
Roman 02 May 2023, 09:07
BLCFILL eax,dword [txt] ;fasm compiled ok
BLCFILL eax,edx ;fasm compiled ok

In IDA Pro show db
But not show BLCFILL eax,edx
Post 02 May 2023, 09:07
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1821
Roman 02 May 2023, 09:13
BLCFILL eax,ecx ;compiled

But IDA Pro show this:
dd 178E98Fh, 1EB9C9h, 14BB0000h, 0B8000000h, 0Ah, 1EB9h

IDA Pro not show BLCFILL eax,ecx
Post 02 May 2023, 09:13
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1821
Roman 02 May 2023, 11:05
https://godbolt.org/

I get opcode.
Put to fasmw 1.73:
Code:
;db   $8f,$e9,$78,01,$cf   ;this not work too crash
db   $cf,1,$78,$e9,$8f     ;this not work crash

BLCFILL eax,edi        ;fasm  out $8f,$e9,$78,$01,$cf but crash
    

But IDA Pro show db, not BLCFILL eax,edi !
Post 02 May 2023, 11:05
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1821
Roman 02 May 2023, 11:33
How I understand, my processor not supported tbm.

The BLCFILL instruction is a TBM instruction. Support for this instruction is indicated by
CPUID Fn8000_0001_ECX[TBM] = 1.
How this write on fasm ? I want checked BLCFILL on my CPU
Code:
;CPU Ryzen 5 3500
;CPUID Fn8000_0001_ECX[TBM] my asm code right ? 
mov eax,80000001h
CPUID       ;IDA PRO CPUID return ecx=0x75C237FF         
test ecx,1     


BEXTR supported and work on my CPU.

Strange.

BLCFILL equivalent this:
Code:
lea    eax,[edi+0x1]
and    eax,edi    
Post 02 May 2023, 11:33
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.