Shop OBEX P1 Docs P2 Docs Learn Events
byte-word-longmove transfer times — Parallax Forums

byte-word-longmove transfer times

Erik FriesenErik Friesen Posts: 1,071
edited 2008-07-18 21:16 in Propeller 1
How many cycles, or hub cycles does the *move instruction use? Is it essentially a series of rd* wr* asm instructions?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-18 20:22
    The move instruction does not use hub memory. It's strictly a cog memory instruction and takes 4 clock cycles like most of them. RDxxxx and WRxxxx are the only instructions that move data between cog memory and hub memory (other than COGNEW/COGINIT).
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-07-18 20:30
    I am referring to the spin byte, word or longmove instruction. I would like to know which instructions the spin interpreter is using.

    It has to do with saving memory to a fram without corrupting high and low order bytes in a word or long.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-18 21:16
    You'd have to look at the Spin interpreter source to verify, but I believe BYTEMOVE uses RD/WRBYTE, WORDMOVE uses RD/WRWORD, and LONGMOVE uses RD/WRLONG. These are not indivisible operations though since Spin uses no locks internally and the Spin interpreter has to do a RDLONG, then an ADD, then a WRLONG, then an ADD, then probably a DJNZ for the count. This would take at least 2 hub cycles per transfer.
Sign In or Register to comment.