Shop OBEX P1 Docs P2 Docs Learn Events
Out of Space!!! — Parallax Forums

Out of Space!!!

inakiinaki Posts: 262
edited 2005-12-27 18:44 in General Discussion
I went out of space on a SX48. My program is writen in SX/B so I think I could save some space coding in assembler but I see two··problems: first,the code is rather complex to code in assembler (and I am not an expert in SX asm coding)·and second, I have realized that the code generated by the SX/B compiler is already·very good! So I don't think I could improve it much.

The question now is: what to do next ? Recoding everything in assembler ? Perhaps adding a second SX48 and share de tasks between them ? What to do when running out of space ?

By the way, the SX52 has the same space that the SX48, isnt'it ?
·

Comments

  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-12-27 14:58
    Second answer first: The only differences between the SX48 and 52 are the number of I/O pins, and the package, i.e. same size of RAM and program memory.

    First answer next: As you know, program memory is segmented into pages. Hard to believe that all your program memory pages are filled up with code. After compiling the latest version of your program that did not run out of space, have a look at the list file ("Run - View List"). The list file shows you the generated machine code together with the addresses where it is stored in program memory. Hopefully, you'll find some empty space remaining in some pages. For a quick overview, after a compile, you can also do a "Run - Device" which will pop-up the Device window, showing you part of the program memory in hex in the E²Flash section. Scroll through the hex code, and see if there are any areas containing a number of subsequent FFFs. These areas are empty and can be filled with more code.

    Im must admit - I'm not very experienced with SX/B to tel you how to move parts of SX/B-generated code into other pages - maybe, you will have to do this by cut-copy-paste in the generatd assembly code output file but I'm sure someone else with more experience will bail in here - Bean?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    Günther
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-27 18:34
    Bear in mind that SX/B is a non-optimizing compiler, so if you have commands repeated throughout your code, they will take up a lot more code space.· For example, if you have a bunch of SEROUT commands, they will each take up a chunk of code necessary to handle the serial output.· However, if you put that into a subroutine and call it repeatedly, it only gets created once, so it will use a lot less space.· Perhaps you post your code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • BeanBean Posts: 8,129
    edited 2005-12-27 18:44
    Yes please post your code. And Chris is right, in SX/B it's best to put a subroutine "wrapper" around any high-level commands like PAUSE, SEROUT, SERIN, etc.
    If you post your code I'm sure we can figure a way to squeeze it in without resorting to assembler (not that there is anything wrong with assembler).
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Forget about the past, plan for the future, and live for today.
    ·
Sign In or Register to comment.