Mail Archives: djgpp/1997/11/25/06:01:09
"J.E." <cellis AT voyageur DOT ca> wrote:
> What!? Man, all this time I figured that using words (with my 16-bit
> assembler) to copy buffers and stuff was faster than using bytes. Why
> is using bytes faster than using words?
If you are in 16-bit mode on the x86 then 16-bit move instructions
are indeed faster than 8-bit. However, if you are in 32-bit mode
(as programs written with DJGPP are) then 16-bit is slower than
32-bit or 8-bit because it has to change mode to do a 16-bit
instruction (it's also larger because it needs a prefix byte per
instruction).
So if you're in assembler using something like TASM or MASM, then
doing movsw is faster. If you're using GCC inline assembly or
gas then movsw is slower.
Chris C
- Raw text -