How do you think we used to create portable software across 8 bit and 16 bit platforms?
Most of it actually written in Assembly.
Most of it actually written in Assembly.
Magnitudes easier to shim and support multiple architectures.
It is all about design a good application architecture from the get go.
If you must run on every platform for whatever reason, there is Rust, C, C# (Xamarin), etc.