home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / zendisk2.zip / LST11-20.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  1KB  |  47 lines

  1. ;
  2. ; *** Listing 11-20 ***
  3. ;
  4. ; Tests whether several characters are in the set
  5. ; {A,Z,3,!} by using the compare-and-jump approach.
  6. ;
  7.     jmp    Skip
  8. ;
  9. ; Determines whether a given character is in the set
  10. ; {A,Z,3,!}.
  11. ;
  12. ; Input:
  13. ;    AL = character to check for inclusion in the set
  14. ;
  15. ; Output:
  16. ;    Z if character is in TestSet, NZ otherwise
  17. ;
  18. ; Registers altered: none
  19. ;
  20. CheckTestSetInclusion:
  21.     cmp    al,'A'    ;is it 'A'?
  22.     jz    CheckTestSetInclusionDone ;yes, we're done
  23.     cmp    al,'Z'    ;is it 'Z'?
  24.     jz    CheckTestSetInclusionDone ;yes, we're done
  25.     cmp    al,'3'    ;is it '3'?
  26.     jz    CheckTestSetInclusionDone ;yes, we're done
  27.     cmp    al,'!'    ;is it '!'?
  28. CheckTestSetInclusionDone:
  29.     ret        ;the success status is already in
  30.             ; the Zero flag
  31. ;
  32. Skip:
  33.     call    ZTimerOn
  34.     mov    al,'A'
  35.     call    CheckTestSetInclusion    ;check 'A'
  36.     mov    al,'Z'
  37.     call    CheckTestSetInclusion    ;check 'Z'
  38.     mov    al,'3'
  39.     call    CheckTestSetInclusion    ;check '3'
  40.     mov    al,'!'
  41.     call    CheckTestSetInclusion    ;check '!'
  42.     mov    al,' '
  43.     call    CheckTestSetInclusion    ;check space, so
  44.                     ; we get a failed
  45.                     ; search
  46.     call    ZTimerOff
  47.