|
From: David O. <da...@ga...> - 2000-07-05 22:19:20
|
On Fri, 30 Jun 2000, Dean Bilotti wrote: > I've been playing with assembly speeding up my BSP compiler over the last > few days and I came accross a problem where I had to flip BCD bytes in a > register. This is similar to the Endian Swap you have to do for the mod's. > > I basically had to Endian Swap 32-bit integers. > > The way I saw it there were 2 viable methods for the 16 bit integer: > > mov ax, Value ; 1 clock > xor ah, al ; 1 clock > xor al, ah ; 1 clock > xor ah, al ; 1 clock > > and > > mov ax, Value ; 1 clock > xchg ah, al ; 3 clocks Hmm... Is rotation by 8 bits 3 clocks as well? Anyway, have you considered what these clock counts are in real life, with the pipeline and multiple ALUs in action? //David .- M u C o S --------------------------------. .- David Olofson ------. | A Free/Open Multimedia | | Audio Hacker | | Plugin and Integration Standard | | Linux Advocate | `------------> http://www.linuxdj.com/mucos -' | Open Source Advocate | .- A u d i a l i t y ------------------------. | Singer | | Rock Solid Low Latency Signal Processing | | Songwriter | `---> http://www.angelfire.com/or/audiality -' `-> da...@li... -' |