How could I break an infinite loop??

Thread Solved

Join Date: Apr 2007
Posts: 16
Reputation: eeeraser is an unknown quantity at this point 
Solved Threads: 0
eeeraser eeeraser is offline Offline
Newbie Poster

How could I break an infinite loop??

 
0
  #1
May 8th, 2007
Hi guys again,
If I have an infinite loop for example:

  1. MOV CX, 240
  2. MOV DX, 320
  3.  
  4. HERE: MOV AH, 2CH
  5. INT 21H
  6. CMP DH, 1
  7. JE DOT
  8. MOV AX, 0C00H
  9. INT 10H
  10. DOT: MOV AX, 0C04H
  11. INT 10H
  12. JMP HERE

In the example I have an infinite loop. I want to break this, however, I don't want to stop it functionality ( plups every 60 seconds) ...

int 21, ah = 01 will stop the loop untill you press any key.
As I said I don't stop the loop, I wanna keep it working untill someone press ESC for example...

So, if any idea please tell me about it.
Thanks in advance
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: How could I break an infinite loop??

 
0
  #2
May 8th, 2007
Indispensable reading.
http://www.cs.cmu.edu/afs/cs/user/ra...WWW/files.html

Int 16/AH=01h perhaps.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 16
Reputation: eeeraser is an unknown quantity at this point 
Solved Threads: 0
eeeraser eeeraser is offline Offline
Newbie Poster

Re: How could I break an infinite loop??

 
0
  #3
May 8th, 2007
Thanks, it works Int 16, Ah = 01
I have witten this code in my program and it works
  1. START: MOV AH,01
  2. INT 16H
  3. CMP AL, 0DH
  4. JNE GOAGAIN
  5. POP AX
  6. MOV AH, 00H
  7. INT 10H
  8. MOV AX, 4C00H
  9. INT 21H
  10.  
  11. GOAGAIN: mov ah,02
  12. INt 1Ah
  13. -
  14. -
  15. -
  16. to the end of the loop and it comes again back to START.

Thanks man alot.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC