Shop OBEX P1 Docs P2 Docs Learn Events
SETR naming — Parallax Forums

SETR naming

Was there any reason to use SETR rather than SETI since it actually modifies the instruction bits, not the result bits ???

BTW I still don't think there was any reason to change SETS/SETD/SETR from MOVS/MOVD/MOVI.

Comments

  • I think the difference is that seti changes the instruction and setr redirects the result.

    setr creates basically a 3 operant instruction

    setr r3
    add r2, r1

    leaves r2 unchanged and r3 is r2+r1

    or something alike this.

    Mike
  • Cluso99Cluso99 Posts: 18,069
    edited 2019-03-24 11:56
    No. You are thinkkng of the ALTx instructions.

    SETR is the same as MOVI on P1. Its in the same family as SETS and SETD (MOVS and MOVD on P1).
    They physically change the register bits typically in an instruction. Must be done with at least 2 more instructions following before the “changed” instruction is executed.
  • Cluso99 wrote: »
    Was there any reason to use SETR rather than SETI since it actually modifies the instruction bits, not the result bits ???
    It modifies the result bits in the pattern used for ALTI. I guess Chip was thinking of that as its primary use, although I suspect at first it will be used more for modifying instruction bits like MOVI used to. But ALTI looks very powerful, and perhaps eventually will be used a lot more.
    BTW I still don't think there was any reason to change SETS/SETD/SETR from MOVS/MOVD/MOVI.

    I kind of like the change, because of the pipeline timing changes -- it makes it clear that when porting code you have to watch out for leaving enough time for self modifying code to work correctly.

  • Cluso99Cluso99 Posts: 18,069
    Eric,
    Yes, I have found that the ALTx instructions work nicely when re-writing P1 code removing most needs for SETx instructions. There are still cases where it's nicer tho. eg changing rd/wr-byte/word/long instructions

    But if you are just converting code to run then the SETx instructions are easiest. And yes the extra instruction needed between the modification is a trap.
Sign In or Register to comment.