$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) '/*------------------------------------------------------------------*/ $CODE SEG "MLIB1" '/*------------------------------------------------------------------*/ SUB MDelay(count AS WORD) PUBLIC ! les di, count ; ES:DI points to count ! mov cx, es:[di] ; cx = # of milliseconds to wait ! mov dx, 986 Milli: ! in al,dx ! and al,8 ! test al,8 ! jz Milli ! loop Milli END SUB '/*------------------------------------------------------------------*/ ' PRINT MTIMER ' MDELAY 50000 ' PRINT MTIMER ' INPUT Z '/*------------------------------------------------------------------*/