Hello, I'm trying to make a simple timing loop which will run more than 255 times. I need 0.1us precision, so I'm using inline asm in a PICbasic program. The number of times the loop will run will vary from 0 to 9999. I'm using a 20MHz clock speed. How can I access the individual bytes of a defined word variable? This is my 'AccuratePause' routine right now. It seems to give a ~4 second pause regardless of the Pause length input. temp var word temp2 var byte AccuratePause: Asm APmpl: movlw 99 movwf _temp2 APlp: decfsz _temp2,1 goto APlp nop nop APdn: decfsz _temp+1,1 goto APmlp decfsz _temp,1 goto APmlp Endasm Return The _temp+1 and _temp are guesses as to how I should access the bytes. I tried flipping them as well with the same results. Thanks in advance for any help you can give. This being my first post; I hope I haven't done anything wrong. Dave -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads