News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

m2m vs mrm

Started by n00b!, June 27, 2008, 04:08:02 PM

Previous topic - Next topic

dsouza123

If your program doesn't use any x87 floating point instructions, you can use the MMX registers.

With slight modification to MichaelW's code (swapping mov with movd and eax with mm0)


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \masm32\include\masm32rt.inc
    .686
    .mmx
    include \masm32\macros\timers.asm
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««



    counter_begin 1000, HIGH_PRIORITY_CLASS
      movd mm0, m1
      movd m0, mm0
      movd mm0, m3
      movd m2, mm0
      movd mm0, m5
      movd m4, mm0
      movd mm0, m7
      movd m6, mm0
      movd mm0, m9
      movd m8, mm0
      movd mm0, mb
      movd ma, mm0
      movd mm0, md
      movd mc, mm0
      movd mm0, mf
      movd me, mm0
    counter_end



    counter_begin 1000, HIGH_PRIORITY_CLASS
      movd mm0, [esi+4]
      movd [esi+0], mm0
      movd mm0, [esi+12]
      movd [esi+8], mm0
      movd mm0, [esi+20]
      movd [esi+16], mm0
      movd mm0, [esi+28]
      movd [esi+24], mm0
      movd mm0, [esi+36]
      movd [esi+32], mm0
      movd mm0, [esi+44]
      movd [esi+40], mm0
      movd mm0, [esi+52]
      movd [esi+48], mm0
      movd mm0, [esi+60]
      movd [esi+56], mm0
    counter_end



      REPEAT 8
        movd mm0, [esi+@rnd(250000)*4]
        movd [esi+@rnd(250000)*4], mm0
      ENDM


If you do have x87 floating point use the emms instruction
to transition from mmx to x87 fp.