Shop OBEX P1 Docs P2 Docs Learn Events
Execution time of multiple rdlong instructions — Parallax Forums

Execution time of multiple rdlong instructions

Chuck McManisChuck McManis Posts: 65
edited 2008-02-08 05:48 in Propeller 1
Reading 6 longs in assembly?

Is there a definitive amount of time the sequence
                      mov           r1, PAR
                      RDLONG     foo9, r1
                      add            r1,#4
                      RDLONG     foo1, r1
                      add            r1,#4
                      RDLONG     foo2, r1
                      add            r1,#4
                      RDLONG     foo3, r1
                      add            r1,#4
                      RDLONG     foo4, r1
                      add            r1,#4
                      RDLONG     foo5, r1
                      add            r1,#4
                      RDLONG     foo6, r1



Will take? Is it 26 * 6 cycles ? (that would be kinda bad)

--Chuck

Post Edited (Chuck McManis) : 2/8/2008 4:25:24 AM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-08 05:35
    The first RDLONG will take from 7 to 22 clock cycles depending on where the HUB timing is in relation to the start of the RDLONG instruction. Each subsequent RDLONG will execute every 16 clock cycles. The ADD instructions get absorbed into the 9 available clock cycles between each pair of RDLONGs.

    In your case, it takes 6 x 16 plus from 7 to 22 clock cycles plus 4 clock cycles for the first MOV. That's 107 to 122 clock cycles.
    If this is in a loop, you might be able to subtract the 4 clock cycles for the first MOV since it might be absorbed into the HUB synchronization time related to the previous HUB access.

    Post Edited (Mike Green) : 2/8/2008 5:42:03 AM GMT
  • Chuck McManisChuck McManis Posts: 65
    edited 2008-02-08 05:48
    Thanks Mike.

    --Chuck
Sign In or Register to comment.