Shop OBEX P1 Docs P2 Docs Learn Events
cognew / assembly — Parallax Forums

cognew / assembly

agfaagfa Posts: 295
edited 2008-08-20 22:39 in Propeller 1
where can i find more information on the COGNEW parameter to address a block of memory, or any information on passing more than one 14 bit value to a cog running assembly?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-20 03:00
    The information is primarily in the Propeller Manual in the section on the COGNEW/COGINIT instruction and the Spin COGNEW/COGINIT "function" for starting an assembly routine. In Spin, the 2nd parameter is assumed to be a 14 bit long address (bits 15-2) with the low order 2 bits discarded. This is included in the COGNEW/COGINIT instruction that's executed and the passed value appears in the PAR register when the cog starts up (in bits 15-2 of the PAR register).

    The only way to pass more than this 14 bit value to a cog is to pass the address of a group of longs as the 14 bit value and to use RDLONG (and possibly WRLONG) to access this group of longs (or words or bytes). There are plenty of examples in the form of various objects in the Object Exchange, but you'll have to look through them to see how it's done.
  • agfaagfa Posts: 295
    edited 2008-08-20 22:39
    thanks
Sign In or Register to comment.