4 ms·
Assembly was never portable, or do you think 6502 on Apple would work out of the box in a Gameboy or C64?
by pjmlp 5mo ago
Assembly was never portable, or do you think 6502 on Apple would work out of the box in a Gameboy or C64?
- whobre 5mo agoIn 1981, one could write a z80 assembly program for cp/m and it would run on thousands of different computer models.
- steve1977 5mo agoof different CP/M computer models though, no?
- pjmlp 5mo agoAs someone that was alive back then already, only if you never touched the hardware directly outside the CPU. Even the PC clones didn't had something like portable Assembly if you ventured outside 0x10h and 0x21h interrupts.
- whobre 5mo agoRight. I am saying there is a difference between portable and non portable assembly code. If you interacted with the machine via call 05h interface, it was portable. If you accessed computer’s video memory buffer directly it wasn’t.
- MomsAVoxell 5mo agoGood portable assembly would stub the system stuff off, anyway, and once that was done for the cpu class in focus, it was very possible to have a thin HAL and write portable code. A great deal many successful products of the era were written in pure assembly this way. 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 ..
- MomsAVoxell 5mo agoI did it many times on CP/M and also DOS. Never ‘touching the hardware’ was attainable for a great deal many assembly programs. You could do a lot with 0x10h and 0x21h on DOS.
- pjmlp 5mo agoYes, not much for games though.
- MomsAVoxell 5mo agoOh sure, TSR’s for the logic, BIOS for the graphics calls, and your own lib to wrap it up and make it portable ..
- foldr 5mo agoThe article is perfectly clear: > The good news is that it is very easy to write assembly which targets Apple’s computers as well as the other 64-bit ARM devices running operating systems other than Darwin.
- pjmlp 5mo agoAs long as nothing outside the CPU itself gets used.
- foldr 5mo agoObviously. Who could possibly be writing ARM assembly code who is not also aware that system calls, etc. will vary across platforms? Sometimes you do seem to make negative comments just for the sake of it.
- pjmlp 5mo agoSo it isn't portable after all...
- foldr 5mo agoIf you can understand what someone means when they talk about a “small elephant”, then you can understand what they mean when they talk about “portable assembly”. In this case, the relevant point is that you can write ARM64 assembly routines that do useful work (e.g optimized matrix multiplication, or something like that) in such a way that they’ll work correctly on a number of different ARM64 platforms.
- mdp2021 5mo agoThere are portable (or not) software applications, portable algorithms code, non-portable algorithm code. Assembly based software for the Motorola 68000 /and/ the Amiga will not run on a 68000 Mac. A "polynomial based packed fastSin()" subroutine written using the XMM x64 registers will work on most x86 CPUs. The same written for the ZMM registers will not work on a number of x86 CPUs. Surely 40 years ago we could easily assume talking about specific implementations of software applications; clearly today we see problems as being optimizable on some classes of platforms (e.g. the vectors in ARM work differently from the vectors in x64 CPUs).
- tieze 5mo agoWould be tricky to have your 6502 code running on a Game Boy as it has a Z80/8080.
- pjmlp 5mo agoShould have said NES.