Shop OBEX P1 Docs P2 Docs Learn Events
Ram in SX/B — Parallax Forums

Ram in SX/B

natpienatpie Posts: 35
edited 2009-01-28 14:44 in General Discussion
I am just finally getting around to learning SX/B. I am finding some features I really like, but I am having a little trouble figuring out how to setup my variables in SX/B and still use ASM. I"m still using a lot of assembly in my code, and I can't seem to figure out a good way to control the address of my variables. In assembly i simply use an ORG command with an address and follow that with my string of variable ds and size. As i am trying to use more than the first 20 ram slots I need to know what bank my variables are in (preferable assigning variables used in a specific task to a specific bank). Is there a way to exercise this control over my variables in SX/B?

Okay I've found the thread that recommends:
thing1   var   byte(16)
var1   var  thing1(0)
var2   var   thing1(1)



This seems to be accomplishing what I am after, however it seems to skip $10 to $1F and Start at $30.

Post Edited (natpie) : 1/28/2009 4:33:21 AM GMT

Comments

  • BeanBean Posts: 8,129
    edited 2009-01-28 12:24
    Natpie,
    · Addresses up to $1F are used for the "normal" non-array variables.
    · Arrays start at $30 to the end of RAM (except a couple bytes at the very end).
    · SX/B doesn't conform easily to ASM. You need to make your ASM conform to SX/B's memory map.

    P.S. The new SX/B 2.0 makes doing this alot easier as you can alias variables to an exact address.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ·The next time you need a hero don't look up in the sky...Look in the mirror.


    ·
  • natpienatpie Posts: 35
    edited 2009-01-28 14:44
    Bean said...
    SX/B doesn't conform easily to ASM. You need to make your ASM conform to SX/B's memory map.
    I'm hoping it will still be worth the effort. I've just started using SX/B and I really enjoy it doing a lot of the heavy lifting for me, but I can't stop myself from throwing in some ASM, especially for Virtual Peripherals. The other issue that scares me is not knowing where my code is. I imagine i could cross a page boundary in a block of ASM code and not even know it. I suppose its not too terrible, I should see it rely quickly when I compile it.
    Bean said...
    P.S. The new SX/B 2.0 makes doing this alot easier as you can alias variables to an exact address.
    I was considering putting off learning SX/B until 2.0 came out. Eventually I figured I probably wouldn't have to change my ways too much when it is released. 1.5 has already taught me a few new tricks just by examining how it does things.
Sign In or Register to comment.