What would be better to swap bytes in a word?
rol ax,8

xchg al,ah


What do you think?
Posted on 2003-06-23 23:25:53 by comrade
Better: Speed? Size? What?



rol ax, 8
C1C008



xchg al, ah
86E0


rol ax, 8 is faster than xcgh al, ah
xchg al, ah is smaller than rol ax, 8
Posted on 2003-06-24 01:14:50 by greenant
Originally posted by greenant
Better: Speed? Size? What?



rol ax, 8
C1C008



xchg al, ah
86E0


rol ax, 8 is faster than xcgh al, ah
xchg al, ah is smaller than rol ax, 8

rol ax, 8 is 66C1C008.
You have forgotten about the prefix 66h
Posted on 2003-06-24 02:29:38 by roticv
yes
I was in 16 bit mode

So xchg al, ah is better
Posted on 2003-06-24 03:36:59 by greenant