[EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

RussellMc
An "acid bath and microscope" decode and analysis of how the
Sinclair Scientific Calculator did what it did at a time when what it did
was impossible.

A fascinating account of the lengths that Ken Shirrif went to to decode the
workings of the processor and reverse engineer the code and algorithms used.

The calculator used some almost black-magic techniques - and in some cases
produced very rough and in some cases horrendously wrong results.

____________________________________ ..."

"In a hotel room in Texas, Clive Sinclair had a big problem. He wanted to
sell a cheap scientific calculator that would grab the market from
expensive calculators such as the popular HP-35. Hewlett-Packard had taken
two years, 20 engineers, and a million dollars to design the HP-35
<http://www.hpmuseum.org/hp35.htm>, which used 5 complex chips
<http://home.citycable.ch/pierrefleur/Jacques-Laporte/HW%20Exploration.htm> and
sold for $395. Sinclair's partnership with calculator manufacturer Bowmar
had gone nowhere. Now Texas Instruments offered him an inexpensive calculator
chip <http://righto.com/ti> that could barely do four-function math. Could
he use this chip to build a $100 scientific calculator?



*  http://files.righto.com/calculator/sinclair_scientific_simulator.html
<http://files.righto.com/calculator/sinclair_scientific_simulator.html>  *

Texas Instruments' engineers said this was impossible - their chip only had
3 storage registers, no subroutine calls, and no storage for constants such
as π. The ROM storage in the calculator held only 320 instructions, just
enough for basic arithmetic. How could they possibly squeeze any scientific
functions into this chip?

Fortunately Clive Sinclair, head of Sinclair Radionics, had a secret weapon
- programming whiz and math PhD Nigel Searle. In a few days in Texas, they
came up with new algorithms and wrote the code for the world's first
single-chip scientific calculator, somehow programming sine, cosine,
tangent, arcsine, arccos, arctan, log, and exponentiation into the chip.
The engineers at Texas Instruments were amazed.

How did they do it? Up until now it's been a mystery. But through reverse
engineering, I've determined the exact algorithms and implemented a
simulator that runs the calculator's actual code. The reverse-engineered
code along with my detailed comments is in the window below.
          __

The manual
http://www.datamath.net/Manuals_Others/Sinclair_Scientific_GB.pdf


_______________

HP35       https://www.hpmuseum.org/hp35.htm

HP35 in depth analysis
http://home.citycable.ch/pierrefleur/Jacques-Laporte/HW%20Exploration.htm

Algorithms and accuracy in the HP35
https://www8.hp.com/us/en/pdf/023hpjournal03_tcm_245_935056.pdf

CORDIC  https://wiki2.org/en/CORDIC

CORDIC (for COordinate Rotation DIgital Computer), also known as Volder's
algorithm, is a simple and efficient algorithm to calculate hyperbolic and
trigonometric functions, typically converging with one digit (or bit) per
iteration.


Simulating a TI calculator with crazy 11-bit opcodes
http://files.righto.com/calculator/TI_calculator_simulator.html


The rise of "worse is better"
https://www.jwz.org/doc/worse-is-better.html
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

David Van Horn
I bet they didn't do it in C.  🙂    I keep hearing "anything you can do in asm, can be done in C" and I know it's not true.

________________________________
From: [hidden email] <[hidden email]> on behalf of RussellMc <[hidden email]>
Sent: Thursday, May 28, 2020 5:36 AM
To: Microcontroller discussion list - Public. <[hidden email]>
Cc: Reid, John (Oji Fibre Solutions) <[hidden email]>; Gavin Higgie <[hidden email]>; ApptechNZ <[hidden email]>; RossGMail <[hidden email]>; [hidden email] <[hidden email]>
Subject: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

An "acid bath and microscope" decode and analysis of how the
Sinclair Scientific Calculator did what it did at a time when what it did
was impossible.

A fascinating account of the lengths that Ken Shirrif went to to decode the
workings of the processor and reverse engineer the code and algorithms used.

The calculator used some almost black-magic techniques - and in some cases
produced very rough and in some cases horrendously wrong results.

____________________________________ ..."

"In a hotel room in Texas, Clive Sinclair had a big problem. He wanted to
sell a cheap scientific calculator that would grab the market from
expensive calculators such as the popular HP-35. Hewlett-Packard had taken
two years, 20 engineers, and a million dollars to design the HP-35
<http://www.hpmuseum.org/hp35.htm>, which used 5 complex chips
<http://home.citycable.ch/pierrefleur/Jacques-Laporte/HW%20Exploration.htm> and
sold for $395. Sinclair's partnership with calculator manufacturer Bowmar
had gone nowhere. Now Texas Instruments offered him an inexpensive calculator
chip <http://righto.com/ti> that could barely do four-function math. Could
he use this chip to build a $100 scientific calculator?



*  http://files.righto.com/calculator/sinclair_scientific_simulator.html
<http://files.righto.com/calculator/sinclair_scientific_simulator.html>  *

Texas Instruments' engineers said this was impossible - their chip only had
3 storage registers, no subroutine calls, and no storage for constants such
as π. The ROM storage in the calculator held only 320 instructions, just
enough for basic arithmetic. How could they possibly squeeze any scientific
functions into this chip?

Fortunately Clive Sinclair, head of Sinclair Radionics, had a secret weapon
- programming whiz and math PhD Nigel Searle. In a few days in Texas, they
came up with new algorithms and wrote the code for the world's first
single-chip scientific calculator, somehow programming sine, cosine,
tangent, arcsine, arccos, arctan, log, and exponentiation into the chip.
The engineers at Texas Instruments were amazed.

How did they do it? Up until now it's been a mystery. But through reverse
engineering, I've determined the exact algorithms and implemented a
simulator that runs the calculator's actual code. The reverse-engineered
code along with my detailed comments is in the window below.
          __

The manual
http://www.datamath.net/Manuals_Others/Sinclair_Scientific_GB.pdf


_______________

HP35       https://www.hpmuseum.org/hp35.htm

HP35 in depth analysis
http://home.citycable.ch/pierrefleur/Jacques-Laporte/HW%20Exploration.htm

Algorithms and accuracy in the HP35
https://www8.hp.com/us/en/pdf/023hpjournal03_tcm_245_935056.pdf

CORDIC  https://wiki2.org/en/CORDIC

CORDIC (for COordinate Rotation DIgital Computer), also known as Volder's
algorithm, is a simple and efficient algorithm to calculate hyperbolic and
trigonometric functions, typically converging with one digit (or bit) per
iteration.


Simulating a TI calculator with crazy 11-bit opcodes
http://files.righto.com/calculator/TI_calculator_simulator.html


The rise of "worse is better"
https://www.jwz.org/doc/worse-is-better.html
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

Bob Blick-5
It's true for the people saying it :)

________________________________________
From: [hidden email] <[hidden email]> on behalf of David Van Horn
Sent: Thursday, May 28, 2020 6:28 AM
To: Microcontroller discussion list - Public.

Subject: Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half    the     ROM of the HP-35 | & Some HP35 links

I bet they didn't do it in C.  🙂    I keep hearing "anything you can do in asm, can be done in C" and I know it's not true.

_

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

David VanHorn-2
VBG

On Thu, May 28, 2020 at 9:49 AM Bob Blick <[hidden email]> wrote:

> It's true for the people saying it :)
>
> ________________________________________
> From: [hidden email] <[hidden email]> on behalf of
> David Van Horn
> Sent: Thursday, May 28, 2020 6:28 AM
> To: Microcontroller discussion list - Public.
>
> Subject: Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack -
> half    the     ROM of the HP-35 | & Some HP35 links
>
> I bet they didn't do it in C.  🙂    I keep hearing "anything you can do
> in asm, can be done in C" and I know it's not true.
>
> _
>
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
>
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

Jason White-20
In reply to this post by David Van Horn
I wonder how much one could get away with if inline assembly was placed in
a C file?

On Thursday, May 28, 2020, David Van Horn <
[hidden email]> wrote:

> I bet they didn't do it in C.  🙂    I keep hearing "anything you can do
> in asm, can be done in C" and I know it's not true.
>
> ________________________________
> From: [hidden email] <[hidden email]> on behalf of
> RussellMc <[hidden email]>
> Sent: Thursday, May 28, 2020 5:36 AM
> To: Microcontroller discussion list - Public. <[hidden email]>
> Cc: Reid, John (Oji Fibre Solutions) <[hidden email]>; Gavin Higgie <
> [hidden email]>; ApptechNZ <[hidden email]>; RossGMail <
> [hidden email]>; [hidden email] <[hidden email]>
> Subject: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half
> the ROM of the HP-35 | & Some HP35 links
>
> An "acid bath and microscope" decode and analysis of how the
> Sinclair Scientific Calculator did what it did at a time when what it did
> was impossible.
>
> A fascinating account of the lengths that Ken Shirrif went to to decode the
> workings of the processor and reverse engineer the code and algorithms
> used.
>
> The calculator used some almost black-magic techniques - and in some cases
> produced very rough and in some cases horrendously wrong results.
>
> ____________________________________ ..."
>
> "In a hotel room in Texas, Clive Sinclair had a big problem. He wanted to
> sell a cheap scientific calculator that would grab the market from
> expensive calculators such as the popular HP-35. Hewlett-Packard had taken
> two years, 20 engineers, and a million dollars to design the HP-35
> <http://www.hpmuseum.org/hp35.htm>, which used 5 complex chips
> <http://home.citycable.ch/pierrefleur/Jacques-Laporte/HW%20Exploration.htm>
> and
> sold for $395. Sinclair's partnership with calculator manufacturer Bowmar
> had gone nowhere. Now Texas Instruments offered him an inexpensive
> calculator
> chip <http://righto.com/ti> that could barely do four-function math. Could
> he use this chip to build a $100 scientific calculator?
>
>
>
> *  http://files.righto.com/calculator/sinclair_scientific_simulator.html
> <http://files.righto.com/calculator/sinclair_scientific_simulator.html>  *
>
> Texas Instruments' engineers said this was impossible - their chip only had
> 3 storage registers, no subroutine calls, and no storage for constants such
> as π. The ROM storage in the calculator held only 320 instructions, just
> enough for basic arithmetic. How could they possibly squeeze any scientific
> functions into this chip?
>
> Fortunately Clive Sinclair, head of Sinclair Radionics, had a secret weapon
> - programming whiz and math PhD Nigel Searle. In a few days in Texas, they
> came up with new algorithms and wrote the code for the world's first
> single-chip scientific calculator, somehow programming sine, cosine,
> tangent, arcsine, arccos, arctan, log, and exponentiation into the chip.
> The engineers at Texas Instruments were amazed.
>
> How did they do it? Up until now it's been a mystery. But through reverse
> engineering, I've determined the exact algorithms and implemented a
> simulator that runs the calculator's actual code. The reverse-engineered
> code along with my detailed comments is in the window below.
>           __
>
> The manual
> http://www.datamath.net/Manuals_Others/Sinclair_Scientific_GB.pdf
>
>
> _______________
>
> HP35       https://www.hpmuseum.org/hp35.htm
>
> HP35 in depth analysis
> http://home.citycable.ch/pierrefleur/Jacques-Laporte/HW%20Exploration.htm
>
> Algorithms and accuracy in the HP35
> https://www8.hp.com/us/en/pdf/023hpjournal03_tcm_245_935056.pdf
>
> CORDIC  https://wiki2.org/en/CORDIC
>
> CORDIC (for COordinate Rotation DIgital Computer), also known as Volder's
> algorithm, is a simple and efficient algorithm to calculate hyperbolic and
> trigonometric functions, typically converging with one digit (or bit) per
> iteration.
>
>
> Simulating a TI calculator with crazy 11-bit opcodes
> http://files.righto.com/calculator/TI_calculator_simulator.html
>
>
> The rise of "worse is better"
> https://www.jwz.org/doc/worse-is-better.html
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
>


--
Jason White
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

John Gardner
In reply to this post by David VanHorn-2
Reply | Threaded
Open this post in threaded view
|

Re: [EE]:: Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35 | & Some HP35 links

James Cameron-2
On Thu, May 28, 2020 at 02:17:17PM -0500, John Gardner wrote:
> ... https://www.jwz.org/doc/worse-is-better.html
>
>  !

The anecdote paragraph that starts "Two people, one from MIT and
another from Berkeley", reminds me of EINTR, interrupted system call,
which is something that can happen rarely on UNIX and Linux when you
ask the operating system to read or write exactly this many bytes from
a file descriptor or network socket.

Most code doesn't anticipate it.  These programs work 99% of the time,
and fail ingloriously at the first sign of it, usually when an
operating system is heavily loaded.

Some code checks for the condition, and retries the operation.  When
used on a heavily loaded operating system, these programs bring the
system further to its knees.

i.e. exactly what was requested.

--
James Cameron
http://quozl.netrek.org/
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist