Changeset 155 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/Timer.asm
- Timestamp:
- May 1, 2011, 6:44:29 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/Timer.asm
r150 r155 6 6 7 7 ;-------------------------------------------------------------------- 8 ; HTimer_InitializeTimeoutWithTicksInCX8 ; Timer_InitializeTimeoutWithTicksInCL 9 9 ; Parameters: 10 ; C X: Timeout value in system timer ticks10 ; CL: Timeout value in system timer ticks 11 11 ; DS: Segment to RAMVARS 12 12 ; Returns: … … 16 16 ;-------------------------------------------------------------------- 17 17 ALIGN JUMP_ALIGN 18 HTimer_InitializeTimeoutWithTicksInCX:19 mov [RAMVARS. wTimeoutCounter], cx ; Store timeout ticks18 Timer_InitializeTimeoutWithTicksInCL: 19 mov [RAMVARS.bTimeoutTicksLeft], cl ; Ticks until timeout 20 20 call ReadTimeFromBdaToCX 21 add [RAMVARS.wTimeoutCounter], cx ; End time for timeout21 mov [RAMVARS.bLastTimeoutUpdate], cl ; Start time 22 22 ret 23 23 24 24 25 25 ;-------------------------------------------------------------------- 26 ; HTimer_SetCFifTimeout26 ; Timer_SetCFifTimeout 27 27 ; Parameters: 28 28 ; DS: Segment to RAMVARS … … 34 34 ;-------------------------------------------------------------------- 35 35 ALIGN JUMP_ALIGN 36 HTimer_SetCFifTimeout:36 Timer_SetCFifTimeout: 37 37 call ReadTimeFromBdaToCX 38 cmp [RAMVARS.wTimeoutCounter], cx 38 cmp cl, [RAMVARS.bLastTimeoutUpdate] 39 je SHORT .StillPollingTheSameTick 40 mov [RAMVARS.bLastTimeoutUpdate], cl 41 sub BYTE [RAMVARS.bTimeoutTicksLeft], 1 ; DEC does not update CF 42 .StillPollingTheSameTick: 39 43 ret 40 44 … … 44 48 ; RTC resolution is 977 microsecs. 45 49 ; 46 ; HTimer_DelayMicrosecondsFromAX50 ; Timer_DelayMicrosecondsFromAX 47 51 ; Parameters: 48 52 ; AX: Number of microsecs to wait … … 52 56 ; AX 53 57 ;-------------------------------------------------------------------- 54 HTimer_DelayMicrosecondsFromAX:58 Timer_DelayMicrosecondsFromAX: 55 59 %ifndef USE_AT 56 60 mov ax, 2 … … 69 73 pop dx 70 74 mov ax, 1 ; Prepare to wait 1 timer tick 71 jc SHORT HTimer_DelayTimerTicksFromAX ; Event Wait was unsupported or busy75 jc SHORT Timer_DelayTimerTicksFromAX ; Event Wait was unsupported or busy 72 76 ret 73 77 %endif … … 78 82 ; will occur at 54.9 ms intervals. 79 83 ; 80 ; HTimer_DelayTimerTicksFromAX84 ; Timer_DelayTimerTicksFromAX 81 85 ; Parameters: 82 86 ; AX: Number of timer ticks to wait … … 86 90 ; AX 87 91 ;-------------------------------------------------------------------- 88 HTimer_DelayTimerTicksFromAX:92 Timer_DelayTimerTicksFromAX: 89 93 sti ; Make sure that interrupts are enabled 90 94 call ReadTimeFromBdaToCX … … 93 97 call ReadTimeFromBdaToCX 94 98 cmp cx, ax 95 j bSHORT .WaitLoop ; Loop until end time is reached99 jne SHORT .WaitLoop ; Loop until end time is reached 96 100 ret 97 101
Note:
See TracChangeset
for help on using the changeset viewer.