<
gree...@gmail.com> wrote:
> On Sat, 24 Apr 2021 16:26:37 GMT, sc...@slp53.sl.home (Scott Lurndal) sprachen:
>
>> Writing that in assembler would take decades, and it would be impossible
>> to support
>
> Right! That's the point. There's some stuff that cannot be done in asm.
> Not because of any Turing-related principles, just because
> in the real world, bugs exist, and a programmer's brain can only get so
> hot before it parachutes out of his head.
If you write modular programs, and test the low-level stuff, a big program
is just stringing together a bunch of small modules. Admittedly I don’t
write much assembler these days. It used to be my language of choice on IBM
mainframes.
>
> Yep, emulators are a good example of something that suits asm, at least
> of 8-bit game consoles. It's emulating hardware, that is
> well defined and constant. Lots of little modules doing their thing, then
> reporting back. Well 4 or 5 modules, anyway. They're
> actually way faster than they need to be on modern hardware, he may as
> well have written them in Javascript (and people have!).
> With emulating, the console's hardware is the final arbiter, carved in
> stone. There's only one right way to do things, and you
> have lists of which addresses do what. So less ambiguity, which is poisonous to computers.
>
> There are also ancient family relationships between the x86 and the Z80,
> say, or the souped-up 8080 in the Gameboy that Nocash is
> most famous for emulating. So you can take advantage of that sometimes,
> effectively running Gameboy code on the PC's CPU, at least
> a few instructions' worth. The flags are in some cases the same. Back in
> the day, emulators had to be coded extremely well to run
> at 100% speed, even for things like the SNES. 100% speed was a target on
> programmers' aims list. So, tight, simple code in a
> controlled environment might be a good thing to do in assembler,
> particularly if it needs to be as fast as possible. Then again,
> these days you'd be lucky to beat a C compiler, unless you know tricks that it doesn't.