Shop OBEX P1 Docs P2 Docs Learn Events
FBLOCK feature possibly flawed - Page 2 — Parallax Forums

FBLOCK feature possibly flawed

2»

Comments

  • TonyB_TonyB_ Posts: 2,175

    @Rayman said:
    What if buf1 and buf2 are the same?

    WRFAST writes all its blocks, say M longs. Then FBLOCK writes all its data, say N longs. If M < N, all WRFAST data are overwritten (but see Note below). If M > N, first N longs of WRFAST data are overwritten.

    Note. If buf1/2 are not long-aligned the last 1..3 bytes of WRFAST data are at the start of buf1/2.

  • RaymanRayman Posts: 14,469

    Is there a way to 64 byte align a buffer in Spin2? Think not. Guess one must make the buffers 63 bytes bigger than needed and manually position the buffer address at runtime, right?

    Might also be a problem for PASM2... Or, is a there an alignment keyword for that?

  • TonyB_TonyB_ Posts: 2,175

    @Rayman said:
    Is there a way to 64 byte align a buffer in Spin2? Think not. Guess one must make the buffers 63 bytes bigger than needed and manually position the buffer address at runtime, right?

    Might also be a problem for PASM2... Or, is a there an alignment keyword for that?

    To avoid the issues discussed here, the buffers can be at any address provided they are an integer multiple of 64 bytes apart. They don't have to be 64-byte-aligned.

  • RaymanRayman Posts: 14,469

    Ok, thanks. Good to know.

Sign In or Register to comment.