HP67 h PI

The HP67 stores PI/4 in ROM subroutine 05043 with 13 digit precision. It multiplies that by 4 (“c + c -> c[w]” twice) to get 3.1415926535900 and then rounds that to 3.141592654.
It works like this:

HP67 Logging started.

(00167 - 00213 wait loop)
[h]
...

(00167 - 00213 wait loop)
[PI]
00214 display off
00215 b exchange c[w]
00216 CRC 400
00217 keys to a
...
00252 delayed rom 01
00253 a -> rom address
00537 if n/c go to 0427
00427 ...
00435 if n/c go to 0542
00542 ...
00544 if n/c go to 0436
00436 ...
00442 jsb 01205            ; clear s 4,6-8,10,13
00443 ...
00446 if n/c go to 06021
06021 ...
06027 a -> rom address 
06004 if n/c go to 06046
06046 ...
06051 a -> rom address 
07110 if n/c go to 07172
07172 ...
07173 delayed rom 012 
07174 jsb 05043
.05043 p <- 12 
.05044 0 -> c[w] 
.05045 load constant 7 
.05046 load constant 8 
.05047 load constant 5 
.05050 load constant 3 
.05051 load constant 9 
.05052 load constant 8 
.05053 load constant 1 
.05054 load constant 6 
.05055 load constant 3 
.05056 load constant 3 
.05057 load constant 9 
.05060 load constant 7 
.05061 load constant 5    ; C=07853981633975
.05062 p <- 12 
.05063 return 
07175 c + c -> c[w]       ; C=15707963267950
07176 c + c -> c[w]       ; C=31415926535900
07177 shift right c[w]    ; C=03141592653590
07200 c + 1 -> c[m]       ; C=03141592654590
07201 0 -> c[x]           ; C=03141592654000
07202 if n/c go to 07372
07372 delayed rom 00 
07373 if n/c go to 0103
00103 ...
00110 then go to 0114
00114 ...
00115 if n/c go to 0124
00124 ...
00156 jsb 02007           ; A=03140000000000
00157 delayed rom 02
00160 jsb 01162           ; A=3014fffffff100 B=03000000000022
00161 hi im woodstock
00162 display off
00163 display toggle      ; "3.14"
00164 0 -> s 15
00165 if 1 = s 15
00166 then go to 0164

(00167 - 00213 wait loop)
It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUponDigg thisPin on PinterestEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *