home *** CD-ROM | disk | FTP | other *** search
/ Graphics Programming Black Book (Special Edition) / BlackBook.bin / disk1 / source / chapter12 / lst12-2.asm < prev   
Encoding:
Assembly Source File  |  1997-06-18  |  342 b   |  4 lines

  1. ; Measures the effect of loading a byte register 1 cycle before
  2. ; using a register to address memory.
  3.     mov    bp,2    ;run the test code twice to make sure
  4.                 ; it's cached
  5.     sub    bx,bx
  6. CacheFillLoop:
  7.     call    ZTimerOn ;start timing
  8.     rept    1000
  9.     nop
  10.     mov    dl,cl
  11.     mov    ax,[bx]
  12.     endm
  13.     call    ZTimerOff ;stop timing
  14.     dec    bp
  15.     jz    Done
  16.     jmp    CacheFillLoop
  17. Done:
  18.  
  19.