-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FACTOR - factors integers #96
Comments
This is based on a disassembly of the binary AI:SYS1;TS FACTOR; the binary and its help file .INFO.;FACTOR ORDER are both dated 1977-09-27. MC had an identical copy with a later date. This assembles into a binary that's identical to the original, except that the original version has all its symbols marked as global, and no assembly info. Fixes #96.
This is based on a disassembly of the binary AI:SYS1;TS FACTOR; the binary and its help file .INFO.;FACTOR ORDER are both dated 1977-09-27. MC had an identical copy with a later date. This assembles into a binary that's identical to the original, except that the original version has all its symbols marked as global, and no assembly info. Fixes #96.
This is based on a disassembly of the binary AI:SYS1;TS FACTOR; the binary and its help file .INFO.;FACTOR ORDER are both dated 1977-09-27. MC had an identical copy with a later date. This assembles into a binary that's identical to the original, except that the original version has all its symbols marked as global, and no assembly info. Fixes #96.
Neat! Comparing the two, that's definitely a later version of the same program - it uses a lookup table for the keys (including lowercase entries) rather than lots of individual tests, it uses .CALL OPEN rather than .SUSET and .OPEN, and it has a quit command. The maths code is identical. Is it possible that that code also started life as a disassembly? It flips between using numeric and symbolic names for the registers and IO channels... Was there an updated FACTOR ORDER with it, with the lowercase keys added? The QUERY code that provides help for a key is still case-sensitive. |
As far as I can see, the FACTOR ORDER we have is the latest version according to timestamps. |
The change to put the TEST inner loop at 100 rather than in the registers looks wrong, looking at the binary it produces -- it does a TRC .+1,6, which can only work when .+1 is in the range 0-17, and an HRRI to the same location later. The code still works by chance, because the value in that location by default is 2, so it just ends up checking every odd number as a possible factor (and the TRC/HRRI overwrite A which doesn't matter). So I wonder if that version never got installed, because the intention was to speed it up on the KL by running the inner loop from main memory rather than the registers, but it actually ended up being slower as it was testing more factors... |
SYS1; TS FACTOR
.INFO.;FACTOR ORDER
Source missing?
The text was updated successfully, but these errors were encountered: