3 ms·
gputils did an amazing job on the disassembling! There are labels, gotos and functions all laid out. Hardcoded and calculated values were added to the PC in man
by esaym 4y ago
gputils did an amazing job on the disassembling! There are labels, gotos and functions all laid out. Hardcoded and calculated values were added to the PC in many places like: "addwf PCL, F" In that case, add W register into PCL, and store value into PCL.
Trane had the original patent for computer controlled defrost: https://patents.google.com/patent/US4573326A/en https://patents.google.com/patent/US4573326A/en In the first image you'll see a chart with different temperature "bin" factors. In one place in the code, the temperature offset from 32 degrees (freezing) is added to a hardcoded value and the PC then jumps into a certain spot in a lookup table. The values in that lookup table help determine at what "DT" (delta temp between outdoor coil and outdoor ambient) a defrost should initiate. In another location, a hardcoded value is added to the PC along with a loop counter.... On loop 1 through the code, jump to this location, on loop 2 jump to this location, etc. Kind of a strange way to code, but after buying different revisions on ebay of this board going all the way back to the early 2000's, and on top of the patent being from 1985, perhaps this was the norm in the 80's and mid 90's.
- the_biot 4y agoThat adding offsets sounds like it could easily be compiler output. Elegant-looking jump table code is actually pretty standard for a compiler to generate. On the other hand, carefully hand-crafted and super clever machine code written in the '80s and subsequently fucked up by successive generations of maintainers who didn't understand it is an entirely plausible scenario.