home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT1-5 / SCANSTR.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-10  |  458 b   |  29 lines

  1. ;
  2. ;       Program ScanStr
  3. ;
  4. .model tiny
  5. .stack
  6. .data
  7. StrSc   byte    'ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
  8. .code
  9.     include maclib.inc
  10. .startup
  11.     lea     di,StrSc
  12.     mov     cx,LengthOf StrSc
  13.     mov     dx,cx
  14.     cld
  15.     mov al,es:[82h]
  16. repne   scasb
  17.     NewLine
  18.     .IF ZERO?
  19.     OutMsg  'Character found the position '
  20.     sub     dx,cx
  21.     add     dx,40h
  22.     OutInt  dx
  23.     .ELSE
  24.     OutMsg 'Character not found'
  25.     .ENDIF
  26.     Newline 
  27.     .exit   0
  28.     end
  29.