Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/24/06 04:43
Read: times


 
#117000 - Russel Sir ... have a look again pl
Responding to: ???'s previous message
Hello Russell Sir,

1027 is just the approximate value i have given ...

The query from my side is ...

In SUBROUTINE 1 ... the extra cycles apart from 256 cycles of value of R7 from 0 to 255 is being considered ...

But in SUBROUTINE 2

SUBROUTINE 2

DELAYHS: ;half second delay above millisecond delay
MOV R6,#00H ;put 0 in register R6 (R6 = 0)
MOV R5,#002H ;put 2 in register R5 (R5 = 2)

LOOPB:
INC R6 ;increase R6 by one (R6 = R6 +1)
ACALL DELAYMS ;call the routine above. It will run and return to here.
MOV A,R6 ;move value in R6 to A
JNZ LOOPB ;if A is not 0, go to LOOPB
DEC R5 ;decrease R5 by one. (R5 = R5 -1)
MOV A,R5 ;move value in R5 to A
JNZ LOOPB ;if A is not 0 then go to LOOPB.
RET


The approx calculation of cycles is taken to be approx 512 ...

so the total delay counted = 512 * 1027 => 525824 MILLISECONDS ...

In the SUBROUTINE 2 why the cycles have been taken to be 512 approx ...

Where the extra cycles apart from incrementing R6 from 0 to 0xFF and decrementing R5 from 2 to 0 have gone ...

why they havent taken to be in the consideration ...

In PINNACLE it is giving approx ... .5 MILLISECONDS ...

but my calculations are giving 3.4 seconds ... approx ...

Sir all the above calculations are approx ...

But ther is the differnce between .5 milliseconds and 3.4 seconds ...

regards
Arvind Shrivastava

List of 8 messages in thread
TopicAuthorDate
wrong calculation of timer delay ...            01/01/70 00:00      
   Comments            01/01/70 00:00      
   Russel Sir ... have a look again pl            01/01/70 00:00      
      Yes I'm looking            01/01/70 00:00      
         Russell Sir ... once again have a look            01/01/70 00:00      
            I'm still looking!            01/01/70 00:00      
   Try this:            01/01/70 00:00      
   Sometimes a Calculator helps            01/01/70 00:00      

Back to Subject List