Not just assembly.
Late 70's, ICL 1900 FORTRAN, I was an undergrad student just learning the language, and had a program that just behaved bizarrely, loops that ran for the wrong number of times and similar weird things.
Turned out that 1900-series systems had no machine-level instructions to add a constant to a location, you had to put the constant into another storage location and then add the two contents together. As an optimisation the compiler stored the numbers 1-10 (or maybe 20, I forget) in a fixed table so that they could be quickly accessed.
I was calling a subroutine with a constant argument, and inside that subroutine I was inadventently changing it. FORTRAN passes all arguments by reference (i.e. pointers) and there was no form of readonly page protection on those systems, so my when I inadvertently added 1 to the passed-in constant 5, all "constant" 5s in the program became 6s...