Shop OBEX P1 Docs P2 Docs Learn Events
simple CMP example not working - Page 2 — Parallax Forums

simple CMP example not working

2»

Comments

  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-12-18 14:50
    In practice the top level object is always offset by 16. But since it's not guaranteed in documentation, it could conceivably change in future versions (i.e. Prop II). Though I'd have thought Parallax would try to avoid it since some programs do make that assumption.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Help to build the Propeller wiki - propeller.wikispaces.com
    Play Defender - Propeller version of the classic game
    Prop Room Robotics - my web store for Roomba spare parts in the UK
  • hippyhippy Posts: 1,981
    edited 2007-12-18 15:32
    I have to admit I've not experimented to see if anything other than +$10/+16 works but I expect it does or there'd be little need to have the offset put in the information block at the start of hub memory.

    I don't know of any cases when the Propeller Tool would generate anything other than +$10/+16 but it could change for future Propeller versions, especially if the information block were to be extended ( cryptography keys, digital signatures, etc ).

    I expect there will be some changes for the Prop II information block as it has 256KB image size, and the current word pointers are not enough.

    Third-party tools are the most likely to use different offsets I would expect. Although LMM environments, C and other virtual machines need a minimal Spin program to launch them and it's usually just a few bytes, it makes a lot of sense to put the Spin code for loading Cogs at the top of memory ( towards $7FFF ) so they start in what will finally become stack/variable space to maximise the amount of memory usage. Put them at $0010 and they use up space which cannot be easily reclaimed later - A 496 long VM interpreter put at $0010 wastes 6% (2KB) of the memory for no good reason.

    Post Edited (hippy) : 12/18/2007 3:37:42 PM GMT
Sign In or Register to comment.