'*****************************************************************************
'* INT 08H (BIOS) HARDWARE SYSTEM TIMER (IRQ0)
'* Params: -
'* Result: -
'*****************************************************************************

dim i as integer, k as integer, n as integer

public function EINT_08H as boolean

 'Read old timer counter from BIOS data area (40h:6Ch..6Fh)
 k=mem.Dword(0x46C)+1 'and increment it

 'Update counter of days (if needed) at BIOS data area (40h:70h)
 if k>=0x1800B0 then : mem.Byte(0x470)=mem.Byte(0x470)+1 : k=0 : end if

 'Write new timer counter to BIOS data area (40h:6Ch..6Fh)
 mem.Dword(0x46C)=k

 'Decrement FDD motor waiting counter at BIOS data area (40h:40h)
 k=mem.Byte(0x440) : if k>0 then : k=k-1 : mem.Byte(0x440)=k : end if

result=true : end
