Shop OBEX P1 Docs P2 Docs Learn Events
Possible spin2cpp glitch — Parallax Forums

Possible spin2cpp glitch

RaymanRayman Posts: 14,826
edited 2013-03-19 10:43 in Propeller 1
Was just trying spin2cpp and it gave a syntax error on this line:
DAT
fname   byte "i"[12],0

but, it doesn't complain if I do it this way:
DAT
fname   byte 105[12],0

Comments

  • RaymanRayman Posts: 14,826
    edited 2013-03-19 10:27
    Found another thing, this one is really a bug...

    I had this in Spin:
        repeat nd  'do dummy clocks
          outa[ClockPin]~~        'toggle clock
          outa[ClockPin]~
    

    But, normally nd==0 and so the the repeat isn't executed.

    But, Spin2Cpp turns this into a do loop, which always executes at least once:
          int32_t _idx__0028;
          _idx__0028 = Nd;
    
          do {
    
            OUTA = ((OUTA & 0xfffffeff) | 0x100);
    
            OUTA &= ~(1<<Clockpin);
    
            _idx__0028 = (_idx__0028 + -1);
    
          } while (_idx__0028 >= 1);
    
  • ersmithersmith Posts: 6,092
    edited 2013-03-19 10:43
    Thanks for the bug reports, Ray! I'll try to fix these in the next spin2cpp version.

    Eric
Sign In or Register to comment.