3 ms·
Which ones? I assume at least the 1:1 machine code kind doesn't, and you mean something more like bytecode, but it'd be interesting if I'm wrong on that count.
by vacuity 3y ago
Which ones? I assume at least the 1:1 machine code kind doesn't, and you mean something more like bytecode, but it'd be interesting if I'm wrong on that count.
- lmm 3y ago> I assume at least the 1:1 machine code kind doesn't They do, because the machine code sometimes has undefined behaviour. E.g. on the 6502 famously 1/4 of the instructions are undefined (all of the 0b.....11 ones), and many of them behave differently on different implementations of the processor (up to and including halting it, or placing it in a strange state).
- flohofwoe 3y agoMost of those undocumented instructions are what in C would be called "implementation defined behaviour" and have properly defined results, they might just differ between specific CPU models. There's only a very small number of unstable instructions which have unpredictable results (caused by "cross talk" due to incomplete instruction decoding).
- lmm 3y agoHalting the CPU would also generally have to be modelled as undefined behaviour in the standard.
- flohofwoe 3y agoThe 6502 has one (or some?) "illegal" instructions where the effects are unpredictable. Only case I can think of though.