Shop OBEX P1 Docs P2 Docs Learn Events
P2 Assembly Instruction Size — Parallax Forums

P2 Assembly Instruction Size

I'm probably not seeing something obvious, but I've been getting familiar with the Assembly Manual and am looking at the COGINIT instruction.

The manual says the instruction is 7 bits, D is 6 bits, and it uses the lower 20 LSBs of S. If my math is correct that makes 33 bits. How does that fit into a 32 bit memory location?

Comments

  • The format of Dest is %E_N_xVVV.

    Maybe that do-not-care bit gets ignored when assembled?

  • You're mixing up the size of the instruction vs the size of the data it uses. D and S are always 9 bits and are either a register number or a 9 bit immediate. The immediate encoding can be extended to 32 bits using an AUGS/AUGD prefix.

  • Ah, got it. Thanks.

Sign In or Register to comment.