home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 March / CMCD0305.ISO / Software / Shareware / Utilitare / emu / Emu8086_Setup_307c.exe / {app} / Samples / timer.asm < prev    next >
Encoding:
Assembly Source File  |  2002-08-02  |  644 b   |  49 lines

  1. ; This sample shows the
  2. ; use of a timer function
  3. ; (INT 15h / 86h)
  4. ; This code prints some chars
  5. ; with 1 second delay.
  6.  
  7. #make_COM#
  8.  
  9. ORG     100h
  10.  
  11. ; set the segment register,
  12. ; just in case:
  13. MOV     AX, CS
  14. MOV     DS, AX
  15.  
  16. next_char:
  17.  
  18. CMP     count, 0
  19. JZ      stop
  20.  
  21. ; print char:
  22. MOV     AL, c1
  23. MOV     AH, 0Eh
  24. INT     10h
  25.  
  26. ; next ascii char:
  27. INC     c1
  28. DEC     count
  29.  
  30. ; set interval (1 million
  31. ; microseconds - 1 second):
  32. MOV     CX, 0Fh
  33. MOV     DX, 4240h
  34. MOV     AH, 86h
  35. INT     15h
  36.  
  37. ; stop any error:
  38. JC      stop    
  39.  
  40. JMP     next_char
  41.  
  42. stop:
  43. RET
  44.  
  45. count   DB      10
  46. c1      DB      'A'
  47.  
  48. END
  49.