Shop OBEX P1 Docs P2 Docs Learn Events
Can i spread an instruction over multiple lines? — Parallax Forums

Can i spread an instruction over multiple lines?

JanstrJanstr Posts: 4
edited 2010-02-19 22:57 in Propeller 1
Is it possible in the Propeller tool to spread an (SPIN) instruction over multiple lines. Or similar, can i spread a DAT entry over multiple lines.

For example:

DAT

Mydata byte %10000000, %01000000, %00100000, %00010000,
················· %00001000, %00000100, %00000010, %00000001
Otherdata byte "This is a string"

·

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-19 21:14
    Yes. Put a { at the end of the line and a } at the beginning of the next one. This comments out the CR.

    -Phil
  • lonesocklonesock Posts: 917
    edited 2010-02-19 21:14
    Yes to both: in Spin, you can end a line with { and start the next line with }
    tmp := var_a + {
             } var_b
    
    



    and in the DAT section you can just continue adding data.

    DAT
     
    Mydata byte %10000000, %01000000, %00100000, %00010000
           byte  %00001000, %00000100, %00000010, %00000001
    Otherdata byte "This is a string"
    
    



    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-02-19 21:19
    What's the problem with removing the last comma and put another "byte" in the second line?
    There is no need to have a label in the second line.

    For real long lines of instructions you can split by putting a {{ at the end of line 1 and a }} at the beginning of the next line.
  • JanstrJanstr Posts: 4
    edited 2010-02-19 22:57
    Thanks, I've tried it and it works great.
Sign In or Register to comment.