the routine does the following: [...]
Please add this documentation to the source code as a (Doygen) comment.
i don't think that this belongs into the source code. i would rather put it into a separate document that describes the general sizing algorithm. or even in a document that describes the code used for the 430FX.
here is an article on memory sizing: http://www.rcollins.org/articles/memsize/MemSizing.html (please note: the MA table is different for almost every chipset :( and please ignore the bank switching stuff..)
i did fix some more errors in the code btw. and beautified it to fit the coding rules. i'll post a diff or a complete version (depends on the number of changes) soon. Holger