3 ms·
If that’s true, most programming languages work from the CPU perspective. I think that suggests the syntax may have come from consistency with “A = B” in progra
by Someone 6y ago
If that’s true, most programming languages work from the CPU perspective. I think that suggests the syntax may have come from consistency with “A = B” in programming languages (similar to the initially weird looking argument order of strcpy and friends in C), or, maybe, programming languages followed what assemblers did, or the two are similar because of some other common reason.
What I don’t like about Intel’s syntax is that the normal phrase is ‘move A to B’, but ‘mov A, B’ moves what’s in B to A.
(The reason I don’t like it may be because the first CPU I programmed was a 6502, which had separate load and store instructions. Unfortunately, that doesn’t work well with memory-to-memory (which the 6502 doesn’t have) or register to-register (for which the 6502 used a T for ‘transfer’, as in TXA for ‘copy X register into Accumulator) instructions)
- eru 6y agoMathematical formulas, especially definitions, are often written like E = m * c^2 or pV = n k * T or F = m * a. Ie the simpler stuff often goes to the left. So that tradition might have been where most programming languages picked the convention up from?
- mhh__ 6y agolowercase n should be nRT under modern conventions, to be pedantic (else you're off by a factor of N_a)
- eru 6y agoYes. Though ideally, we would redefine temperature units so we could get rid of R and Avogadro's constant in that formula. Ie so that it becomes T := N / (p * V) where N is measured in number of molecules, not in number of moles. So we'd measure temperature in Joule (or electron-volt) per degree of freedom.