home *** CD-ROM | disk | FTP | other *** search
- /*
- ┌────────────────────────────────────────────────────────────────────────────┐
- │clock.dmo │
- │Install a clock interrupt handler for Ms/C │
- │ │
- │Notes: This routine eats up tons of memory but it is just an example of │
- │how to write a terminate but stay resident routine in ms/c │
- │ │
- │ (C) JazSoft Software by Jack A. Zucker (301) 794-5950 │
- └────────────────────────────────────────────────────────────────────────────┘
- */
-
-
- #include <jaz.h>
- #include <jzscreen.h>
-
- int clock();
- int gcount = 17; /* clock tic counter */
- #define COPYWRITE "JZCLOCK (C) JazSoft 1986 by Jack A. Zucker @ 301-794-5950 |\
- CIS: 75766,1336"
- #define TIMER 0x1C
-
- main()
- {
-
- int wscan;
-
- jzlogo(); /* paint the logo onto the screen */
-
- cls(CYAN);
- jzscrprn(COPYWRITE,0,0,YELLOW);
-
- jzloccur(2,0);
- printf("This program simply demonstrates how easy it is to");
- printf("\ninstall an interrupt handler in your \"C\" routines.");
- printf("\nSimply declare the user routine as a global function");
- printf("\nand call jzinsint() to install the interrupt.");
- printf("\n\nFor information regarding source code for the JazSoft C Library:");
- printf("\ncall @ 301-794-5950 | 301-794-8763 | CIS: 75766,1336");
- printf("\nor send $25 for the complete library of over 100 functions");
- printf("\nincluding source code!");
- printf("\n-Jaz");
- printf("\n\nPress <Enter> to continue...");
-
- do ; while (jzinkey(&wscan) != 13); /* wait for enter key */
-
- cls(7);
-
- jzinsint(TIMER,clock); /* install the new timer interrupt */
-
- jztrmres(); /* terminate but stay resident */
-
- }
-
- clock()
- {
- char wstr[9];
-
- if (gcount >= 17) {
- jzbiostm(wstr);
- jzscrprn(wstr,0,72,RED);
- gcount = 0;
- }
- else
- gcount ++;
- }
-
-