Propeller Manual

Table Of Contents
2: Spin Language Reference – PAR
Propeller Manual v1.1 · Page 179
In the example above, the Main method launches the Process assembly routine into a new cog
with
COGNEW. The second parameter of COGNEW is used by Main to pass the address of a
variable,
Shared. The assembly routine, Process, retrieves that address value from its PAR
register and stores it locally in
Mem. Then it performs some task, updating its local ValReg
register (created at the end of the
DAT block) and finally updates the Shared variable via
wrlong ValReg, Mem.
T
In Propeller Assembly, the PAR register is read-only so it should only be accessed as a source
(s-field) value (i.e.,
mov dest, source).