flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Genix
Can anyone help me with my problem? I need to left rotate 64bit value stored in register pair (ex. EDX:EAX). I am just beginner in asm so this is out of my knowledge. Thanks.
|
|||
![]() |
|
Genix
So if i need to rotate by N bit, can i use cycle with rotation by 1 bit or can i rotate it at once?
|
|||
![]() |
|
Genix
Tomasz Grysztar wrote: If you need to rotate just by 1 bit, you can do it through carry: Is it right? rol64start: mov ecx, 15 ; 15xrepeat bt eax, 31 cycle_start: rcl edx, 1 rcl eax, 1 loop cycle_start |
|||
![]() |
|
Tomasz Grysztar
No, you are duplicating one bit this way - you would have to put the BT instruction also inside the loop.
Also, assuming you've got the shift count in CL, you can it without loop using SHLD, something like: Code: shld ebx,edx,cl shld edx,eax,cl ror ebx,cl shld eax,ebx,cl with EBX as a temporary storage. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.