home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / zenlib / lst9_11.asm < prev    next >
Assembly Source File  |  1990-02-15  |  550b  |  19 lines

  1. ;
  2. ; *** Listing 9-11 ***
  3. ;
  4. ; Illustrates the use of the efficient word-sized INC to
  5. ; increment a byte-sized register, taking advantage of the
  6. ; knowledge that AL never counts past 0FFh to wrap to 0 and
  7. ; so AH will never affected by the INC.
  8. ;
  9. ; Note: This is a sample code fragment, and is not intended
  10. ; to either be run under the Zen timer or assembled as a
  11. ; standalone program.
  12. ;
  13.     sub    al,al    ;count up from 0
  14. TestLoop:
  15.     inc    ax    ;AL will never turn over, so AH
  16.             ; will never be affected
  17.     cmp    al,8    ;count up to 8
  18.     jbe    TestLoop
  19.