flat assembler
Message board for the users of flat assembler.
Index
> Main > 1Byte to 8Byte Least Significant Bit |
Author |
|
Fastestcodes 11 Aug 2022, 06:29
What is the fastest? What is the shortest?
|
|||
11 Aug 2022, 06:29 |
|
f2065 11 Aug 2022, 09:01
Code: shr al, 1 setc dh shr al, 1 setc dl shr al, 1 setc ch shr al, 1 setc cl shr al, 1 setc bh shr al, 1 setc bl shr al, 1 setc ah |
|||
11 Aug 2022, 09:01 |
|
Fastestcodes 11 Aug 2022, 13:05
set lsb 1: or al,01h
set lsb 0: and al,0feh |
|||
11 Aug 2022, 13:05 |
|
Fastestcodes 11 Aug 2022, 13:11
8Byte original: 5f 5f 60 60 60 60 61 61
input Byte 00000000b 8Byte 5e 5e 60 60 60 60 60 60 input Byte 11111111b 8Byte 5f 5f 61 61 61 61 61 61 |
|||
11 Aug 2022, 13:11 |
|
Tomasz Grysztar 11 Aug 2022, 13:58
Code: ; 8-byte data at ESI (assume DS=ES), input byte in DL: mov edi,esi mov ecx,8 @@: lodsb shr al,1 shr dl,1 rcl al,1 stosb loop @b |
|||
11 Aug 2022, 13:58 |
|
macomics 11 Aug 2022, 15:13
Code: ; input al = byte, output edx:eax movzx eax, al mov edx, 0x00204081 ror eax, 4 mov ecx, 0x01010101 mul edx shld edx, eax, 4 and edx, ecx and eax, ecx |
|||
11 Aug 2022, 15:13 |
|
Fastestcodes 11 Aug 2022, 17:03
Code: read 32MB pic to [m1] read 4MB data to [m0] [esi]=[m0] [edi]=[m1] mov al, [edi] ... mov dh,[edi+7] push eax mov al,[esi];databyte cmp al,00h je La00 cmp al,01h je La01 .... cmp al,0ffh je Laff La00: pop eax and al,0feh ... and dh,0feh; if al=00h, 8Byte least significant bit will be 0,0,0,0,0,0,0,0 jmp Lawm La01: ....;if al=01h, 8Byte least significant bit will be 0,0,0,0,0,0,0,1 Laff: ...; if al=0ffh, 8Byte least significant bit will be 1,1,1,1,1,1,1,1 Lawm: ;write to mem mov [edi],al mov [edi+1],ah ... mov [edi+7],dh write out from [m1] to outfile Every 8 picture Byte contains 1 secondary dataByte(8 least significant bit) 32MB pic,4MB secondary data. |
|||
11 Aug 2022, 17:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.