flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Goplat 07 Jul 2009, 18:17
You're probably thinking of xlatb (long form: "xlat byte [bx]" or "xlat byte [ebx]"). It reads a byte from memory at the address (E)BX+AL and stores it into AL.
|
|||
![]() |
|
Azu 07 Jul 2009, 18:29
Thank you
![]() |
|||
![]() |
|
asmcoder 07 Jul 2009, 18:55
[content deleted]
Last edited by asmcoder on 14 Aug 2009, 14:49; edited 1 time in total |
|||
![]() |
|
windwakr 07 Jul 2009, 20:45
asmcoder wrote: xlatb takes 4 clocks !! thats much, i think.. Seriously, 4 clocks "is much"? On modern computer 4 cycles is what, less than 0.0000000012121212121212121212121212121212 of a second(on my 3.3ghz cpu) ...Like I said, I'm really sick of seeing Asmcoders posts. He is polluting our nice forum with this shit. 99% of the fucking time on his threads he asks questions that could be found in 2 seconds of searching. And I do not like his motives, malware writers should not be allowed here. |
|||
![]() |
|
bitRAKE 07 Jul 2009, 20:54
I actually use XLATB in a situation requiring billions of iterations - 4 cycles is a problem.
Code: mov rdi,rsi .0: lodsb xadd al,ah xlatb stosb loop .0 ![]() |
|||
![]() |
|
pal 07 Jul 2009, 23:08
bitRAKE: Surely the loop is slowing the code down. You can replace it with a dec ecx; jnz .0; and it would save like a minimum of 3 loops (1 + 1 = 2 loops, loop = 5/6 loops (someone also said 5-10 loops)), or sub ecx,1; if there is something wrong with dec in this situation (which I have heard there is?).
|
|||
![]() |
|
baldr 16 Jul 2009, 10:29
pal,
That's probably partial RFLAGS update stall issue (CF is not affected by dec). bitRAKE, Unroll and use SIMD. PEXTRB al, xmm1, byte_index / PINSRB xmm1, [xlat_tab+eax], byte_index combo for xlatb. PADDB for summing (overflow is ignored, right?). PMADDUBSW with proper byte masks will help to combine stripes' sums afterward. Use word granularity in translation if memory footprint is of no concern (128kB table can be cumbersome though). |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.