Shop OBEX P1 Docs P2 Docs Learn Events
PropTool binary files — Parallax Forums

PropTool binary files

Hi All.
Recently i went back to an old P2 project which includes some PASM binary "blobs".
After generating some new binaries and dropping them into my code things broke.
After some detective work i discovered that the binaey is preceeded with an extra 16 longs of code.
Here's a disassembly of the code.

0000: FD601A00                  HUBSET $D
0004: FD60181F                  WAITX $C
0008: FD601C00                  HUBSET $E
000C: F607F040                  MOV PTRA,#$40
0010: F607F200                  MOV PTRB,#$0
0014: FCD8080F                  REP #$4,$F
0018: FD67FE29                  SETQ2 #$1FF
001C: FB040161                  RDLONG $0,PTRA++
0020: FD67FE29                  SETQ2 #$1FF
0024: FC6401E1                  WRLONG $0,PTRB++
0028: 00000000                  NOP 
002C: FCEC0000                  COGINIT #$0,#$0
0030: 00030D40            _RET_ ROR $186,$140
0034: 01000708            _RET_ ADD $3,$108
0038: 0100070B            _RET_ ADD $3,$10B
003C: 00000001            _RET_ ROR $0,$1

I'm assuming this is relates to Chip's debug option.
Anyhow just a heads up so others don't get caught out.

Oz

Comments

  • That code is the clock_setter.spin2 prefix introduced with PNut sometime ago (not sure when v36 or v37), should not do any harm.
    See somewhere in the PNut discussion https://forums.parallax.com/discussion/171196/pnut-spin2-latest-version-v39-parameterization-bug-fixed-no-more-automatic-file-spewing

  • @macca
    In my case it does a lot of harm.
    It changes my clock settings, and shuffles hub ram then kills my already running cog #0.

    Now i am aware of it, my custom loader strips it away. :wink:
    Oz

    .

  • The clocksetter only gets prepended when compiling an ASM-only file in non-debug mode. It really is quite silly.

    I'd recommend just using flexspin for ASM projects. It doesn't do the clock setter thing and has some extra features I consider essential.

  • @ozpropdev said:
    In my case it does a lot of harm.
    It changes my clock settings, and shuffles hub ram then kills my already running cog #0.

    Now i am aware of it, my custom loader strips it away. :wink:

    @Wuerfel_21 said:
    I'd recommend just using flexspin for ASM projects. It doesn't do the clock setter thing and has some extra features I consider essential.

    As a side note, with a bit of self-promotion, with my Spin Tools IDE the clock setter prefix is optional.

  • BTW Pnut supports DEBUG but does not include the clpck setter patch in its binary file.
    That works for me. :smile:

Sign In or Register to comment.