Post Reply 
Sharp PC-1262
02-16-2022, 07:51 PM (This post was last modified: 02-16-2022 07:56 PM by Dave Britten.)
Post: #15
RE: Sharp PC-1262
(02-16-2022 07:22 PM)Dan C Wrote:  I have now starting to do some small BASIC programs on my PC-1262.
But, can the machine just hold one program at a time?
I'm used with the CASIO style of P1-P10 programs slots, but it seems that the PC-1262 only can store one program in memory?

That is mostly correct, but there's a little bit more to the story. When entering a program from the keyboard, you effectively only have a single program slot. You can, however, use labels to store multiple programs in memory as long as their line numbers don't conflict. A label is simply a string literal at the beginning of a line, e.g.:

10 "FACTOR":INPUT X
...

Executing RUN"FACTOR" will start the program from the labeled line. And you're not limited to just RUN, you can GOTO, GOSUB, or RESTORE to labels as well, either directly, or indirectly with the use of a string variable containing the label name.

This capability is present in I think all of the Sharp pocket computers all the way back to the original PC-1211. One of the PC-1211 books I have suggests putting a simple "operating system" as the first lines in memory. I think it was something like this:

1 INPUT ">";A$:GOSUB A$:GOTO 1
2 END

So you can just type RUN and have a prompt for running programs by merely typing the label/program name and pressing ENTER. End programs with RETURN instead of END, and they'll go back to the prompt when finished. This also demonstrates how INPUT is a conditional test on most Sharps (later machines dropped this for some reason) - if you press ENTER without actually typing a value/string, the variable is not updated, and the rest of the line is skipped. Thus pressing ENTER with without typing a label name will fall through to line 2 and end the program. I use this feature very often in programs.

The bottom two rows of the keyboard serve as the user-definable keys. If you have labels "A", "S", "D", "F", etc. then you can run the program starting from those labels by simply pressing DEF followed by the letter (or by switching to DEF mode and pressing SHIFT + letter on the PC-1211/PC-1210). This is even possible while a program is already running, for instance at an INPUT prompt.

If you have a cassette interface, then there are some more possibilities here. Normally CLOAD will clear program memory and load the new program, but MERGE will load the program without removing what's already in program memory. If the line numbers in the program you are merging are all higher than what's already in memory, then everything is contained in a single program slot as if the two programs had been combined as one from the beginning. Otherwise, if you have conflicting line numbers or overlapping line number ranges, the new program will be merged, but only the new program's lines can be viewed and modified in PRO mode. The programs already in memory can still be called through the use of labels. Also, NEW will blow away everything, not just the most recently merged program, and I think that CSAVE will save everything in memory, not just the latest program (I need to confirm this).

So overall it's more effort to work with compared to the Casios, but this system offers a great deal more flexibility if you don't mind the added complexity. It's a bit of a double-edged sword. Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sharp PC-1262 - Dan C - 02-09-2022, 06:30 PM
RE: Sharp PC-1262 - Dave Britten - 02-09-2022, 06:47 PM
RE: Sharp PC-1262 - robve - 02-09-2022, 08:48 PM
RE: Sharp PC-1262 - Maximilian Hohmann - 02-09-2022, 07:10 PM
RE: Sharp PC-1262 - Dave Britten - 02-09-2022, 07:41 PM
RE: Sharp PC-1262 - Dan C - 02-13-2022, 10:11 AM
RE: Sharp PC-1262 - toml_12953 - 02-13-2022, 10:46 AM
RE: Sharp PC-1262 - robve - 02-13-2022, 04:31 PM
RE: Sharp PC-1262 - Dave Britten - 02-13-2022, 08:56 PM
RE: Sharp PC-1262 - Dan C - 02-14-2022, 06:20 PM
RE: Sharp PC-1262 - robve - 02-14-2022, 08:36 PM
RE: Sharp PC-1262 - Dave Britten - 02-15-2022, 01:27 PM
RE: Sharp PC-1262 - Dan C - 02-15-2022, 05:36 PM
RE: Sharp PC-1262 - Dan C - 02-16-2022, 07:22 PM
RE: Sharp PC-1262 - Dave Britten - 02-16-2022 07:51 PM
RE: Sharp PC-1262 - Maximilian Hohmann - 02-16-2022, 08:11 PM
RE: Sharp PC-1262 - Dan C - 02-17-2022, 07:00 PM
RE: Sharp PC-1262 - Dave Britten - 02-17-2022, 07:24 PM
RE: Sharp PC-1262 - robve - 02-19-2022, 09:20 PM
RE: Sharp PC-1262 - rprosperi - 02-19-2022, 11:27 PM
RE: Sharp PC-1262 - Valentin Albillo - 02-20-2022, 04:48 AM
RE: Sharp PC-1262 - robve - 02-20-2022, 10:19 PM
RE: Sharp PC-1262 - robve - 02-16-2022, 08:08 PM
RE: Sharp PC-1262 - Dave Britten - 02-16-2022, 08:35 PM
RE: Sharp PC-1262 - robve - 02-16-2022, 09:13 PM
RE: Sharp PC-1262 - Dan C - 02-17-2022, 07:04 PM
RE: Sharp PC-1262 - robve - 02-17-2022, 07:42 PM
RE: Sharp PC-1262 - Dave Britten - 02-19-2022, 09:53 PM
RE: Sharp PC-1262 - Dave Britten - 02-20-2022, 01:18 PM
RE: Sharp PC-1262 - robve - 02-20-2022, 02:22 PM
RE: Sharp PC-1262 - Dan C - 03-10-2022, 07:30 PM



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