Welcome to the Propeller 2 Assembly Guides, a complete beginner-friendly repository to programming the Propeller 2 microcontroller in assembly.
- Propeller2 Assembly Beginner Guides Step-by-step instructions for learning Propeller 2 assembly
- Propeller2 Assembly example programs – Clean P2ASM programs corresponding to each guide
- Propeller2 Assembly video demontrations – Videos to help you follow along and understand each example
- Parallax Website – Official Propeller 2 info and documentation
- Parallax Forums – Community discussion and support
- Spin Tools IDE – a development environment for the Parallax Propeller 1 and 2.
- FlexProp – a simple GUI for creating applications for the Parallax Propeller 1 and 2.
- Improved overall document structure for consistency and readability
- Corrected and standardized the IF_A conditional execution section
- Removed outdated reference to the QFRAC command
- Fixed inaccuracies related to DIV instruction behavior
- Improved overall document structure for consistency and readability
- Fixed the initialization sequence for both transmission (TX) and reception (RX) pins when configuring SmartPins. Each pin is now placed into a safe inactive state using DIRL before applying WRPIN and WXPIN settings, then re-enabled with DIRH. This prevents unintended or partial signals during setup and ensures more reliable serial communication.
- Appendix B changed to Propeller 2 Assembly Reference. This appendix provides a categorized reference of Propeller 2 assembly instructions and directives included in this manual, each with a brief description. It is not a complete listing of all instructions, directives, or features supported by the Propeller 2 architecture.
- Appendix A: DEBUG commands that work universally across compilers
- Appendix B: Index of all instructions used in the manual
- Added RQPIN as an alternative to RDPIN
- Added exercises for each chapter
Verified the examples work with the following:
- FlexProp
- PNut
- Spin Tools IDE
- Propeller Tool IDE
- Split the original “Cog Control” chapter into two focused sections: Cog Control and Process Control.
- Cog Control now emphasizes starting, stopping, and managing individual cogs.
- Process Control introduces safe multi-cog coordination using hub memory locks.
- Added example program to demonstrate proper lock acquisition and release, done counters, and independent cog termination.
- Clarified the role of hub memory as the central communication medium between cogs and the main program.
- Fixed all code so res variables for RAM storage are now consistently placed below byte/word/long declarations.
- Tested all programs with FlexProp and the Spin IDE to ensure full compatibility.
- Updated the comparison / if_* Instructions chapter to include the new if_a instruction.
- Added explanation of the wcz flags in the comparison section for clarity.
- Revised the Decimal to String section to include an explanation of the ptra register and its role in memory operations
References to the obsolete simclk variable have been removed from all examples. Timing in spin-wait loops and SmartPin routines now relies entirely on real instruction cycles and the system clock (_CLKFREQ), as handled automatically by the compiler or, optionally, asmclk.
In the “WAITX vs NOP” topic, the previous statement that instructions execute in one clock cycle has been corrected. On final Propeller 2 hardware, all base instructions take two clock cycles. This affects timing calculations for spin-wait loops, SmartPin delays, and bit-banging routines.
All examples now explicitly terminate with:
endprog
jmp #$This prevents execution into variable (res) memory and ensures stable PST behavior.