Post Reply 
Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
08-08-2021, 09:43 PM (This post was last modified: 08-08-2021 09:44 PM by Bill (Smithville NJ).)
Post: #18
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
I’ve been looking at what it would take to modify the programs so that they would run on more Pocket Computers. At present, the programs will run without modifications on the Sharp PC-1211 (Trs-80 PC-1) and the Sharp PC-125x (TRS-80 PC-3) I think it would be nice if they could also be run on the Sharp PC-126x and PC-1350/1360 series.

I do not own any of these pocket computers, but do have the following emulators on the Android:

Pokecom GO (Supports PC-1251, 1261, & 1350)
go125x (Supports PC-1250, 1251, 1255, & 1258)
go126x (Supports PC-1260 & 1261)
go1360 (Supports PC-1360 with various memory modules)

I also have PockEmul, but have never figured out how to load and save programs.
(If anyone knows how to load/save to PockEmul, please provide an how-to).


My concept would be to have a single text file of the basic source for each program. By using batch files and the Pocket Tools, this txt file could then be converted into either TAP files to load into Olivier GO emulators or converted to a text file that could be loaded into the Pokecom GO emulator. They could also be converted to WAV files for loading into actual pocket computers.

I have been corresponding with the Pokecom GO developer on some items with reading/writing the PI, Square Root and Exp symbols. At present, he’s using “\PI” and “\SQR” to represent the symbols in a text file. The latest update handles this correctly. A future update should correct the Exp symbol – probably to “\E”. With the future update, text files should be loadable/saveable across his emulators.


There are several major differences with the Basic and its operation between the PC-1211/125x and the PC-126x/1350/1360. One major difference is that since the 1211/125x only have single character variable names, they could do implied multiplication.

For example”

If A=5 and B=6, then you could just do AB to do multiplication between them. No need for the “*”.


I quickly learned that it not as easy as just adding a “*” between variables whenever they appear together in the source code. I tried that with the “REAL1” of the Real Estate software package. When running the same program examples from the manual against the original source and the modified source (where I had added “*” to get rid on the implied multiplication), I ended up getting a slightly different answer between the two on one of the examples.


After much research, I discovered that the calculation order of priority was different depending on whether implied multiplication was involved.

From page 162 of the PC-1251 manual:

Operator Priority
Operators on the SHARP PC-1251 are evaluated with the following priorities from highest to lowest:
1. Parentheses
2. Variables and Pseudovariables.
3. Exponentiation (^) when preceded by a multiplication which omits the operator.
4. Multiplication which omits the operator.
5. Functions
6. Exponentiation (^)
7. Unary minus, negative sign (-)
8. Multiplication and Division (*,/)
9. Addition and subtraction (+,-)
10. Relational Operators (<,<=,=,<>,>=,>)
11. Logical operators (AND, OR)

The fourth item refers to usage such as 2A or 5C(2) in which a multiplication is implied, but not shown.

The third item refers to the combination of this with exponentiation, such as 3A^3 or 5D^1.5. In these combined cases the exponentiation will be done first and the multiplication second.


When looking at the above, I see that Item 3 & 4 can really affect the order of calculation which might not be obvious when looking at a line of basic.


I ran into this on Line 240 of Basic program Real1:

240 N=LN (FR/PG+1)/LN (1+R)

If the above line is executed with
F=1, R=2, P=3, G=4

You get N= 1.403139956E-01


Now, if you blindly just expand the multiplication (which is what I had done), you get
240 N=LN (F*R/P*G+1)/LN(1+R)
Now N = 1.182658339 which doesn’t match the results of the original equation.

In the first instance, FR is Divided by PG = 2/12 = 1.66666667E-01

In the second, F*R is divided by P and then multiplied by G
F*R/P = 0.5 * G = 2


So original equation should be expanded to
N = LN (F*R/(P*G) +1)/LN(1+R)
whose results will now match the original equation.



One problem down. I wonder what I’ll run into next in trying to create a universal Basic listing that will run on several pocket computers.

I would appreciate any comments and suggestions. Plus let me know if there are other things I should be aware of.


73
Bill WD9EQD
Smithville, NJ
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack - Bill (Smithville NJ) - 08-08-2021 09:43 PM



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