home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
amiga-flight
/
programs
/
timer.asm
< prev
next >
Wrap
Assembly Source File
|
1977-12-31
|
3KB
|
67 lines
*****************************************************************************
*** TIMER.ASM ***
*** ***
*** Author : Andrew Duffy ***
*** Date : February 1993 ***
*** Desc. : This program demonstrates how to use the timer routines ***
*** to delay for a set period of time. ***
*** ***
*** ©XCNT, 1992-1994. ***
*****************************************************************************
*****************************************************************************
*** Includes ***
*****************************************************************************
include "subrts.h" Included by default anyway
*****************************************************************************
*** Constants ***
*****************************************************************************
ONESEC EQU 250000 Number of clock ticks in 1 second
*****************************************************************************
*** Initial message ***
*****************************************************************************
movea.l #StartText,a6
jsr OUTSTR Call OUTSTR routine
*****************************************************************************
*** Main routine ***
*****************************************************************************
move.l #10*ONESEC,d0 Time to delay for
jsr START_TIMER Call START_TIMER
Loop jsr CHECK_TIMER Call CHECK_TIMER
beq.s Loop Loop if not finished
*****************************************************************************
*** End Message ***
*****************************************************************************
movea.l #EndText,a6
jsr OUTSTR Call OUTSTR routine
*****************************************************************************
*** Wait for a key to be pressed ***
*****************************************************************************
Loop2 jsr INKEY Call INKEY routine
beq.s Loop2 Loop if nothing pressed
rts Exit
*****************************************************************************
*** Strings ***
*****************************************************************************
StartText dc.b "Counting for 10 seconds.",13,10,0
EndText dc.b "Done.",13,10,"Press any key to exit.",0
*****************************************************************************
*** End of file TIMER.ASM. ***
*****************************************************************************