M mshemyalnisar New Member Nov 24, 2008 #21 thanks pommie...... but 1 thing that i didnt understand is the "this is never executed" bit..... what is that supposed to mean??
thanks pommie...... but 1 thing that i didnt understand is the "this is never executed" bit..... what is that supposed to mean??
P Pommie Well-Known Member Most Helpful Member Nov 24, 2008 #22 If you trace the path of execution you will see that the portion I highlighted (plus the return instruction) never gets executed. Mike.
If you trace the path of execution you will see that the portion I highlighted (plus the return instruction) never gets executed. Mike.
M mshemyalnisar New Member Nov 24, 2008 #23 i got it ............. thanks a heaven....... in another part of the coursework i am required to use delay functions to generate delay of 1sec, 750ms, 500ms and 250ms. can you check that the code i wrote for the delay function is correct?? delay1s movlw D'1249994' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; delay750ms movlw D'937498' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; delay500ms movlw D'624994' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; delay250ms movlw D'312494' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; Click to expand...
i got it ............. thanks a heaven....... in another part of the coursework i am required to use delay functions to generate delay of 1sec, 750ms, 500ms and 250ms. can you check that the code i wrote for the delay function is correct?? delay1s movlw D'1249994' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; delay750ms movlw D'937498' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; delay500ms movlw D'624994' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; delay250ms movlw D'312494' ; movwf D_Ctr1 ; D_L1 nop ; decfsz D_Ctr1 ; goto D_L1 ; nop ; return ; Click to expand...
P Pommie Well-Known Member Most Helpful Member Nov 24, 2008 #24 Your theory is correct as to how you would generate a delay but unfortunately the biggest number that W can hold is 255 and so movlw D'624944' would actually load W with 48. For seeing how longer delays are generated see . One other thing, when posting code if you type Code: before it and after it then it will keep it's format. Mike.
Your theory is correct as to how you would generate a delay but unfortunately the biggest number that W can hold is 255 and so movlw D'624944' would actually load W with 48. For seeing how longer delays are generated see . One other thing, when posting code if you type Code: before it and after it then it will keep it's format. Mike.