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.
My Prop boards: P8XBlade2 , RamBlade , CpuBlade , TriBlade
P1 Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
P1: Tools (Index) , Emulators (Index) , ZiCog (Z80)
P2: Tools & Code , Tricks & Traps

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
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • Cluso99Cluso99 Posts: 15,548
    edited 2019-03-24 - 11:56:31
    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.
    My Prop boards: P8XBlade2 , RamBlade , CpuBlade , TriBlade
    P1 Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    P1: Tools (Index) , Emulators (Index) , ZiCog (Z80)
    P2: Tools & Code , Tricks & Traps
  • 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.

    FlexGUI, a GUI for programming the P1 and P2 in Spin, PASM, BASIC, and C.
    Help support its development at Patreon or PayPal.
  • 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.
    My Prop boards: P8XBlade2 , RamBlade , CpuBlade , TriBlade
    P1 Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    P1: Tools (Index) , Emulators (Index) , ZiCog (Z80)
    P2: Tools & Code , Tricks & Traps
Sign In or Register to comment.