Post Reply 
A Compiler for Pocket Calculators
01-24-2017, 06:41 AM
Post: #8
RE: A Compiler for Pocket Calculators
Hi all,

I thought I might have a go at one so I uploaded a simple basic compiler for the HP-65 - available at teenix.org.

It bound to have a bug or two as it is hard to traverse the maze of twists and turns the software could take depending on what source code is entered.

Two files are created, one that is compatible with the CCE33 HP65 emulator and a text file as shown below.

As a simple example

loop(A, 3) // Label A - loop 3 times
a=a+1 // just increment reg a
endloop
b=a+(2*c+LN(23.5)*e)/2 // fancy calculation
stop

Output...

1. 3
2. STO 8
3. LBL
4. A
5. RCL 1
6. 1
7. +
8. STO 1
9. g
10. .
11. GTO
12. A
13. RCL 1
14. 2
15. RCL 2
16. *
17. 2
18. 3
19. .
20. 5
21. f
22. 7
23. RCL 3
24. *
25. +
26. 2
27. /
28. +
29. STO 4
30. R/S

cheers

Tony
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: A Compiler for Pocket Calculators - teenix - 01-24-2017 06:41 AM



User(s) browsing this thread: