The actual public API for the kernel doesn't expose hardware details, it abstracts them. The kernel will tell you how many UARTs you have, and ID them by number, but the public interface is the same whether they're built-in to the CPU (As in the W65C265S) or external (as they'd need to be on a 65C02 or 65C816 system). As long as your program only uses public APIs, it should run unmodified on any platform of the same CPU running the same version of the kernel. That's not new, CP/M did that shit in the 70s, but it's not how Commodore did shit, for example.