What is "r-field"?
lardom
Posts: 1,659
in Propeller 1
I'm trying to understand the concept behind the CALL and JMPRET commands. In the Propeller manual under "RET" is this paragraph: RET is a subset of the JMP instruction but with the i-field set and the s-field unspecified. It is also closely related to the CALL and JMPRET commands; in fact, they are all the same opcode but with different r-field and i-field values and varying assembler-driven and user-driven d-field and s-field values.
I understand 'instruction, 'destination' and 'source' fields but 'r-field' is new to me.
I learned from Mike Green that a repeat loop does not return to the caller. That was a major piece of knowledge when I was learning Spin. For example, if you test the state of a pin, a repeat loop may jump to a second method. Once the second method completes it returns control to the first method and the next instruction in the repeat loop executes.
PASM returns to the next instruction without a call stack. I'd like to grasp the concept at least well enough to test it with the Propeller tool.
I understand 'instruction, 'destination' and 'source' fields but 'r-field' is new to me.
I learned from Mike Green that a repeat loop does not return to the caller. That was a major piece of knowledge when I was learning Spin. For example, if you test the state of a pin, a repeat loop may jump to a second method. Once the second method completes it returns control to the first method and the next instruction in the repeat loop executes.
PASM returns to the next instruction without a call stack. I'd like to grasp the concept at least well enough to test it with the Propeller tool.
Comments
As it says, CALL,RET and JMP are really just sugar around the JMPRET instruction (which itself is basically just MOVS, except that instead of S being inserted, it's the current PC+1 and it then jumps to S).
Example:
Also thanks for writing "^=" which means 'bitwise XOR'. I was unfamiliar with this symbol.