Shop OBEX P1 Docs P2 Docs Learn Events
Request a 'res' compiler warning. — Parallax Forums

Request a 'res' compiler warning.

James NewmanJames Newman Posts: 133
edited 2012-02-20 08:29 in Propeller 1
It would be nice if the ide or compiler would output some sort of warning when you have a 'res' anywhere before the end of the asm.

Yep, just copy-pasted a few asm routines from an old project, and spent hours trying to figure out why it was locking up my cog. Had a rogue res trampling all over my code.

In the back of my head I knew it was a possible problem, but it's been a while since I've been acquainted with the prop, and it's an easy thing to miss in a cogs worth of asm. It should be caught by the ide/compiler imo.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-02-19 22:10
    There are times when a res can come before other DAT elements. Usually, though, those subsequent elements are preceded by an intervening org when they involve PASM code. Also, variables and constant tables, meant to be accessible only in the hub can also come after PASM res sections. So I really doubt that it would be possible for the compiler/assembler to distinguish between legitimate occurrences of such a "transgression" and those which accurately represent the programmer's wishes.

    -Phil
  • g3cwig3cwi Posts: 262
    edited 2012-02-20 08:18
    So I really doubt that it would be possible for the compiler/assembler to distinguish between legitimate occurrences of such a "transgression" and those which accurately represent the programmer's wishes.

    -Phil

    It could issue an advisory statement perhaps?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-20 08:29
    The compiler could expect a fit statement after res.

    This is one of few common mistakes, I don't have a problem with. I always think of res as meaning "end of PASM section".
Sign In or Register to comment.