This power-saving function tests a specified byte in either System RAM or in I/O space as a condition for return to the caller. A timeout may also be specified.
If the condition code (in register AL) is invalid, this function immediately returns to the caller with CARRY = 1.
If the condition code is valid, the function enters the light sleep and waits for a wakeup event. Periodic timer (both TIMER0 and TIMER1) wakeups, as well as keyboard and other hardware events occur to bring the CPU into a temporary RUN State. Every wakeup causes the specified condition as well as timeout to be tested for a possible return to the caller. If the condition is true, the function returns with CARRY=0. If the return timeout occurs, the function returns with CARRY=1. The return timeout (in BL) can vary between 1 and 255 TIMER0 ticks (55 msecs per tick). If BL=0, return timeout is disabled. The value in BL is recorded in HALTVAL (40h:7Bh). The TIMER0 interrupt service decrements HALTVAL, and the return timeout condition is satisfied when HALTVAL=0.
This function will also enter the Deep Sleep state if Auto-Timeout occurs and there is no AC Adaptor installed. On wakeup from the Deep Sleep state, this function will return to the caller with CARRY=1 just as if the specified timeout had expired.
00h - Wait for any interrupt (Light Sleep till next int)
01h - Compare RAM byte with BH, return when equal to BH
02h - Compare RAM byte with BH, return when not equal to BH
03h - Test RAM byte with BH mask, return when not equal to 0
04h - Test RAM byte with BH mask, return when equal to 0
10h - Wait for any interrupt (Light Sleep till next int)
11h - Compare I/O byte with BH, return when equal
12h - Compare I/O byte with BH, return when not equal
13h - Test I/O byte with BH, return when not equal to 0
14h - Test I/O byte with BH, return when equal to 0
BH = Value or mask
BL = Timeout value in 55ms intervals; 0 = Timeout disabled
Plus Either:
ES:DI = Pointer to byte in memory to test (AL=1-4)
DX = I/O port (AL = 11h-14h)
OKRET: CARRY <-- 0. go to WtEventExit
WtEventExit: Clear Annunciators, INTLST <-- 0, Exit.
Notes: