По моему это гениально

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From Russian to

Threaded View


..............
wait10ms:
 rcall wait5ms          ;5ms    7+x return addresses
;proceed with wait5ms   ;+5ms
wait5ms:
 rcall wait1ms          ;1ms    6+x return addresses
;proceed with wait4ms   ;+4ms
wait4ms:
 rcall wait1ms          ;1ms    6+x return addresses
;proceed with wait3ms   ;+3ms
wait3ms:
 rcall wait1ms          ;1ms    6+x return addresses
;proceed with wait2ms   ;+2ms
wait2ms:
 rcall wait1ms          ;1ms    6+x return addresses
;proceed with wait1ms   ;+1ms
wait1ms:


wait500us:


wait400us:


wait300us:


wait200us:


wait100us:


wait50us:


wait40us:


wait30us:


wait20us:



 *  - rcall needs 3 clock cycles
 *  - ret needs 4 clock cycles
*/
wait10us:               ;       1+x return addresses


#if CPU_FREQ == 8000000
;8MHz: clock cycle 125ns        x = 2







;wait10us


wait5us:


wait4us:

;proceed with wait3us   ;+3us
wait3us:


wait2us:


wait1us:

#endif

ret



0000784e <wait10ms>:
;proceed with wait10ms  ;+10ms
wait10ms:
 rcall wait5ms          ;5ms    7+x return addresses
    784e:       00 d0           rcall   .+0             ; 0x7850 <wait5ms>
00007850 <wait5ms>:
;proceed with wait5ms   ;+5ms
wait5ms:
 rcall wait1ms          ;1ms    6+x return addresses
    7850:       03 d0           rcall   .+6             ; 0x7858 <wait1ms>
00007852 <wait4ms>:
;proceed with wait4ms   ;+4ms
wait4ms:
 rcall wait1ms          ;1ms    6+x return addresses
    7852:       02 d0           rcall   .+4             ; 0x7858 <wait1ms>
00007854 <wait3ms>:
;proceed with wait3ms   ;+3ms
wait3ms:
 rcall wait1ms          ;1ms    6+x return addresses
    7854:       01 d0           rcall   .+2             ; 0x7858 <wait1ms>
00007856 <wait2ms>:
;proceed with wait2ms   ;+2ms
wait2ms:
 rcall wait1ms          ;1ms    6+x return addresses
    7856:       00 d0           rcall   .+0             ; 0x7858 <wait1ms>
00007858 <wait1ms>:
;proceed with wait1ms   ;+1ms
wait1ms:

    7858:       00 d0           rcall   .+0             ; 0x785a <wait500us>
0000785a <wait500us>:

wait500us:

    785a:       03 d0           rcall   .+6             ; 0x7862 <wait100us>
0000785c <wait400us>:

wait400us:

    785c:       02 d0           rcall   .+4             ; 0x7862 <wait100us>
0000785e <wait300us>:

wait300us:

    785e:       01 d0           rcall   .+2             ; 0x7862 <wait100us>
00007860 <wait200us>:

wait200us:

    7860:       00 d0           rcall   .+0             ; 0x7862 <wait100us>
00007862 <wait100us>:

wait100us:

    7862:       00 d0           rcall   .+0             ; 0x7864 <wait50us>
00007864 <wait50us>:

wait50us:

    7864:       03 d0           rcall   .+6             ; 0x786c <wait10us>
00007866 <wait40us>:

wait40us:

    7866:       02 d0           rcall   .+4             ; 0x786c <wait10us>
00007868 <wait30us>:

wait30us:

    7868:       01 d0           rcall   .+2             ; 0x786c <wait10us>
0000786a <wait20us>:

wait20us:

    786a:       00 d0           rcall   .+0             ; 0x786c <wait10us>
0000786c <wait10us>:




;wait10us

    786c:       00 d0           rcall   .+0             ; 0x786e <wait5us>

0000786e <wait5us>:

wait5us:

    786e:       03 d0           rcall   .+6             ; 0x7876 <wait1us>
00007870 <wait4us>:

wait4us:

    7870:       02 d0           rcall   .+4             ; 0x7876 <wait1us>
00007872 <wait3us>:
;proceed with wait3us   ;+3us
wait3us:

    7872:       01 d0           rcall   .+2             ; 0x7876 <wait1us>
00007874 <wait2us>:

wait2us:

    7874:       00 d0           rcall   .+0             ; 0x7876 <wait1us>
00007876 <wait1us>:

wait1us:

    7876:       00 00           nop
 nop
 nop                    ;500ns
#endif

 ret
    7878:       08 95           ret
...............




По моему это гениально




 AA> ..............




Re: По моему это гениально












Site Timeline