Home arrow 8086 Assembly Programs arrow Search Character in String Friday, 05 December 2008
Home
- - - - - - -
Contact me!
My Blog!
- - - - - - -
- - - - - - -
8086 Assembly Programs
Graphics
Java Servlets
Prolog
VHDL
- - - - - - -
Ubuntu Linux
- - - - - - -
Links
Statistics
Visitors: 43305

   
Search Character in String
Written by Rohit   
Monday, 10 April 2006
  1. .model small
  2. .data
  3.     string db "Test String","$"
  4.     char db "s"
  5.     f db "Found","$"
  6.     nf db "Not found","$"
  7. .code
  8. main proc far
  9.     mov ax, @data
  10.     mov ds, ax
  11.     mov es, ax
  12.     mov di, offset string
  13.     mov al, char
  14.     mov cx, 0Bh
  15.     cld
  16. repne scasb
  17.     jnz notfound
  18.     mov dx, offset f
  19.     mov ah,09h
  20.     int 21h
  21.     jmp finish
  22. notfound: mov dx, offset nf
  23.     mov ah,09h
  24.     int 21h
  25. finish:
  26.     mov ax, 4c00h
  27.     int 21h
  28. main endp
  29. end main
 
< Prev   Next >

 

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.