flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
bitRAKE 27 Apr 2013, 16:48
Code: struc _ROR val { . = ((. shr val) + (. shl (32-val))) and $FFFFFFFF } struc _ROL val { . = ((. shl val) + (. shr (32-val))) and $FFFFFFFF } happy = $19730905 joyjoy = $CAFEBABE happy _ROR 14 joyjoy _ROL 10 dd happy,joyjoy _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
![]() |
|
randomdude 27 Apr 2013, 17:46
thanks bitRAKE, but it doesnt seem to do the same than ror/rol
i cant use those strucs in my macro (error extra characters on line) so i did this: _char = ((_char shr 3) + (_char shl (32-3))) and 0xFF but the result is different than using ror/rol :S |
|||
![]() |
|
bitRAKE 27 Apr 2013, 18:01
Need to add more masking to clamp values? I didn't test it, but the general idea is sound. If you are only working with characters then it would be:
_char = ((_char shr 3) + (_char shl (8-3))) and 0xFF The size of the values being operated on is important. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
![]() |
|
randomdude 27 Apr 2013, 18:28
thanks a lot! works great =)
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.