Shop OBEX P1 Docs P2 Docs Learn Events
Is there a pasm command to pad data? — Parallax Forums

Is there a pasm command to pad data?

Dr_AculaDr_Acula Posts: 5,484
edited 2011-09-16 07:38 in Propeller 1
Quick question - I have a piece of pasm code and I have a 'fit 496' at the end. Is there an instruction that I can add in pasm code that pads out my code so it always takes 496 (or 495) longs?

The reason is that I have a huge screen buffer and I am working on putting all the cog load code into this buffer, loading them into the cog and then recycling the screen buffer.

If my screen buffer is n bytes long, and I then put some cog code in that buffer that is x bytes long, I then need to subtract x from n from the screen buffer (otherwise this doesn't save anything!).

At the moment I'm determining the cog size by trial and error, but I was just wondering if I could ensure that the cog code was always a known size.

Any help would be most appreciated.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-16 07:00
    I'm not at my shop computer, so can't try it, but maybe:
            long 0[496 - $]
    

    -Phil
  • Heater.Heater. Posts: 21,230
    edited 2011-09-16 07:01
    If I remember correctly the $ sign gets you the current address you are filling in your PASM block.
    So declare an array of longs at the end of the PASM that has length 496 - $
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-09-16 07:38
    Thanks++, that works.

    Getting some much faster downloads for the 256x224 video driver thanks to this. Cheers.
Sign In or Register to comment.