Page 1 of 1

Delay question

Posted: Fri May 15, 2009 4:41 pm
by renovatio
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

Re: Delay question

Posted: Fri May 15, 2009 4:55 pm
by Combuster
This reeks of spoonfeeding answers.

What makes that you can not possibly answer this question yourself?

Re: Delay question

Posted: Fri May 15, 2009 4:57 pm
by Troy Martin
My god, can you not freaking count?

Google SI prefixes.

Re: Delay question

Posted: Fri May 15, 2009 5:02 pm
by renovatio
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

Re: Delay question

Posted: Fri May 15, 2009 5:05 pm
by Troy Martin
Probably cause you're testing in bochs and the clock is running too fast, amirite?

Re: Delay question

Posted: Fri May 15, 2009 5:06 pm
by renovatio
I'm using Microsoft Virtual PC 2007

Re: Delay question

Posted: Fri May 15, 2009 5:08 pm
by Troy Martin
Works fine for me in VPC.

Re: Delay question

Posted: Fri May 15, 2009 7:23 pm
by purage
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.

Re: Delay question

Posted: Fri May 15, 2009 7:39 pm
by renovatio
thanks for your help, the code was ok, it doesn't work properly on virtual pc, but yes on real hardware

Re: Delay question

Posted: Fri May 15, 2009 7:43 pm
by purage
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.