Delay question
Delay question
Hello, I want to delay a second, so i am using int 15h 86h to do it...
CX = Number of microseconds to wait (high byte)
DX = Number of microseconds to wait (low byte)
What is the value of CX and DX to delay a second?
Thanks in advance
CX = Number of microseconds to wait (high byte)
DX = Number of microseconds to wait (low byte)
What is the value of CX and DX to delay a second?
Thanks in advance
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Delay question
This reeks of spoonfeeding answers.
What makes that you can not possibly answer this question yourself?
What makes that you can not possibly answer this question yourself?
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Delay question
My god, can you not freaking count?
Google SI prefixes.
Google SI prefixes.
Re: Delay question
I tried working it out:
1 second = 1000000 microseconds
1000000 = F4240h
So CX = Fh And DX = 4240h
CX:DX = 000F4240h
But this is less than a second when i try it
1 second = 1000000 microseconds
1000000 = F4240h
So CX = Fh And DX = 4240h
CX:DX = 000F4240h
But this is less than a second when i try it
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Delay question
Probably cause you're testing in bochs and the clock is running too fast, amirite?
Re: Delay question
I'm using Microsoft Virtual PC 2007
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Delay question
Works fine for me in VPC.
Re: Delay question
I just did this last night. See here: http://artofhacking.com/IET/PRGM/live/aoh_pit.htm
It's in pascal, but shouldn't be hard to translate to something else. The trick is to adjust the tick count each hit, for a second just count out ten hits and then pull the trigger.
But, that is PIT, for a delay you might try CMOS. Hope this helps.
It's in pascal, but shouldn't be hard to translate to something else. The trick is to adjust the tick count each hit, for a second just count out ten hits and then pull the trigger.
But, that is PIT, for a delay you might try CMOS. Hope this helps.
Re: Delay question
thanks for your help, the code was ok, it doesn't work properly on virtual pc, but yes on real hardware
Re: Delay question
Are you talking to me? It works fine in VPC. That's what I use. You might be using the wrong values. Check the link and compare.