In 1981, one could write a z80 assembly program for cp/m and it would run on thousands of different computer models.
Even the PC clones didn't had something like portable Assembly if you ventured outside 0x10h and 0x21h interrupts.
In any case, you could also get high performance multiplatform video/io assembly libraries on the market, soon enough, back in the day .. it begat a lot of Delphi units too, I seem to recall ..
Never ‘touching the hardware’ was attainable for a great deal many assembly programs.
You could do a lot with 0x10h and 0x21h on DOS.