??? 11/26/06 04:10 Read: times |
#128512 - My comments Responding to: ???'s previous message |
Mohammed, if i am to understand you correctly, you want PULSES to be a 16 bit counter rather than a 8 bit counter. Firstly, if this is the case, doing the multiply is unecessary as you would simply use the value 500 instead of 250. The code that you posted is a mish-mash of some sample code I expect. It does not make sense to me! I would suggest you do some reading on assembler programming, as I feel you have not grasped some fundamental concepts. Anyway, if you want to do a 16 bit loop counter, here is one method... mov PULSES,#.LOW(500) mov PULSES+1,#.HIGH(500) ;load count loop: djnz PULSES,lp1 ;low-- dec PULSES+1 ;if low==0,high-- lp1: mov a,PULSES ;get low orl a,PULSES+1 ; low | high jnz loop ;if counter is not equal to 0 PULSES .DS 2 ;PULSES now occupies 2 bytes |