Timer interrupt

Hi friends,



I have a quey here.

Recently, I am supposed to program a real time clock to be displayed on

the screen.

The program will accept users' input of hours, minutes, and seconds.

then i will increment from there and so implementing a displayed clock.


the problem now is that my clock runs differently on different PC systems.

sometimes faster sometimes slower...


so i suspect i may have to hook my own ISR to INT 8h or INT 1ch i dun know...

may i get help in doing this ??


can this be done in assembly language, C language or inline assembly ??


Please reply if you know this area. I desperately need some advice !!!!



help appreciated :)




Comments

  • Hi!


    You may hook interrupt 8 (also called IRQ 8) or interrupt 1Ch. They're both called 18.2 times per second, but you may increase the frequency of INT8.

    Every time IRQ0 occures, INT 8 and later INT 1Ch is called. I have no idea if it's better to hook INT 8 or 1Ch.

    Don't forget to call the old ISP when hooking an INT! IF you increase the frequency, the old one should/must (?) be called only with 18.2 Hz.


    your own ISP may look like this (in ASM)


    NEW_INT_8:

    ;save all registers!

    pusha

    ...

    ;display clock...

    ...

    ;restore all registers

    popa

    ;now jump to the old INT8-owner

    jmp far cs: dword ptr OLD_INT_8_VECTOR


    ;here the old INT8 vector is stored

    OLD_INT_8_VECTOR dd 0


    I hope I could help you,


    blackbird





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories