Shop OBEX P1 Docs P2 Docs Learn Events
Addressing variations — Parallax Forums

Addressing variations

SeairthSeairth Posts: 2,474
edited 2017-02-24 20:58 in Propeller 2
The "New Spin" thread prompted me to think about the various ways addressing can be done in the P2. Here's what I came up with. Does this look correct to everyone else?
Hub RAM Instructions (WRxxxx/RDxxxx):
- Immediate address
  - Without AUGS:
    - $000-$0FF: Hub addresses $000-$0FF
    - $100-$1FF: PTRx Expression
  - With AUGS:
    - 20-bit hub address
- Indirect address
  - Absolute 9-bit cog address that contains a 20-bit absolute hub address

Branch Instructions (conditional jumps, CALL):
- Immediate address
  - Relative: 9-bit (20-bit with AUGS) signed offset from PC
  - Absolute: 9-bit (20-bit with AUGS) address
  - Default is relative if not switching exec modes, otherwise absolute
  - Can always force absolute
- Indirect address
  - Absolute 9-bit cog address that contains a 20-bit absolute instruction address

Long Branch Instructions (JMP, CALL, CALLA, CALLB) and LOC:
- Immediate address
  - Relative: 20-bit signed offset from PC
  - Absolute: 20-bit address
  - Relative is default
  - Can always force absolute
- No Indirect address

All Other Instructions:
- Immediate value
  - 9-bit (32-bit with AUGD/AUGS) value
- Indirect value
  - Absolute 9-bit cog address that contains a 32-bit value
Sign In or Register to comment.