well it just reads the data from the system clock on the mainboard
it does that on timer interrupts.
and for a while I had it print the time to the screen, so I had a textmode-clock. But it conflicted with the textmode mouse pointer...
if I moved the mouse pointer over it and waited, it would overwrite the mousepointer in the next iteration (so it was "gone") and since the mousepointer always inverted the current color, moving it away then made the digit black-on-white until the next iteration