home *** CD-ROM | disk | FTP | other *** search
/ Graphics Programming Black Book (Special Edition) / BlackBook.bin / disk1 / source / chapter12 / lst12-1.asm next >
Assembly Source File  |  1997-06-18  |  360b  |  19 lines

  1. ; Measures the effect of loading a byte register 2 cycles 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.     mov    dl,cl
  10.     nop
  11.     mov    ax,[bx]
  12.     endm
  13.     call    ZTimerOff ;stop timing
  14.     dec    bp
  15.     jz    Done
  16.     jmp    CacheFillLoop
  17. Done:
  18.  
  19.