Kasumi
asked on
Programming the Timer 8253
I want to know how to program the 8253 timer on port 40h-43h. So that I can implement this to the joystick reading procedures, use it as a delay... Everywhere where the timing or delays are needed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why should you replace the original handler?
The assembler code you wrote will correctly update the timer, which is the most important thing the hardware interrupt does.
BUT, If you intend to write your own handler you must acknowledge the interrupt by:
port[$20]:=$20;
The assembler code you wrote will correctly update the timer, which is the most important thing the hardware interrupt does.
BUT, If you intend to write your own handler you must acknowledge the interrupt by:
port[$20]:=$20;
ASKER
Ok. I hate interrupts. They are too slow. And it's a problem in Protected Mode always to warp the int into the 31h.
I want to know, how to use the ports. The ports for the timer
are 40h-43h but I don't know, what info in each port is. Thats what I want to have. A kind of documentation.
So that I know, what I have in each port, how can I set it etc.
Bye
I want to know, how to use the ports. The ports for the timer
are 40h-43h but I don't know, what info in each port is. Thats what I want to have. A kind of documentation.
So that I know, what I have in each port, how can I set it etc.
Bye
ASKER
I forgot:
$Why the port[$20]=$20??
$Why the port[$20]=$20??
I have exact docmentation of the ports of the 8253, but to use it you MUST use interrupts! The 8253 channel 0 generates int 8, channel 1 refreshes the DRAM and channel 2 is for the PC speaker... you *can* start it counting and check its value by using channel 2. Please post your e-mail address or send it to me <alon.a@usa.net> for that file.
The port[$20]:=$20 tells the hardware interrupt manager that the hardware interrupt has been acknowledged, so it can send more hardware interrupts of the smae kind.
ASKER
I don't want to call the int at all.
So let's say that one of the things the interrupthas to do, is increasing the time counter on 0000h:046ch.
So I want to know how to do this.
My guess:
mov dx,40h
insd eax,dx
xor bx,bx
mov es,bx
mov edi,046ch
mov dword ptr es:[edi],eax
I want mz function to replace the int. It desn't need to have EVERYTHING the timerinterrupt has, but the basic functions should be included.