| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | zmodem |
BL> I need a really fast way to check time in my timeout loop. BL> At present, I wait for data for a maximum of 500 milliseconds, but BL> at 57600 the data comes in every 200uS and I need a really short loop BL> for Windows, which is a bit twitchy at the best of times. BL> I am reading memory directly at address $0040:$006C which gives me BL> the ticks since midnight and works very well... but it won't work when BL> the vampires come out. BL> Is there another place I can get ticks, or even seconds, as fast as BL> that? I've been searching through Ralf Brown's lists, but there's too BL> much in there and I can't find any-bloody-thing. I was lucky to fluke BL> the ticks. Hi Bob, Are you trying to write something for DOS or Windows ? As each is a different environment, you really can't use the same technique for both. If you're trying to write for Windows, then you shouldn't be looking at 0x0040:006c as Windows has it's own API call which will provide the same information. - I can't recall what it is at the moment (half my library is in storage and it always seems to be the half that I want to look at ), but I'm sure you can find it easily enough. Anyway, why are you looking at a timer to determine how much time has passed ? I'm guessing that you want to be told when to look at the input buffer, is this right ? If so, there are a couple of ways you can do it. In Windows, you can simply get teh COM API to notify you when there are a certain number of characters in the buffer and you don't need to worry about time at all, provided you get to service the buffer before it overflows. In DOS, what you should be doing it hooking an interrupt Int 0x08 and then you will get called every 55m-sec. There is a "trick" with this though because 55-msec is to slow for you, so what you need to do is to speed up the timer and make sure that you pass on the correct Int 0x08 when the right number has rolled around. IOW, you can re-program the timer to give you an Int 0x08 every 200us, but you must keep track of how many times you've been called and on every 275th call you then pass the Interrupt through you to whoever had it before you stole it, then the bloke further down the chain will do his thing and everyone will be happy. But all of this is the HARD way of doing it. Just grab each character as it comes in and stick it in your own buffer. You know how many characters are in the buffer and you service it whenever you need to. I realise that this answer doesn't really give you anything specific but there are quite a few different ways to do whatever it is you are trying to do and you've got to use whatever mechanism you feel will work for you. If you're just trying to tell is a certain amount of time has passed, you might want to have a look at Int 0x1c There is a way you can get it to act like an Alarm, but I forget how now. It's a bit tricky though an may not be suitable, but it could be worth a thought. Regards, Brenton @EOT: ---* Origin: TestPoint (3:711/934.7) SEEN-BY: 711/934 712/610 @PATH: 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.