PDA

View Full Version : Looking for a good MASM Timer


zoopa_man
12-05-01, 07:13 PM
It's come to that time in the simester where everyone in my assembly class has to do a final projct. My plan for a final projct is to do a very simple Hello Screen, have the user press enter. Then let my program run it's self...which will be a series of skateboarders going accrost the screen. My intent is to position the cursor, draw the ASCII art picture of the skater, pause, then clear the screen, move the cursor and start the process over again until the skater has gone accrost the screen.

What I need is a timer that works with MASM 611 and will allow me to do incriments of less then one second. I know that there is a timer built into the Irvine library...but the smallest value it will take is one second, at that speed my animation is too jumpy. Does anyone know of a good timer that I can use to get frame speeds of less then 1 second ?

Web Links or sample code would be appreciated
Write my program for me and i'll love you forever :D

XprincoX
12-05-01, 07:20 PM
LOL!! dang.. least u didn't have to write a scientific calculator in asm... :D

zoopa_man
12-10-01, 11:44 AM
??????? BUMP

Krusty
12-19-01, 12:49 AM
Wish I could tell you. I made a quick attempt at making a timer in MASM, but it failed miserably. My solution was to make sure I write the program and execute it for the grade on a computer with the same speed processor. I just stuck a massive for loop nested in another massive for loop, nested in another for loop to get the timing right.

About a week after that project, the teacher told us in class how to do it, but I can't remember at the moment. It's in my notes somewhere, but my notes are 70 miles away.:(

Vovan
12-19-01, 02:54 AM
Buy or take in the library a book that is called something like ´Hardware resources´. When I was , say, 15 I wrote the code in C, a starwars prototyp. There is a special timer chip onboard every PC and it is very programmable and only in assembler. It has some functions and several speeds.
Or you can go to ID SOFTWARE and download there Wolfenstein(!) code. There is A TIMER.


If you think that you can write the timer thru loops, you are wrong. loops work pretty cool on 4 multipipelined processors like Athlon and P Pro. they are predicted and VERY FAST executed if the contain the same or logicaly predictable info.




P:S:
Yeah, after the reprogramming do not forget to set timer to the original speed, or several thousand years will pass in several hours and you will have a Year 2 Billion problem :p :p
HAPPY CODING!