
/* Written by M. Taylor */
/* Delays ms milliseconds running on a HC11 with a 8MHz x-tal */
/* and a timer pre-scale of 16 */

delay(ms) unsigned int ms;{
 unsigned int temp;
 unsigned int time;
 for(temp=0;temp<ms;temp++){
  time=peek(REG_BASE+TCNT);
  time+=125;
  poke(REG_BASE+TOC4,time);
  while( !(peekb(REG_BASE+TFLG1) & 0x10) );
  pokeb( REG_BASE+TFLG1,0x10 );
 }
}
