Skip to content
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

Closed
eswenson1 opened this issue Dec 4, 2016 · 4 comments
Closed

FACTOR - factors integers #96

eswenson1 opened this issue Dec 4, 2016 · 4 comments
Labels
reconstructed Source code reconstructed from binaries, maybe with help from other sources. todo

Comments

@eswenson1
Copy link
Member

SYS1; TS FACTOR
.INFO.;FACTOR ORDER

Source missing?

@larsbrinkhoff larsbrinkhoff added the source missing Flag that this program doesn't have source code. label Feb 15, 2018
atsampson added a commit that referenced this issue Mar 31, 2018
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.
atsampson added a commit that referenced this issue Mar 31, 2018
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.
@larsbrinkhoff larsbrinkhoff added reconstructed Source code reconstructed from binaries, maybe with help from other sources. and removed source missing Flag that this program doesn't have source code. labels Apr 1, 2018
atsampson added a commit that referenced this issue Apr 1, 2018
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.
@larsbrinkhoff
Copy link
Member

@atsampson
Copy link
Contributor

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.

@larsbrinkhoff
Copy link
Member

larsbrinkhoff commented Apr 9, 2018

As far as I can see, the FACTOR ORDER we have is the latest version according to timestamps.

@atsampson
Copy link
Contributor

atsampson commented Apr 9, 2018

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reconstructed Source code reconstructed from binaries, maybe with help from other sources. todo
Projects
None yet
Development

No branches or pull requests

3 participants