$if 0 MicroDelay para PowerBASIC by Jose Mejuto, 1995 Uso: - Activar cuenta con StartClockDelay - Llamar a MicroDelay con un valor de pausa comprendido entre 0 y 65535 en formato WORD. El valor es equivalente a: Pausa=MicroDelayValue/1193180 segundos ---------------------------------------------------------------------- MicroDelay for PowerBASIC by Jose Mejuto, 1995 Usage: - Activate count with StartClockDelay - Call MicroDelay with a pause value 0 >= Pause >= 65535 in WORD format, using this formula: Pause=MicroDelayValue/1193180 seconds Released to Public Domain $EndIf ' Ejemplo Cls Print "Waiting "; StartClockDelay For Conta=1 to 1909 Print "."; MicroDelay 1000 Next Print "End"; End Sub StartClockDelay Sound 0,0 ! Push AX ! In AL,&H61 ! AND AL,&B11111101 ! OR AL,1 ! Jmp DelayLabel1 DelayLabel1: ! Out &H61,AL ! Mov AL,&B10110100 ! Jmp DelayLabel2 DelayLabel2: ! Out &H43,AL ! Pop AX End Sub Sub MicroDelay ( ByVal Retardo as WORD ) ' Retardo es la duraciín de la pausa en 1/1193180 segundos ! Mov AX,Retardo ! Push AX ! Add AX,135 ! Cli ! Out &H42,AL ! Mov AL,AH ! Db &HEB ! Db &H00 ! Out &H42,AL ! Db &HEB ! Db &H00 ! In AL,&H61 ! Xor AL,1 ! Db &HEB ! Db &H00 ! Out &H61,AL ! Xor AL,1 ! Db &HEB ! Db &H00 ! Out &H61,AL ! Sti ! Db &HEB ! Db &H00 RetardandoDelay: ! Mov AL,&B10000000 ! Out &H43,AL ! Db &HEB ! Db &H00 ! In AL,&H42 ! Mov AH,AL ! Db &HEB ! Db &H00 ! In AL,&H42 ! Xchg AH,AL ! Cmp AX,135 ! Ja RetardandoDelay ! Pop AX End Sub