Post Reply 
Sinclair Cambridge Programmable Program Library (more fun with the scanner)
08-18-2024, 01:47 PM (This post was last modified: 08-18-2024 02:24 PM by Thomas Klemm.)
Post: #18
RE: Sinclair Cambridge Programmable Program Library (more fun with the scanner)
(11-30-2019 03:42 PM)Dave Britten Wrote:  They actually managed to implement prime factorization on this thing somehow - see page 63 in the PDF.

There is this online simulator: Programming the Sinclair Cambridge Programmable
While only loading two programs (Factorial and Counter) is possible, you can set the variable program in the JavaScript Console of the Developer Tools.

This is the PRIME FACTORISATION example that you mentioned:
Code:
program = [
    'G',    // ÷
    '6',    // (
    'F',    // -
    'E',    // +
    '5',    // rcl
    'F',    // -
    'A',    // downshift
    '1',    // go if neg
    '0',    // 0
    '2',    // 2
    '-',    // =
    'A',    // downshift
    '1',    // go if neg
    '2',    // 2
    '4',    // 4
    '5',    // rcl
    '0',    // stop
    '6',    // )
    '-',    // =
    '0',    // stop
    'A',    // downshift
    '2',    // goto
    '0',    // 0
    '0',    // 0
    '5',    // rcl
    'E',    // +
    '3',    // #
    '1',    // 1
    '-',    // =
    '2',    // sto
    '3',    // #
    '1',    // 1
    '-',    // =
    '6',    // )
    '-',    // =
    '-',    // =
]

Here's another one: DAY OF THE WEEK OF CHRISTMAS DAY (1900-2099)
Code:
program = [
    '.',    // ×
    '3',    // #
    '1',    // 1
    'A',    // .
    '2',    // 2
    '4',    // 4
    '9',    // 9
    '6',    // 6
    'F',    // -
    '3',    // #
    '2',    // 2
    '6',    // 6
    '3',    // 3
    '1',    // 1
    'E',    // +
    '3',    // #
    '7',    // 7
    'E',    // +
    'A',    // downshift
    '1',    // go if neg
    '1',    // 1
    '5',    // 5
    '6',    // (
    'F',    // -
    'E',    // +
    '3',    // #
    '1',    // 1
    '-',    // =
    'A',    // downshift
    '1',    // go if neg
    '2',    // 2
    '4',    // 4
    '6',    // )
    '-',    // =
    '0',    // stop
    '-'     // =
]

And this is a translation of the program for the HP-42S:
Code:
00 { 23-Byte Prgm }
01 1.2496
02 ×
03 2631
04 -
05 7
06 MOD
07 ENTER
08 +/-
09 1
10 MOD
11 +
12 END

Thanks for the link to the program library.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Sinclair Cambridge Programmable Program Library (more fun with the scanner) - Thomas Klemm - 08-18-2024 01:47 PM



User(s) browsing this thread: 2 Guest(s)