Post Reply 
Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
08-09-2021, 09:20 PM
Post: #21
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
The only other snag that comes to mind at the moment would be if there's any implied multiplication of variables that just happens to spell some new reserved word in the PC-1250 (implied multiplication would have to be made explicit for the 1260, 1403, etc.). Seems extremely unlikely to happen, though.
Visit this user's website Find all posts by this user
Quote this message in a reply
08-10-2021, 03:13 AM
Post: #22
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
(08-09-2021 08:53 PM)Bill (Smithville NJ) Wrote:  
Quote:This document might be useful.

Thanks for the document. Lots of useful information.

I'm glad you liked it. But then, have a look at this one, you're gonna love it !

Quote:.Thanks for the PDF and comments. I knew if anyone knew of other problems I might have, it would be you.

Thanks to you for your appreciation and kind words. Best of luck with your project.

Regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
08-11-2021, 05:50 PM
Post: #23
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
(08-08-2021 09:43 PM)Bill (Smithville NJ) Wrote:  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.

It's not too difficult to generalize PC-1211 and PC-125x BASIC to run on 12xx, PC-13xx and PC-14xx series of pocket computers with some guidance (see below). Not so to the PC-1500/1600 and the E and G series that offer different BASIC interpreters, see the diagram at https://sharppocketcomputers.com/#basic

For help and a more in-depth comparison of BASIC across brands and types of pocket computers, see http://basic.hopto.org/basic/manual/basic-compare.pdf (the site appears down today, attached is the PDF for your convenience).

These series of earlier PC support the special A() array that grows dynamically in size (and can hold 7-char strings), and support the ? and √ symbols, etc. By contrast, it is nearly impossible to port later series PC with new commands to the earlier series PC that lack these commands and functions such as SQU, CUB, CUR, REC, POL, HSN, HCS, HTN, TEN. Though these can be replaced with expressions.

Very good point in your post about implicit multiplication, which is something to watch out for (and not elaborated in the PDF), to replace with * or / as needed and by using parenthesis, e.g. X^2Y becomes X^(2*Y) and 1/XY becomes 1/(X*Y) or 1/X/Y and functions w/o parenthesis such as SQR XY becomes SQR(X*Y).

Even SHARP's Application books made mistakes when translating older Application books to the newer non-implicit-multiplication BASIC versions. For example, in "Computing the Sciences - Applications for the PC-14xx" (and EL-55xx) the T-test program has an implicit multiplication bug, here copied verbatim from the Computing the Sciences for EL-5520 (PC-1450) and EL-5500III (PC-1403) books I own:
\[ t = \frac{\bar x-\mu_0}{s/\sqrt n} = \frac{\frac{\sum x}{n}-\mu_0}{\sqrt{\frac{\sum x^2-n(\sum x/n)^2}{n(n-1)}}} = \frac{Y/Z-A}{(X-Z(Y/Z)^2)/Z(Z-1)} \]
Program:
10 PAUSE "T-TEST"
20 INPUT "POP.MEAN=";A
30 T=(Y/Z-A)/√((X-Z*SQU(Y/Z))/Z*(Z-1))
40 USING "##.###^"
50 PRINT "T=";T


The writers made a mistake to replace implicit multiplication with a * instead of a /. It is rare that SHARP made this error. I have not seen any other obvious math issues in their books and materials.

- Rob


Attached File(s)
.pdf  pocket-computer-basic-comparisons.pdf (Size: 263.03 KB / Downloads: 7)

"I can count on my friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
08-12-2021, 11:43 AM
Post: #24
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
Valentin,

Quote:I'm glad you liked it. But then, have a look at this one, you're gonna love it !

Wow!! You are right. I do love it. Thanks.

I have just finished going through the basic source codes for the tape packages that Dave so nicely provided. I now need to load and run them on each of the emulators, typically using the the examples in the manuals.

It's interesting. Some of the Tape packages made extensive use of implicit multiplication while others either made no use or very limited use. I guess it depended on who was doing the programming.

73
Bill WD9EQD
Smithville, NJ
Find all posts by this user
Quote this message in a reply
08-12-2021, 12:10 PM
Post: #25
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
In the Surveying Package, I think there's errors in the original code for the CLOSE and TAPE programs.

For example, Lines 79 and 80 from the CLOSE program reads:

79 IF M>=360M=M-360
80 IF M<0M=M+360


I think a "LET" is needed as follows:

79 IF M>=360 LET M=M-360
80 IF M<0 LET M=M+360

I'm testing on a PC-1251 emulator. So I'm not sure if the LET is required on a PC-1211 which the program was written for. Could someone test on an actual PC-1211 pr PC-1.

The TAPE program also as several statements that would also require the addition of a LET.

73
Bill WD9EQD
Smithville, NJ
Find all posts by this user
Quote this message in a reply
08-12-2021, 12:53 PM
Post: #26
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
(08-12-2021 12:10 PM)Bill (Smithville NJ) Wrote:  In the Surveying Package, I think there's errors in the original code for the CLOSE and TAPE programs.

For example, Lines 79 and 80 from the CLOSE program reads:

79 IF M>=360M=M-360
80 IF M<0M=M+360


I think a "LET" is needed as follows:

79 IF M>=360 LET M=M-360
80 IF M<0 LET M=M+360

I'm testing on a PC-1251 emulator. So I'm not sure if the LET is required on a PC-1211 which the program was written for. Could someone test on an actual PC-1211 pr PC-1.

The TAPE program also as several statements that would also require the addition of a LET.

73
Bill WD9EQD
Smithville, NJ

I am not familiar with this specific flavor, but in many flavors of BASIC, LET can be implicit, so the two versions of the lines are functionally equivalent, with the original ones possibly being a bit smaller (in bytes). It's easy to try, give it a shot.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-12-2021, 01:18 PM
Post: #27
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
Hi Bob,

Quote:I am not familiar with this specific flavor, but in many flavors of BASIC, LET can be implicit, so the two versions of the lines are functionally equivalent, with the original ones possibly being a bit smaller (in bytes). It's easy to try, give it a shot.

When I try it with and without the LET, I get two different answers on the PC-1251 emulator.

For example:

10 M=400
79 IF M>=360M=M-360
100 Print M

This prints 400.

But if I add the LET:

10 M=400
79 IF M>=360 LET M=M-360
100 Print M

This prints 40. ( This is the correct answer)

I think the first version has problems with the implicit multiplication of 360M.

73
Bill WD9EQD
Smithville, NJ
Find all posts by this user
Quote this message in a reply
08-12-2021, 01:50 PM
Post: #28
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
Yes, I believe you are correct that there's an error in the original programs. The PC-1211 and PC-1250/1251 both require LET when making a variable assignment immediately following IF. The THEN keyword is only used as a synonym for GOTO following an IF. All of the Sharp pocket computers I've used have these same syntax rules.

Some examples:

IF X>1 THEN 200
IF X>1 GOTO 200
IF X>1 LET X=X-1
IF X>1 PRINT "X>1"

I'm surprised that IF M>=360M=M-360 doesn't throw a syntax error since there's no subordinate statement following the IF. I'm assuming the condition ends up being evaluated as something like IF (M>=(360M))=(M-360).

Interestingly, several of the manuals contained either a printed addendum/errata, or hand-written notes and corrections from the previous owner, but the surveying manual appears to lack either.
Visit this user's website Find all posts by this user
Quote this message in a reply
08-14-2021, 07:18 PM
Post: #29
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
(08-12-2021 01:18 PM)Bill (Smithville NJ) Wrote:  For example:

10 M=400
79 IF M>=360M=M-360
100 Print M

This might give the expected result:

Code:
10 M=400
79 IF M>=360 THEN M=M-360
100 PRINT M

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
Post Reply 




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