Platforms vs architectures
What is the difference between something which is described as a platform, and a microcontroller/architecture?
For example, some codes are platform-independent and architecture specific. What does that mean? Can a code be architecture-independent but platform-specific?
I also read that sometimes platform and chip level code is mixed. What does that mean exactly? How is portability issue solved if platform and chip level code is mixed?
If a library is created for a specific operating system, what part of it would you need to change so that it can work with a microcontroller such as the Arduino 8-bit AVR platform? How can I make a library that can be compiled for any operating system or microcontroller as desired?
Any help is appreciated.