Hi,
I need to switch the blue and red values with eachother in a RGB-value in the eax...
I thought-up this code...
rcl ax,8
rcl eax,16
rcl ax,8
ror eax,8
but it devides the green and blue values in two :(
What am I doing wrong???
T.I.A.,
Locu
I need to switch the blue and red values with eachother in a RGB-value in the eax...
I thought-up this code...
rcl ax,8
rcl eax,16
rcl ax,8
ror eax,8
but it devides the green and blue values in two :(
What am I doing wrong???
T.I.A.,
Locu
Did you specify if your 16 is decimal or hexadecimal? Maybe that could be the problem.
All of the numbers are decimal...
Grtz...
Locu
Grtz...
Locu
In what format are the RGB values exactly? How do you initialize eax? Remember that when you read from a memory location, it's bytes are swapped because of the little endian format.
Thomas
Thomas
This is not optimal - meerly an example of a possible method:
mov eax,01[COLOR=blue]23[/COLOR][COLOR=limegreen]45[/COLOR][COLOR=red]67[/COLOR]h
bswap eax ; eax = [COLOR=red]67[/COLOR][COLOR=limegreen]45[/COLOR][COLOR=blue]23[/COLOR]01h
ror eax,8 ; eax = 01[COLOR=red]67[/COLOR][COLOR=limegreen]45[/COLOR][COLOR=blue]23[/COLOR]h
I figured out what I did wrong... I used "rcl" instead of "rol"...
bitRAKE: Thank you for the code... it's allot shorter :)
Grtz...
Locu
bitRAKE: Thank you for the code... it's allot shorter :)
Grtz...
Locu