Hello Every : I use AT89C52 and 11.059MHz oscillator. 1 instuction takes about 1 micro-second.(10^-6 sec.) I write a delay function in *.asm. It works well , but I want it adjustable. I want to delay according to the parameter I pass.My goal is to modify delay time for some protocol time slot testing. I found it some how difficult to achieve. Because the basic instruction , for example : _nop_ , take 1 micro-second. I can't add more decision. It will takes more time. How could I implement such kind of delay? Please give me a hand , thanks a lot~~
I want to delay according to the parameter I pass.My goal is to modify delay time for some protocol time slot testing. For delays this short the only option is inline nop. two possibilities 1) Since you refer to "testing" could you use a conditional assembly. 2) Selecting the routine instead of selecting the delay: do_it_with_1 mov... ... .... ... nop ... ... ... ... ret do_it_with_2 mov... ... .... ... nop nop ... ... ... ... ret Erik
oh, even easier do_it_with_1 MACRO_1 nop MACRO_2 do_it_with_2 MACRO_1 nop nop MACRO2 Erik