Re:The Earliest Unix Code: An Anniversary Source Code Release
by fernly on Thursday October 17, 2019 @10:55PM
(#21288276)
45 pages in before I saw the first comment. whoever wrote section 8, "what may be a simulation or game for billiards or pool", put actual one-line descriptions before each section. Later on he gets real chatty, e.g.
Seriously, I bet there is a lot to be learned figuring out how he was approximating trigonometry using 12-bit int constants.
[ Parent
| on HN ]
Re:The Earliest Unix Code: An Anniversary Source Code Release
by boomlinde on Friday October 18, 2019 @05:21AM
(#21289839)
It looks like there are symbols named "sin" and "cos" not declared in the program. These are possibly system provided tables.
Accesses to "sin" and "cos" are preceded by what looks like a self modifying store ("dac .+3", interpreted to mean "deposit accumulator at current program counter + 3"), possibly to modify the "lac sin" and "lac cos" instructions to index the tables, but I'm not familiar with the instruction encoding.
If so, this is a relatively straight forward, non-magic way of implementing trigonometric functions.
Re:The Earliest Unix Code: An Anniversary Source Code Release
by 6c696e7578 on Friday October 18, 2019 @01:06AM
(#21288837)
> Later on he gets real chatty
At least it wasn't one of those people who write comments that don't align with what the code is doing.