Wednesday, November 08, 2006

in a constrained environment


for my fellow geeks in the world of 0s and 1s, these are some of the things that i find interesting when doing programming in a constrained environment:

① consider allocating memory dynamically instead of on the stack.
don't forget to free what you allocated!

② a smashed stack is a very difficult problem to debug! be sure to keep your stack size below 500 bytes.

③ reduce call depths. (remember your 500-byte stack!)

④ consider allocating an INT to hold the length of a character string, instead of making repeated calls to STRLEN().
maybe most of you are already familiar with this, it's true in any kind of platform, i think.

⑤ if your class needs to read or write data, consider using a binary instead of text format.

⑥ data services has a lower priority than other applications that run at UI priority.

there you go!

4 comments:

Anonymous said...

waaaahhhh....good thing i'm not a programmer...u sound so alien cosh...

Romsil said...

hahah! i know deep in ur heart, alien pud ka... hahah... sabay baya ta nakat-on ug for loop ay... hehehh....

Anonymous said...

1. Interrupt handling are done on supervisor mode.
2. System reset is the overlord of all.
3. And that you and me are geeks hehehe....

Sun Jun said...

good tips roms! hehehe
daghan na day ka post o! wa gi.update sa ako google reader wala nuon ko kabasa ^^