AdamCon.org : ann |
AdamCon 13 | AdamCon 12 | AdamCon 11 | AdamCon 10 | Adam News Network Archive
|
Return to adamcon.org | Adam News Index | Volume 98
The computer is very fast, very accurate and very stupid. It responds when told specifically what to do in a language that it understands, but it can not reason or infer meanings or intentions. This discussion, including illustrations, is designed to enhance your understanding of the language so you can communicate with ADAM and, at the same time, hopefully be entertained a little. The order of introducing concepts is for convenience only in trying to accomplish those goals.
Programing is not an exact endeavor with a right or wrong answer. Obviously there must be an output consistent with the purpose of the program and that output must be correct. The method of getting there, however, will vary and all can do the job. Yes, some programs are better than others but that judgement is based on two specifics, memory used and speed of execution, and an abstract concept sometimes called "user friendliness". As long as there is sufficient momory available, friendliness may be more important to the home computer user than speed.
There are two parts to programing. The first is the knowledge of commands and what the computer can do. The second is taking your time to think through what you want to do and piece by piece, how to get it done. That is the logic of the program. You can't use one without the other!
The first step in this set of instructions is to load SmartBASIC into the computer. If there are questions on loading, consult the instruction manual.
Let's start with the RETURN key. As you read this material, you find punctuation marks and paragraphs to help you separate thoughts. Computers do not understand that concept, it is too general. Instead, when you have completed a statement or a command, or give the computer the requested information, such as a number, press the RETURN key. The information will then be acted upon by the computer. Sometimes, this is known as ENTER. The action is just the same, press the RETURN key. At first, you will be reminded to do this by the RETURN, ENTER, or the symbol (CR), carriage return.
The computer looks at the first key in a series. If thqt key is a number, it expects the information to be a numbered statement in a program. That number cannot be larger than 65535. If it is, the number will be rejected. More about that in a later session. If, however, the first key pressed is a letter, the computer then expects a COMMAND that can be acted upon in the IMMEDIATE mode. The first word following a number must be a command.
The list of commands is shown in the instruction manual and will not be repeated as such in this document. Let's experiment just a little bit. First, however, a few words about the computers memory. You can't physically hurt the computers menory, but you can sure confuse it. Sometimes, you may cause it to go off on its looking for sometning that it can't find and you don't know what it is. The cursor will either quit blinking or even disappear. You may have to reboot SmartBASIC again in order to unlock the computer. In so doing, you will lose all of the information that you have put into memory, but no other harm has been done.
Type 1234(CR) (remember our symbol for RETURN)
Other than the cursor moving to the next line, nothing happened on the screen. why? The computer was expecting a program statement. Since the entry was a number, it was prepared to save the material following the number, but no other information was given. As there was nothing to do the computer stored "nothing" as instruction number 1234. Actually, it just forgot the whole thing including the numbered instruction. There was nothing there.
One of the most frequently used BASIC Commands is the word PRINT. Try typing the word PRINT and (CR). Once again, other than the cursor moving down a line, nothing seemed to have happened. That is so because we gave it nothing to print - the command needs more information.
Try PRINT 4(CR). Now the numeral 4 is printed on the screen. Try printing several different numbers to get the feel of the operation. Now let's try something a little different. Type PRINT 2+2(CR). You get the answer 4. Note that the equal sign (=) was not used - it is unnecessary and will even confuse ADAM. Try it!
Can the computer do anything besides add? Yes, but the symbols used in the commands may be different than those you are used to seeing. They are: + Addition - Subtraction * Multiplication / Division ^ Exponentation
A word about exponentation. This raises a number to a power and is entered as:
PRINT 2^3(CR) for exawmple.
The computer will return 8, or 2 raised to the third power. Try several examples of all the operations.
By now, you must be tired of typing the word PRINT. BASIC provides for that by giving you a shortcut. Instead of typing the word PRINT, you can type the question mark symbol "?" and the computer understands that it is to PRINT. Try several different tests of that command.
By the way, if the mess on the screen is bothering you, enter the word HOME(CR). Presto, the screen is now cleared of all the work so far. Something else, ADAM is not particular whether you use upper or lower case letters to talk to it.. While COMMANDS will frequently be shown in upper case in this text, they may be actually entered in lower case letters.
What happens if you type PRINT X? Try it and see. The computer answers with a "0" (zero). It printed out the value of the variable X which at this point is zero. Until a variable is set to equal something, a zero will always be returned. Noiw type in :
LET X = 100(CR) PRINT X
The value of the variable was printed.
Probably, by this time, you have encountered ERROR MESSAGES. ADAM
is quite good about returning information that error has been
encountered, about where in the statement the error is, and the
nature of the error. Not all computers are this friendly-- they
wait until you try to run the program and then just tell you that
an error has been made and in what program step it has occured.
To illustrate an ERROR MESSAGE, try typing the
following:
PRANT X The computer does not recognize the word PRANT, thus it returns the message. In the immediate mode, there is no choice but to retype the correct command and enter it again. The carat will usually point to the column where the computer thinks the error occurred although it is really pointing out that it expects something at that location in the statement that wasn't found.
A partial listing of ERROR MESSAGES is shown in Appendix C, pages 1 - 4, of the revised edition of the Smart BASIC programing manual. You may wish to review these. They will help you as you debug programs that you write.
What if we wish to print a word, rather than a number or the value of a variable? That is simple-- just put the information that is to be printed inside QUOTATION MARKS. The characters may be letters, symbols, or numbers and there is no restriction as to the order. Try:
PRINT "John Jones"(CR)
Try your own name; your street and address; think up some examples of your own. Try:
? "2+2"(CR)
The quotation marks tell the computer to print the material, don't worry about doing what it says.
There is a limitation inherent in SmartBASIC. ADAM cannot print a quotation mark, not an unusual limitation and it is generally inherent in BASIC although some systems do make provisions to handle the problem.
There are some commands that will erase material from RAM (Random Access Memory). One such command is NEW. When "NEW" is entered, all program steps are removed from memory. Be careful when using this command so that material you wanted to keep is not lost. When starting to enter a program in RAM, it is a good idea to execute "NEW" to make sure RAM is clear. If there is a program in memory and you start to enter another, you will probably make a mess of both the old and new.
Another command is CLEAR. CLEAR will erase all variables, including arrays. Arrays will have to be DIMensioned again (see arrays). Once again, be sure you want to remove all vartiables before this command is used. In the immediate mode, enter the following and observe what happens:
B = 1000(CR) DIM a$(20,20)(CR) a$(20,20) = "TESTING"(CR) ? a$(20,20)(CR) ? B(CR) CLEAR(CR) ? B(CR) ? a$(20,20)(CR)
The last PRINT B command resulted in zero as the CLEAR command erased the previous value. The ERROR MESSAGE "?Bad Subscript Error" translates to the computer not having an array called a$ with that many rows and columns. Once again, CLEAR destroyed the a$ array we had created earlier with the DIM a$ command.
Now let's try our hand at a little simple programing. Try typing the following:
NEW(CR) 10 FOR i = 1 to 10(CR) 20 ? "John Jones"(CR) 30 NEXT i (CR) 40 END(CR)
Did you remember that (CR) meant to press the RETURN key? When you get to the end of a complete statement, pressing the RETURN key informs the computer that you are done with that statement. Hencefourth, the Return key prompt will be omitted.
Now, let's increase our BASIC vocabulary some. Try entering, in the immediate mode, LIST. A complete listing of your program is shown on the screen.
Now try LIST 10. Just statement number 10 was listed.
Try LIST 20, 30. Two statements are printed out since there were no other statements between those two.
The LIST commands are usefull in seeing what your program contains, editing the program, or making other revisions. Had you first entered PR#1, you would have gotten a printed copy of the program from your printer. If you have entered PR#1, be sure to enter PR#0 to turn the printer back off before continuing to enter data. If you wish a printed copy of just the material on the monitor screen, hold down the CONTROL key and press the letter "p".
s
One of the features of BASIC is that statements do not have to be sequential or in numerical order when they are typed into memory. The computer will sort them out and run each in proper order. Because of this capability, program statements can be added and changed without changing the operability of the program. It is customary when writing a program to skip numbers, or reserve them for future use if needed. An increment of 10 numbers is common although 5 or even less can be used. The choice is up to the programmer.
The editing functions of ADAM: Programs can be typed in the SmartWriter mode and SAVED on a tape or disk. With SmartBASIC installed, you can LOAD the program and it will RUN. Programs are not usually written using SmartWriter as there are no error messages such as those in SmartBASIC. The first time a program written in SmartWriter is run, all of the errors will surface and it may be harder to debug.
SmartWriter can be used for some programming work. Two programs, each saved on tape (or disk) may be combined in SmartWriter and SAVED as one program. The search and replace features can also be useful. For example, it would be easier to replace all GOTO 1000 statements with GOTO 2000 statements. All SmartBasic files (except for BSAVE files) can be viewed through use of SmartWriter.
Reference has beem made to adding a program step. Determine the sequence within the program where the addition should be made, select a number appropriate for that position, and type the statement. This method will be used with the program that is in memory.
There are two ways of deleting a statement:
1. Type the number of the statement and strike RETURN. That number now has nothing assigned to it, so it will be skipped in the future.
2. DEL x where x is the number to be deleted.
If several sequential or consecutive statements are to be deleted type the command:
DEL x,y where x is the number of the first statement you wish deleted and y the last.
To change a statement, retype the statement using the old number and then press RETURN. The new replaces the old statement. A second way is to enter the command:
LIST x where x is the number of the statement to change.
The statement will now appear on the monitor. Using the arrow keys, move the cursor to the beginning of the statement number and then to the right over the statement until the position where the change to be made is reached. Now strike over the character to be changed. To delete a character: With the cursor under the character to be deleted, hold down CONTROL and press the letter "o". Continue until all the characters desired have been deleted. To add characters, hold down CONTROL and press "n" and a space will be created. Continue until there is sufficient space for the addition, return the cursor to the beginning of the space created and type in the new material. After finishing, move the cursor over the balance of the statement to the end using the arrow key. IT IS A MUST TO DO THIS OR THE BALANCE OF THE STATEMENT WILL BE LOST! Now press RETURN.
When ADAM lists a program step, it automatically puts in some spaces that are not neccessary from the viewpoint of the computer. These spaces can be used in the editing process.
A WORD OF CAUTION. There is a bug in the SmartBasic program. If the statement is longer than 31 characters (one line on the monitor), the control "o" and "n" will not carry to the second line. This must be watched when editing a statement.
To make changes to the program in RAM, LIST the program after the changes to see if the changed occured. Reenter the program as shown.
When entering a program statement, an error message may be encountered. It is not necessary to retype the statement. Using the arrow keys, move the cursor to the beginning number of the statement typed (not the one reprinted by the computer) and then, still using the arrow keys, move the cursor to the point of the error and proceed to correct. Having made the correction, continue moving the cursor the right with the arrow key until the end then press RETURN. LIST the statement just corrected to make sure its still there. A mistake at this point may result in complete loss of the statement.
Return to the program still residing in memory. A word about the three new commands that were in the program. END in statement number 40 is just that -- it told the computer that the task has been finished. In this case, the computer would have stopped anyway because there are no more instructions in memory. It is good practice to use END however as many programs have subroutines at higher numbered locations in the memory and the computer will go on to those if not stopped. Also, some utility programs place END at the last location in memory as a signal for the subroutine to stop.
FOR and NEXT are two commands that go together -- if one is used so must the other. A complete discussion of these commands. They are useful in this program so will be discussed briefly. Statement 10 says FOR the value of the variable "i" from 1 to 10 do all of the things between this point and the NEXT "i" or statement 30. The first time the computer comes to the FOR statement, it sets "i" equal to the first number (1) and proceeds through the program. When it gets to NEXT "i", it increases the value of "i" by one then checks to see if "i" is greater than the second number in the FOR statement, 10 in our case. If it is not, the computer repeats the instructions following the FOR statement. When "i" becomes greater, (11) in this program, it goes to the next step in the program, or statement number 40. In effect, the computer went through these operations ten times in this program and then stopped. Had the second number in statement number 10 been 100, it would have done it 100 times.
The next new command is the word RUN. When this word is typed, the computer will go to the beginning of the program and start running it. Try it!
A computer program has been written and run!
Try running the program a second time.
Once again, the screen is getting cluttered. Why not take care of this in the program? Type the following and ENTER:
5 HOME
To see what happened, first ENTER the word LIST. There is the statement HOME. Try RUN again. It has been illustrated that statements can be added in any sequence to a program and the program can be made to clear the screen.
Deviating from the topic, examine means of changing ADAM'S speed. There is a command that does this -- SPEED = followed by a number between 0 and 255. When SmartBasic is installed in the computer, the value 255 (the fastest) is installed. This value becomes known as the default value -- or the value unless you change it. Try typing in the command:
SPEED = 10
Now ENTER RUN. Try several different speeds. Having done that, return the speed to 255.
It is sometimes helpful to slow the computer down when having trouble getting the display wanted on the screen. At a slower speed events can be followed much better.
There are two punctuation marks when used in a print statement that change the formatting on the screen. The first of these is the semicolon. A semicolon in a print statement tells the computer to leave the cursor at that point on the monitor and wait for another print statement. To illustrate, add a semicolon to statement number 20 of the program. To do this, enter LIST 20. Now, using the arrow keys, move the cursor to the beginning number of the statement and then to the right to the end (after the quotation mark). Now type ; and then press RETURN. Now ENTER RUN.
Before, John Jones occupied lines 1 through 10 on the screen -- in the absence of any instruction to the contrary, the computer dropped down one line each time it finished printing "John Jones" With the semicolon in the program, it continued printing "John Jones" on the same line until the line was full and then it dropped to line 2 and continued.
Can a space be inserted after each John Jones? Yes, a print statement may be continued to include several things. ENTER LIST 20. Move the cursor to the end and add " "; then press RETURN. The computer has been told to print a space after the phrase John Jones and then hold the cursor at that point. Statement 20 should now look like
20 ? "John Jones"; " ";
Try RUN now.
The screen on the monitor is divided into two zones, each containing 15 columns. The computer can be made to go through each zone. The COMMA is the instruction in a print statement to accomplish this. To illustrate, LIST 20. Now, move the cursor as discussed above to the semicolon and hit a comma which causes the comma to replace it. Use CONTROL o to remove the quotation marks and space then press RETURN. The statement now is
20 ? "John Jones",
Now RUN.
When using the printer, the computer recognizes five zones and will use them even though the screen display is dropping a line after each two zones. To illustrate, put paper in the printer and enter the command PR#1 then RUN. The hard copy of something is not always the same as the screen unless the screen print command (control p) is used in the immediate mode. Don't forget to enter PR#0.
The value of variables may be printed. To illustrate, LIST 20 again. Using CONTROL and n, create a little space after the command print. Now add i;". "; and run the cursor through the rest of the statement then ENTER. Statement 20 should now read:
20 PRINT i; ". John Jones",
Translating, the computer is told to print the value of i (remember it was increasing each time that the computer repeated the instruction) and keep the cursor at that point. Now print a period followed by a space and John Jones. Now move to the next zone. Try RUN now.
TAB is another command that can be used in formatting a display.
This is the same result as hitting the tabulating key on a
typewriter -- it moves the cursor to the specified column. The
format of the command is TAB (x) where x equals the number of the
column where you wish the printing to start. Columns are number
from 1 to 31. TAB must always be used in a print statement. This
can be demonstrated by altering the program again. This time,
start printing in the fifth column on the screen. Type the
following:
20 ? TAB(5); "John Jones"
ENTER RUN. The TAB command will also position the printer. There is a bug in SmartBasic that gives the printer trouble if an attempt is made to tab past column 41. That can be overcome by a number of fixes that are available in print and on disk/tape.
The amount "tabbed" can be a variable. To illustrate, try changing the 5 in statement 20 to the letter i. Now RUN.
Some times it is more convenient to use the command SPC(x) instead of TAB. SPC tells the computer to print the number of spaces shown within the parentheses. The number of spaces can be a variable. The command will also cause the printer to react. Try changing TAB in statement 20 to SPC and RUN.
There are two formatting commands that will change the display on the monitor, but they are not acted upon by the printer. These are VTAB and HTAB. VTAB tells the computer to position the cursor on a specific line number between 1 and 24. HTAB positions the cursor in the given column number between 1 and 31. The numbers may be variables if desired. These two commands ARE NOT USED WITHIN THE PRINT STATEMENT.
There are several variations that may be used with this program. Start the print out on the 10th line. First change line 20 back to its original content:
20 ? "John Jones"
What does that do?
Now ENTER
7 VTAB 10
ENTER RUN.
If it is desirable to have the print out start in column 10, the command will be in a different position in the program. Try ENTERING
15 HTAB 10
RUN. To see the difference, delete statement 15 and add
8 HTAB 10
Why the difference in the printouts? In the last case, when the program was RUN, the computer cleared the screen, positioned the cursor at line 10 (statement 7), column 10 (statement 8) and then printed the first JOHN JONES. It then moved the cursor down to the next line (number 11) in the number 1 column and printed JOHN JONES again.
Why did the first version (15 HTAB 10) handle it differently?
The discussions to this point have been directed towards displaying material on the monitor, and communicating between ADAM and the programer. One of ADAM's bigger break throughs for relatively inexpensive home computers was the tape drive system. T0 demonstrate how the system works:
Reenter the John Jones program into RAM again if its not im memory. Now place a digital tape in the tape drive. (Multiple drives will be covered later.) The program in RAM may be SAVEd onto the tape under any name desired. Names must begin with a letter (not a number), but they may contain numbers, characters, etc. They are limited to 10 characters in length, but can be less. With the tape in the drive ENTER SAVE JONES . The tape drive sprang into action and stored the program under the name of JONES. The name could have been anything selected.
To see if a program by the name of JONES was saved, try another command CATALOG with the RETURN key. Displayed on the screen should be a listing of the programs on the tape and the name of the tape. Before each program (or file) listing will be a letter. An A indicates that the program was saved from SmartBasic. An H indicates that it came from SmartWriter or is a data file. A lower case letter indicates that the file is a backup file. That occurs when a file with the same name is stored. A file with a lower case letter can not be directly accessed (more later). The number indicates the number of blocks used in storing each program or file. The number of blocks remaining on the tape is displayed last.
Once a program is on tape, how is it reaccessed?
1. Clear out RAM by typing in the command NEW. That clears everything out of RAM. To be sure, type LIST. There should be nothing there.
2. Type the command LOAD JONES and the digital drive should start. When it stops enter LIST The program should appear and be able to run.
If there had been a program in RAM and the instruction LOAD JONES had been used, the program in memory would have been erased before the new program came in. This effectively prevents merging two programs together while in SmartBASIC. If this happens there are two ways to overcome it. The first requires that copies of both programs on tape (or a disk) be made. Reboot ADAM so that the SmartWriter is available. Now "GET" the first program from the tape into Memory. Move the cursor past that material to the blank line after the program and "GET" the second program, etc. After all of the material is in SmartWriter, make a new copy of the total contents giving it any name. Return to SmartBASIC and load the new copy. CAUTION -- if there are two statements with the same number, one in each program, only the last one encountered will be in The new program. It prevents retyping entire programs again. When this feature is used, some thought should be given to the numbering system to be used. For example, write subroutines 10000 and above and SAVE separately.
The second way is to use POKE commands and should be avoided by new programers.
When a program is finished, to remove it form the tape, the procedure is, enter DELETE along with the program name and ENTER. In the above example the command would be:
DELETE JONES
Files can be renamed. For example, rename JONES,to smith. The command is:
RENAME JONES, smith
When the above is typed, CATALOG will display whether it worked or not. Sometimes it is desirable to change a file name rather than delete it. The need will arise in some programs.
After some use, a tape will get a lot of material on it that is no longer wanted or the tape may be full and can't be used. To recover the tape use the command:
INIT name
The directory block on the tape will be erased and prepared for new entries. When CATALOG is requested the new name of the tape will appear. As the number of tapes (and disks) increases, identification is helpful. CAUTION WHEN INIT is used -- EVERYTHING ON THAT TAPE WILL BE LOST! Copies of desirable programs should be saved before the INIT command is used. TAPES THAT CONTAIN OPERATING PROGRAMS SUCH AS SMARTBASIC, RECIPE FILER, ADAMcalc etc. SHOULD NOT BE INITIALIZED. While the tapes are supposed to be protected, the information might be destroyed
ADAM comes with one digital tape drive in the far left position in the memory console. It is possible to have as many as two tape drives and two disk drives attached. When more than one drive is installed, it is necessary to tell ADAM where to store or get things. Once a drive has been selected, that will be the primary drive until another is selected. When SmartBASIC was loaded, that drive becomes the primary or default drive. (This may not always be the case as a copy of the SmartBasic tape may not have the correction made and tape drive 1 will still be the primary drive).
The identification of the drives is as follows:
Leftmost tape drive d1 Rightmost tape drive d2 No. 1 Disk drive d5 No. 2 Disk drive d6
There is no position description of disk drives as they are external to ADAM. The way they are connected and the position of a switch on the back of the case determine which is disk 1 and which disk 2.
The command
CATALOG, d5
will make the No. 1 disk drive the primary drive. That will remain until another drive is identified. Other ways of identifying a drive are:
SAVE name, d2 LOAD name, d6 DELETE name, d1 INIT name, d1 Any drive designation may used after any commands.
When booting the computer, it will look for a tape in tape drive 1 first. If nothing is there, it will look at tape drive 2, then disk 1 and lastly disk 2. If there is nothing, it will go to the SmartWriter, or if the first drive containing a medium does not contain a system program such as SmartBasic, etc., it will go to SmartWriter.
If a drive in which there is not a tape or a disk is requested, ADAM will patiently wait (without telling you why) until something is put in that drive. That is a point to remember. In that situation, inserting a medium in the last active drive will solve the problem although the result may not be the desired one.
Tapes and disks have to be formatted. Normally, tapes purchased for ADAM are already formatted and are ready to use. Disks are not. The Disk Operating System that comes with a disk drive contains the software for formatting and must be used on each new disk. Once that is done, they may be INITialized many times.
x
Move on to variables. There was a short discussion earlier, but not enough. Any configuration of characters beginning with a letter may be used as a variable name EXCEPT for reserved words. Reserved words are combinations that are used in SmartBASIC. To demonstrate this type the immediate command:
LET pr = 14
PR is a reserved word used to turn the printer off and on. The computer will indicate that a reserved word has been used.
There are programs in which a variables name is several characters long. While ADAM accepts such names, and naming variables is often a convenient way of keeping track of what is being done in a program, ADAM recognizes only the first two characters of a variable. The following exercise is an example. Type the following in the immediate mode:
LET first = 42 ? first Let fire = 100 ? fire ? first
The second time that ADAM was requested to print the value of first, it printed 100 which was assigned as the value of fire. The reason is straight forward. The first command Let first = 42 set the value of fi to 42. The command LET fire = 100 set fi to 100 canceling out the first value of fi. ADAM is not unusual in this trait, but it is something of which to be aware.
Arithmetic operations involving variables may be performed. In the immediate mode type:
let x = 567 let y = 32 let z = 5 let w = 2 ? x + y ? x/y ? y * z ? w/z ? z^w ? x ^ (1/2)
That illustrates the point. Experimentation can be done with many combinations.
String Variables:
Thus far it has been assumed that the variable would equal a number assigned to it. That is not always true. ADAM can make other selections. If the variable is followed by the character %, it will save only the integer or whole number part of the value that is given to it.
Thus far the LET has been used to assign a value to a variable. LET does not have to be used. ADAM will recognize the statement:
x = 123
as meaning, LET x= 123. This convention will be used.
Return to the % character. This can be illustrated by typing, in the immediate mode:
x% = 10/3 ? x%
It is necessary to use the % sign along with x as it is a different variable from x. "x" has already been assigned a value. Type ? x in the immediate mode.
A variable need not even be numbers in any form -- it can be a string. A string consists of one or more characters of any kind and is designated by the character $. An example would be a$, or heck$. Yype this exercise:
a$ = "12 That's it!" ? a$
Strings are usually enclosed in quotation marks although this is not always necessary. ADAM wil accept b$ = Yes since it consists of all letters. If there is any doubt, the use of quotation marks can save time introuble shooting or debugging.
Strings can be added together, but other arithmetic operations can not be performed. An example:
a$ = "dogs " b$ = "and cats" c$ = a$ + b$ ? c$ ? a$ + b$ ? b$ + a$
If an expression is expected to be used several times in a program, assign it to a string variable.
If there is a string variable, the computer can be asked to determine how long it is by the command:
? LEN(a$)
Since a$ = "dogs ", that command should have returned the number 5. The string is 5 characters long as the space at the end also counts as a character. LEN(a$) can be used in a program without printing it out. It can be the value of a variable that is used in centering, spacing, tabulating etc. Type:
? tab((31-LEN(c$))/2);c$
If the string is a number, it must be transferred to a plain number before arithmetic operations can be performed. To illustrate this point type:
no$ = "1234" ? no$ + 1000
Now an error message should be received as the two items are not
compatible. One is a string variable and the other a number.
Type:
? val(no$) + 1000
The answer should be 2234 as VAL(no$) converted the characters to numbers which can be added to 1000.
A number can be converted to a string. To illustrate, type this exercise
g = 32.3245 g$ = str ? g$ + no$ ? g$
no$ which is "1234" was added to g$ which is "32.3245" to yield 32.32451234.
There are definite advantages to converting numbers to strings before they are saved in files. Two applications of strings are in reconciling and rounding mumbers.
ASCII Character Code:
Each key on the keyboard has at least one and sometimes as many as three numbers that describe it. These are known as the ASCII codes. A partial list of these character codes is shown in appedix C, page 12-15, in the Adam instruction manual. The letter p can be used to illustrate three different values. The code for the lower case p is 112, upper case P is 80, and p while simultaneously holding down the control key is 16. This is the way that the computer accepts information from the key board.
The memory console can be addressed directly if character codes are used. Type:
? CHR
A lower case P appears. The command CHR$ tells the computer to use what the ASCII character code is. While experimenting with various values for CHR, caution should be used. For example, if the computer is told to ? chr, it will print out the information on the screen! Type a few chr$ to become familiar with the command. Other examples are 2,3,5,6,15, and 17 thru 31. If sound is available, type ? chr.
The command ? ASC(a$) will return the ASCII code of the first character in the string designated as a$. This command is useful in menus and other selection processes. Because of this characteristic, it can be determined whether a string is greater than or less than another string. This is useful in sorting programs.
There are three other string related commands that will be reviewed at this point. They are left$, right$ and mid$. All deal with strings and not numerical values.
To illustrate these string commands, type:
x$ = "Thermodynamics"
If the computer is asked ? LEN(x$), it will return 14. There are 14 characters in the string. Starting from the leftmost character as many characters as desired can be requested. If the first 5 characeres are desired, type the command:
? left$(x$,5)
The screen should display the word Therm. The first identification inside the parenthese was the name of the string while the second was the number of characters wanted. The command that would give you the first 7 characters is:
?left$(x$,7)
If the last five characters is desired, the command is:
? right$(x$,5)
If the five letters starting with character number 5 is desired, the command is:
? mid$(x$,5,5)
The string in question was identified, it was told to start with the fifth character, and to identify five characters. Start with character number 8 to demonstrate the command again.
To write a program to print each character of the string one at a
time:
1. Enter the word NEW to clear any other programs from Memory. 2.
Type:
10 home
20 x$ ="thermodynamics"
30 for x = 1 to 14
40 ? mid$(x$,x,1)
50 next x
60 end
RUN the program. It is not necessary to SAVE the program as it is only for practice.
There is an important point in the above program. There was both a string variable identified as x$ and a numerical variable called x in steps 30 and 50. ADAM can tolerate the same name for different types of variables.
Numerical variables: Variables in BASIC as well as in many other computer languages have an interesting capability. This expression can be used:
x = x + 1
In classical mathematics, there is no way that this can be so. But there is in programing language. It means let a new value of x equal the old value of x plus 1. If x were 10, it would be 11. Other arithmetic operations can be used in these expressions such as x = x*10 etc. There is no limit, but there is a restriction. The form is always the variable by itself, an equals sign and then the old variable and the operation desired.
The first time that ADAM encounters a variable in a program, it will be considered equal to zero unless some other value was set earlier in the program.
The command CLEAR will return all variables to the value zero or nothing in the case of a string variable. Nothing can be indicated for a string variable by x$="".
When the command RUN is used, all variables are returned to zero or nothing.
i
There are several ways to get information into the computer while it is running a program. The first is the command INPUT. INPUT will cause the computer to wait until it has been given some information and RETURN pressed to tell it that is all. It is an unusual command in that it can also include a prompt to tell you what it is waiting for. This principle can be illustrated with a simple program. Type:
NEW 10 home 20 INPUT x$ 30 ? x$ 40 ? 50 END
Assume that the computer wants your name when it stops. ENTER RUN. The screen shows a question mark plus a blinking cursor, but nothing else. Type your name and then press RETURN. Now the program continues. Statement number 40 is a new situation. It says print nothing. The computer skipped down one line and then went through its END procedure.
This program can be improved. Rewrite statement 20 to read:
20 INPUT "What's your name "; x$
Now RUN the program. The characters inside the quotation marks printed out to tell what the computer wants. Note that the space at the end of name makes the screen look better; otherwise the answer would have immediately followed name. Also, there is no question mark as before. If the question mark is wanted, add it after the word name in statement 20. Remember the earlier discussion on editing. Try it.
A second way to get information into the computer is to use the command GET. There are both advantages and disadvantages to this command. The main disadvantages are, you can not print a prompt as part of the command statement. Any prompts are printed ahead of the GET command. Second, the information is not printed directly on the screen. Thirdly, the information can consist of only one character. The advantage -- it is quick and requires only one key stroke. RETURN does not have to be pressed. This program will illustrate both the GET command and the ASCII codes for keys. Type:
NEW 10 Home 20 ? "Enter a key stroke" 30 GET q$ 40 ? q$, asc(q4) 50 ? 60 ? "Hit any key to continue" 70 GET x$ 80 IF x$ = "q" then END 90 GOTO 10
This program contained two new features. The first one was IF/THEN. This is a conditional transfer statement that is necessary to get out of a continuous loop. To end the game, press "q" key when requested to hit any key and the program will end. There will be more information on IF/THEN statements later.
The second new one was GOTO. It instructs the computer to go to statement 10 and continue running.
The program prints out the key pressed (if it is a printable character) and then prints the ASCII code for the key. This is a useful program if there are doubts about the chr$ code of a key. Try pressing some keys holding down the SHIFT key. Try some holding down the CONTROL key but avoid the "p" in that mode. Also try some of the various command keys such as UNDO, GET, etc.
This principle will be used frequently in menu driven programs as it makes selection quick and provisions can be made for miscellaneous errors.
The following is a program to demonstrate materials presented. To
illustrate steps, some comments have been put at the side -- dont
type these comments into the program. The program is called
GROCERIES:
10 eggs = 1.24 20 bread = 1.19 Sets cost of items 30 milk = .79 40 HOME Clears the screen 50 INPUT "How many dozen eggs? "; x1 60 INPUT "How many loaves of bread? ";x2 70 INPUT "How many quarts of milk? ";x3 80 sum = 0 Makes sure that sum equals 0 to start 90 HOME 100 ? x1; " doz eggs"; tab(24); x1*eggs 110 sum = sum + eggs*x1 Adds cost eggs to sum 120 ? x2; " lvs bread"; tab(24); x2*bread 130 sum = sum + bread*x2 adds bread 140 ? x3; " qts milk"; tab(24); x3*milk 150 sum = sum + milk*x3 adds milk 160 ? 170 ? "Total"; tab(24); sum Prints out total cost 180 ?: ? "Would you like to go shopping again -- y or n?: get q$ 190 IF q$ = "y" then goto 40 200 ?:? "Thank you!": END
There are some new features in this program. The first was the use of a colon in statements 180 and 200. The colon indicates that that is the end of one command and the start of another, but all the same number statement. The next word must be a command or ADAM will not accept it. One statement may contain up to 128 characters including spaces. There is information available on how to increase that number. Sometimes it makes the intent clearer if several things are included in one statement. It is a matter of choice. RUN time is decreased when multiple commands are used in one statement.
The conditional transfer IF/THEN was used in 190. If y had been pressed the computer would have transferred to statement 40 and continued running. If any other key had been pressed, the program goes to to 200, prints "Thank You" and stops. As a short cut, the GOTO following THEN in 190 could have been ommitted. It could have read:
190 IF q$ = "y" then 40 RUN this one.
Another way of handling data is through the use of DATA/READ statements. This can be illistrated by using GROCERIES which is still in the computer. DATA statements always start with the word DATA and then list items of information, each separated by a comma until all the required information is listed. Do not use commas in numbers such as 1,024 for one thousand twenty-four. The computer will think that the number is 1 and will ignore the rest or use it someplace where it shouldn't! These statements can be any place in the program as long as the data is listed in the order that it will be needed. The READ commands then assign the data in the DATA statement to variables. Del 20,40 from GROCERIES. Now add the following: 5 data 1.24, 1.19, .79 10 read eggs 20 read bread 30 read milk
Now RUN the program. It worked!
To illustrate that the data statement can be any place in the program, do the following:
LIST 5
Using the arrow keys as discussed in editing, change the number of the statement to 195 and then press RETURN. Remember to run the cursor completely through the statement before reentering. Try LIST 195 to see if the statement is in memory. If it is, type 5 and RETURN which effectively deletes statement 15 from the memory. Enter LIST to see if the program is correct. If so, RUN. There is another way of handling the READ statement. To illustrate this way, once again DEL 10,30. Leave the DATA statement at 195 where it is. Now enter the following:
20 READ eggs,bread,milk
RUN again. You still have the same results.
If all of the data has been read once, and another READ statement is given, you will have a problem. To illustrate, change the GOTO address in statement 190 from 40 to 20. Now RUN the program again. The first time was fine -- what happens when you responded to the question y or do it again? An error statement was received. ADAM remembers where the data statements are and keeps track of each piece of data as it is used. When there are no more data points, it preceives an error when it comes across a READ statement again.
RUN the program again. This time it ran for the first time. Why? The command RUN resets the pointer in ADAM to the beginning of the DATA statements.
There is a command that will take care of this problem: RESTORE. When the computer comes ascross this command, it resets the DATA pointer to be the beginning of the DATA statements thus they are ready to be READ again. Change line 190 to read as follows:
190 if q$ = "y" then RESTORE:GOTO 20
RUN the program again. Now it can be repeated without difficulty.
The FOR/NEXT commands were introduced earlier and have been used
in some programs. They warrant more discussion. The full command
is:
FOR I = 1 to 10 STEP 1 NEXT I
The STEP 1 at the end of the first statement indicates that the increments have a value of 1 each time. If no STEP instructions are given, ADAM assumes that it is STEP 1. Had the instruction been STEP 2, i would have had the values of 1,3,5,7, and 9. There is no 10 because the next value of i was greater than 10 so the computer ignores it. A program will illustrate the point. Type:
NEW 10 home 20 for i = 1 to 15 STEP 1 30 ? i 40 next i 50 end
RUN the program. The numbers 1 through 15 should appear along the left side of the monitor screen. Change the size of the "STEP" in statement number 20 to numbers that are selected and then RUN.
Programs can decrement (subtract from the total) rather than increment. Change statement 20 to read as follows:
20 for i = 15 to 0 STEP -1
RUN the program. Change the step number to several different values and RUN.
If the step value is negative, the largest number must be listed first in the FOR statement. For a positive value, the smaller number is listed first.
More than one FOR/NEXT loop can be utilized at the same time. These are called "nested loops". ADAM can handle up to six nested loops without getting lost. Thinking of the loops as statements in a program, you must complete the innermost loop and then work out towards the outer loops in order. A short program will help to understand this concept. Start of off with NEW
10 home 20 for i = 1 to 10 30 ? "i = ";i; " "; 40 for j = 0 to 9 50 ? j; 60 next j 70 ? 80 next i 90 ? 100 ? "That's All" 110 end
Note that the FOR j in statement 40 and NEXT j in statement 60 form the innermost loop. FOR i in 20 and NEXT i in 80 form the outermost loop. This program does the following things. First it will clear the screen, a standard operation. Then it will set the value of i at 1 and go to step 30 where it will print the value of i followed by a space and then hold the cursor at that point. It then sets the value of j at 0 and prints the value of j once again holding the cursor position through the use of the semicolon. In step 60 it increases the value of j to 1 (0 + 1) and prints the value of j still holding the cursor. This will continue until the value 9 has been printed for j. The cursor is still on the same line that we started with. The semicolon does this. To start a new line, the cursor must be released from where it is. This could have been done in step 70 through the use of the VTAB and HTAB commands. It is easier to have the simple instruction in 70 of PRINT. ADAM will PRINT nothing, but it will then be released to drop down one line. Step 80 now says increase the value of i by 1 and go back to 30 unless i is greater than 10.
The following should be on the screen:
i = 1 0123456789 i = 2 0123456789 etc. through i = 10.
RUN it and see if it is right.
Try writing a program that has three nested loops, i, j, and k.
Hint: you can make k the 0123456789 string and proceed it with
the values of i and j.
You need not have written next i, next j etc. The word NEXT will be sufficient. ADAM will go back to the proper loop in the nest, and increment or decrement as appropriate. Try it and see.
s
Transfers: Both hard transfers (GOTO) and conditional transfers
(IF/THEN) have been mentioned, but more review is warranted.
Transfers add to a computer's capabilities. It can react to
specific situations and take different routes depending on what
develops while running a program. At the same time, transfers are
a challenge to the programmer because all of the
possibilities must be considered and built into the program.
The simplest of the transfer commands is GOTO xxxx where xxxx is a numerical address. (ADAM does not permit the use of variables in the address except in a limited sense. Some computers will permit some operations on the address. ADAM can accept some of these by doing some machine language programming. A valid question would be "Why bother?" with GOTO, just write the proper route in the program. That is generally true although there are conditional situations where, depending on information available, it might be desirable to leave one route and go to another. GOTO is most useful in conjunction with an IF/THEN statement.
If ADAM is told to GOTO an address where there is no program statement, an error message will appear and the program will stop. Changing statement numbers without changing the GOTO statements is a frequently found error. There might be occasions when a program reserves specific program space for additional information and starts with a different set of instructions. Later it is discovered that the reserved space is not sufficient. To avoid going back and renumbering in increments of less than 10, a GOTO statement might be used.
Subroutines: A more useful transfer is the GOSUB xxxx command
where xxxx is a number address. The command RETURN (NOT THE
RETURN KEY) must be used in conjunction with GOSUB. These are the
commands for subroutines.
There are some operations or routines that may be desirable to utilize several times in the course of program execution. To avoid repetitous writing and wasting space in RAM, subroutines can be used. A subroutine can be defined as a block of statement numbers out of the range of the main program. The statements of the subroutine are written once and the last statement of the subroutine is xxxx RETURN.
When the computer encounters the command GOSUB xxxx, it remembers where it is, goes to the new address, and performs all the operations within the subroutine until it finds RETURN. On that command it will return to the first instruction after the GOSUB xxxx command and begin execution of the main program again. Type:
10 home 20 x = 32 30 gosub 1000 40 gosub 2000 50 x = 150 60 gosub 1000:gosub 2000 70 input "Your value for x? "; x: gosub 1000: gosub 2000 80 END 1000 y = x*3.14159 1010 RETURN 2000 ? "x = ";x; " y = ";y 2010 RETURN
This program explains why the command END is necessary in a program.
Had END not been the final instruction of the main body of the program the computer would have executed the next sequential instruction or the subroutines. When the instruction RETURN had been reached, there would have been no address to which to return.
Using subroutines and GOSUB, the computer returnes to its last command each time as it finishes the subroutine called for by the return statement. Statement 60 illustrates that ADAM can still return to the proper point even if the GOSUB is in the middle of a single statement containing multiple commands.
Multiple subroutine branches can be nested within one subroutine (total of six subroutines).
Subroutines require precise preparation. Information must be provided in the same form as the main body of the program and use the same variables as the main body of the program. Avoid changing the value of a variable accidentally in a subroutine. To guard against this possibility, double letter variables can be used in the subroutines. An example would be FOR ii in the subroutine and FOR i in the main program. That way, the subroutine loop can not interrupt the established values of the main loop, or the main program.
There might be a situation where it is desirable to leave the subroutine with a hard GOTO transfer. If it happens very frequently while running a program, a problem will arise. Upon finding the SUBROUTINE command, ADAM stores the address that it is at on a stack of numbers. Each time RETURN is found during execution it goes back to that address and removes the number from the top of the stack. The GOTO command bypasses the RETURN command hence the number is not removed from the stack. Eventually the stack will get full. The next time that ADAM needs to put a number on the stack, it can't so it quits and gives an error message. A program will illustrate this point. Print:
10 i = 0 20 ? i 30 gosub 500 40 if i = 500 then end 50 goto 20 60 END 500 i = i +1 510 goto 40 520 RETURN
When this program is run ADAM gives an error message when i = 31.
A subroutine can be exited by the command RETURN, or if that is awkward there is another command that takes care of it, POP. POP discards the last number on the top of the stack.
Change statement 510 to read as follows:
510 POP: goto 60
Run the program.
Another point on subroutines: Even though a subroutine resides from statement 1000 to 1200, it might be entered someplace other than 1000 if it is appropriate to do so. The xxxx in GOSUB xxxx must be a statement number that contains something.
Conditional transfers occur on IF/THEN statements. The computer can check for several different conditions. They may be defined as follows:
= if equal to < if less than > if greater than =< if equal to or less than => if equal to or greater than <> if not equal to NOT if not AND if condition 1 and condition 2, etc. OR if condition 1 OR condition 2, or etc.
If the condition tested for exists THEN proceed with the rest of the statement. If the condition does not exist, THEN ignore the rest of the statement and go to the next numbered statement and continue.
The statements might be:
if a = b then goto 4000 That is straight forward -- if a = b then goto step 4000 and continue processing.
340 if x > 31 then x = 1 350 ? x
If x is greater than 31 then let x = 1 and go on with the rest of the program.
340 if x < 100 and x > y then gosub 1000
If x is less than 100 and x is greater than y then gosub 1000. Both conditions must exist. If x = 5 for example and y = 60 the computer will go to the next numbered statement and not to subroutine 1000. There could have been additional conditions in this statement each proceeded by the word AND.
340 if x <= 100 or y >= 100 then ? "Good": END
If either x is less than or equal to 100 or y is greater than or equal to 100 then ? "GOOD" and end the program. Either condition can end the program if it exists. What range of values would not end the program.
Strings can be used in IF/THEN statements. For example cat is less than dog. Why? The ASCII code for c is less than the code for d. Type the program:
10 home 20 input "a$? "; a$: input "b$? "; b$ 30 if a$ < b$ then ? a$: goto 100 40 ? b$ 100 ? "Want to try again - y or n?": get q$: if q$ = "n" then end 110 goto 10
Sorting lists alphabetically:
ENTERing 2345 for a$ and 3 for b$. ADAM returns 2345 as the smaller string. The computer looks at the character codes for the characters and compares one at a time starting with the first one. 2 has a lower code than 3 thus the computer never got any further. Type 2345 and 237 for a$ and b$ respectively.
More than one IF/THEN command can exist in one numbered statement. However, if the first condition is not met, the second and each subsequent IF/THEN command will not be tested.
i
MENUS: that is not a command, but a topic for discussion. When
programs are written to do more than one thing, the menu is the
tool for selecting which operation the computer is to do. The
following sample program makes use of many of the commands that
have been discussed so far and introduces at least two more. The
menu goes through several different approaches. SmartKeys and
POKing are utilized.
Type in the following program and SAVE it under any name. The program presents a menu that permits selection of five arithmetic operations. There will be several different versions illustrating various commands. The "best" one will depend upon the needs of the program and the preference of the programmer.
10 HOME 20 INPUT "a,b? "; a,b 30 GOSUB 1100 40 ? "1. a + b" 50 ? "2. a - b" 60 ? "3. a * b" 70 ? "4. a / b" 80 ? "5. a ^ b" 100 ?: INPUT "Select Option "; x 120 IF x = 1 THEN GOTO 600 130 IF x = 2 THEN GOTO 700 140 IF x = 3 THEN GOTO 800 150 IF x = 4 THEN GOTO 900 160 GOTO 1000 200 ? : ? "Try another - y/n?": GET q$ 210 IF q$ = "n" THEN END 220 GOTO 10 600 REM addition 610 GOSUB 1100 620 ? "a + b = "; a+b: GOTO 2000 700 REM subtraction 710 GOSUB 1100 720 ? "a - b = "; a-b: GOTO 2000 800 REM multiplication 810 GOSUB 1100 820 ? "a * b = ;" a*b: GOTO 2000 900 REM Division 910 GOSUB 1100 920 ? "a / b = "; a/b: GOTO 2000 1000 REM Exponentiation 1010 GOSUB 1100 1020 ? "a ^ b = "; a^b: GOTO 2000 1100 HOME: REM Clear screen & ? variables 1110 ? "a = "; a; " b = "; b: ?:? 1120 RETURN 2000 GOTO 200
Statement 20 illustrates a way of getting multiple pieces of data in one step. To input the data, the entry would look like:
3,7
With those numbers, "a" will equal 3 and "b" will equal 7. More variables could have been in the statement if necessary.
REM, the command shown in statement 600 etc. is, literally, a REMINDER note. When the computer sees that command, it goes to the next numbered statement, ignoring the material following REM. The programmer can tag parts of the program with notes that tell the purpose, give instructions, etc. When the programs get longer, it is useful, at least while writing and degugging, to have REM steps. Some recommend the use of logic diagrams. Others use a block, flow-chart approach. It is recommend that notes be kept regarding the numerical location of various steps of the program.
SAVE the program!
RUN the program several times.
The INPUT command is used to make menu selection. This has some advantages. The choice can be seen before being acted upon (by pressing the RETURN key) and corrected if an error has been made. Also, the choice can involve two characters or more if desired. The program is relatively unprotected, however. Step 160 assumes that the choice will be number 5 if it has not been 1 through 4. What would happen if 7 had accidentally been pressed? The result would have been 5. In the program, the error would be obvious in the result, but if the operations were complex, the mistake might not be noticed.
The menu could be "protected" by making the following changes:
160 IF x = 5 THEN GOTO 1000 170 ? "Try again": goto 100
There must be an entry within the 1 to 5 range or a reentry will be requested.
Still another way of protecting the menu would be to delete statement 170 and add the following:
110 IF x < 1 OR x > 5 THEN ? "Try again": GOTO 100.
Statement 160 can be either the original one typed or the one changed to. It doesn't make any difference as x must between 1 and 5 or a reentry would have been requested.
A GOSUB routine could have been used in the menu. This can be illustrated by using the program with the changes listed above and making the following additional changes:
In statements 120 through 160, change the GOTOs to GOSUBS.
Change 2000 to read 2000 RETURN
RUN the program with these changes.
Modify the program to use the GET command instead of INPUT in statement 100. RUN again. The response difference is obvious. There are limitations however. 1. Only single digit numbers can be used. If that is a limitation, letters instead of numbers can be used and that gets you to 26 choices. 2. There is no way of stopping the program at the menu level. When INPUT is used, execution can be stopped by the control C RETURN route. Using a menu selection item to stop the program execution is a definite advantage. The computer can check to see if any files need to be updated, closed, or any other housekeeping items performed before the data in RAM is destroyed. In the current program, statements 200/210 let it stop.
SmartKeys I through VI have been completely ignored. In fact, the
Coleco instruction manual also ignores them. Actually, they have
ASCII code numbers just like all the other keys. These numbers
are:
SK I 129 Shifted SK I 137 SK II 130 Shifted SK II 138 SK III 131 Shifted SK III 139 SK IV 132 Shifted SK IV 140 SK V 133 Shifted SK V 141 SK VI 134 Shifted SK VI 142
A note of these character codes should be made in appendix C of the Coleco SmartBasic instruction manual.
The SmartKeys can be used in the menu. To do so, the commands must be changed a little. A string variable rather than a number must be INPUT or (GET) then converted to an ASCII code. The program can be changed to do this.
In steps 40 through 80 change the numericals to Roman numerals I through V. Now make 100 read as follows:
100 ? "Select Option": get a$: x = ASC(a$)-128
The last part of revised statement 100 effectively gives numbers in the range of 1 to 5 for the value of x.
RUN the program now.
ON x GOSUB is one of the most useful menu commands. It simplifies
writing the program and also works well with the block diagram
type flow chart. "x" is shown as the variable, but any variable
can be used. It is required that the variable have a value
starting at 1 and going as high as necessary in increments of 1 to
accommodate the number of choices. To use this command in the
working program, delete statements 120 through 160 and enter the
following:
120 ON x GOSUB 600, 700, 800, 900, 1000
This is a clue as to why the ASCII codes were converted for the SmartKeys by subtracting 128. Statement 120 says for the computer to GOSUB 600 if the value of x is 1, 700 if the value is 2, 800 if 3, etc. If the value of x is greater than 5, the computer will go to the NEXT numbered statement.
RUN the program now.
After the program is debugged and running, SAVE it as it will be used again for modifications.
There is a very similar command that states ON x GOTO. It works the same as the GOSUB one currently in RAM, but the commands must be altered to a format similar to the initial program used in this test. The changes should be made in order to gain experience. The result of an erroneous entry is the same as the ON x GOSUB command.
Using SmartKeys, a menu can be created that will look somewhat similar to the menu on SmartWriter and other commercial software. The keys will be at the top of the screen rather than the bottom.
Several new concepts will be presented to accomplish this goal. The order of process is going to be influenced by the choice of colors used.
Formatting the display requires more discipline than previously encountered. There is more information on this subject in a book called "ADAM'S COMPANION".
The following is a string that contains nothing but 31 spaces. This is done with the following program statement:
For i = 1 to 31: BL$ = BL$ + chr: NEXT
Referring to the ASCII table, a space is character 32. This program step says that starting with BL$="", add character 32 to the string 31 times.
Using a piece of ruled paper with 31 or more lines, turned on its side, number each of the columns that result. Since we have six SmartKeys, we can allott five columns to define each key. Further, we can use five spaces, give or take, to enhance the description. Copy the information onto your sheet with the numbered columns. It will look something like this:
1111111111222222222233 1234567890123456789012345678901 I II III IV V VI a+b a-b a*b a/b a^b
It can take several attempts to get the spaces correct when printing these program statments.
The cursor will be kept on the same line so it will be necessary to use VTAB and HTAB commands. The program shifts the cursor not the computer!
Another new command is POKE. The companion command is PEEK. The PEEK command will reveal the numeric value at a particular address in RAM. These numbers are what make the computer do what it does. Numbers themselves in RAM can either represent a command to do something or are information required for commands to work upon. In the immediate mode, ENTER
PRINT PEEK(16995)
A zero "0" will appear on the screen. Zero is the number which is in address 16995. That is the line number on the screen below which scrolling starts.
The number that is at a given address can be changed by using the POKE command:
POKE xxxxx, abc
where abc is a number from 0 to 255. POKING can be dangerous to ADAM's health. If a number is put in the wrong place, the actions of the computer may be completely changed.
With SmartBasic loaded, type the following in the immediate mode:
HOME: VTAB 1: HTAB 1: ?" HI UP HERE ON LINE 1": VTAB 6 POKE 16995,4 FOR I = 1 to 10: ? I: NEXT HOME: for I = 1 to 50 : ? I : NEXT
There is a message on line 1 and some numbers below line 4, but HOME will not touch anything above line 5. ENTER the following:
VTAB 4: HTAB 1: ?"You can't get me on line 4!":vtab 6 HOME:FOR I = 1 TO 50: ? I: NEXT ? PEEK(16995) TEXT ? PEEK(16995)
When 4 was POKED into the address 16995, the area from line 4 up was left on the screen while changes were made below. This demonstrates that that area could be accessed by using the VTAB command. It has verified that the value 4 was in address 16995. Even though HOME wouldn't clear the top of the screen, the command TEXT would and it also reset the value in address 16995 to 0, the starting point. It is this mechanism that will let the programmer get the SmartKeys to the top of the screen and keep them there.
If not already in RAM, load the menu program that used ON X GOSUB and make the following changes:
DEL 40,80 5 GOSUB 5000 5000 REM let BL$ = 31 spaces 5010 for i = 1 to 31: BL$= BL$ + chr: next 5020 SK$ = " I II III IV V VI ": REM 31 chr$ 5030 D1$ = " a+b a-b a*b a/b a^b" 5040 HOME: For i = 1 to 3: VTAB i: HTAB 1: ? bl$;: next 5045 VTAB 1: HTAB 1: ? sk$;: vtab $ HTAB 1 5050 for I = 1 to 31: ? "=";:next: vtab 6 5060 poke 16995,4 5070 RETURN
Change 40 to read
40 V enjoy it. With the 256k memory expander added, and a disk drive, the poor machine probably hasn't yet perceived its full role here in the 'snake pit'. Wait till it gets a load of the IDE hard drive.
On my first visit to St Vincent de Paul, I made a halfhearted attempt to explain to the sales lady that this computer offered more than enough capability for the beginner, and that if someone bought it, I would be pleased to provide assistance with setup and such. That produced a blank stare from the other side of the sales counter, and a clear threat that if the silly machine didn't get sold in a few days it was going out. I wasn't exactly sure where 'out' was, but it sounded scary.
Later it occurred to me that most likely nobody, nobody inthis town had any idea of just how useful an ADAM can be. Nobody knew, and nobody cared. With one or two exceptions, in this town ownership of an 8 bit computer brands you as some some sort of kook, particularly if you talk about it. , make the following changes:
5040 HOME: INVERSE: FOR i = 1 to 3: VTAB i: HTAB 1: ? BL$;: NEXT 5050 NORMAL 5060 poke 16995,3 40 INVERSE: VTAB 2: HTAB 1: ? D1$;: vtab 7: htab 1: NORMAL 200 VTAB 2: HTAB 1: INVERSE: ? BL$; 220 vtab 10: HTAB 1: NORMAL 240 IF x= 129 then VTAB 2: HTAB 1: INVERSE: ? BL$;: NORMAL: VTAB 10: GOTO 10
Type RUN again and see how that works. This should be saved again as another change is going to be made and there is a danger that the entire program could be lost in the process.
It is possible to use other colors for the SmartKey area that has been created.
The number in address 17126 determines the screen/text colors when printing in INVERSE. The color coding is different than that shown for either low resolution or high resolution graphics in the COLECO instruction manual. For this purpose, the following color codes apply:
1 black 9 light red 2 medium green 10 dark yellow 3 light green 11 light yellow 4 dark blue 12 dark green 5 light blue 13 magenta 6 dark red 14 gray 7 cyanide 15 white
The number in 17126 represents
16 * (color of letters) + color of background
Since there are transparent letters (the same as the black background) which is number 0 and white background number 15 when using inverse, the number should be
16*0 + 15 = 15
In the immediate mode, ENTER ? PEEK(17126). The result should be 15.
If white letters on a light blue background are desired the number would be: white letters 15 light blue background 5
15*16 + 5 = 245
Use the last program and add the following instruction to accomplish it:
3 poke 17126,245:TEXT
When the addresses that change colors are POKED, it is necessary to use the command TEXT to effect the change. ADAM only checks color instructions during the TEXT subroutine.
Run the program now!
More color options are available from other texts.
d
From: "Dale Wick" <dalew@gateway.truespectra.com>
Subject: Re: Interesting info about IDE...
Rich Drushel said:
> I'm the one responsible for the ADAM mention...I bought a GIDE
> about 2 years ago ($72), and have never had time to assemble it
> I'm pretty sure that Mark Gordon's (Tony Morehen's?) low-level
>IDE interface could be made to work with the GIDE. Sigh. The
>GIDE is an elegant little board; as I recall, it was slightly
>in the way of the VDP (so you'd have to pop off the cemented-on
>VDP heatsink to get clearance).
Dale Wick replies: Does that make me responsible for the CD-ROM driver? I've been working on it. I have it to the point where I can control the eject button on the front of a CD-ROM drive, and lock a CD in the drive but nothing else yet. The next step is to get the block transfer of data to work correctly. I have it working on one model of IDE/ATARI CD-ROM drive, but I just bought a newer one (24x CD-ROM) and it isn't reliable. So I went a got a recent ATA-3 specification so that I do the ATAPI requests correctly. We'll see how it goes, but I may yet have a CD-ROM conversion program that can read ISO-9660 CD-ROMs, and copy files to a CP/M or to EOS. The first step is to transfer data though. My code is being developed in MIC, and I would imagine that it will be portable to other 8-bit systems with IDE adaptors.
Dale
From: pease@juno.com
Hello to all you hardy Adam users!
I am a long time Adam lover, got one for $600 way back when they first came out. I eventually developed "Bible Jeopardy" and two BASIC packages called "Royal Ambassador Education Pack 1 & 2" I still have most of my Adam gear and ALL of the software! I have over a hundred disks from the user groups libraries in CPM, BASIC and LOGO. I have lots of the cart games on tape and disk, too. I am willing to do whatever legal copying I can do for others that want copies. (a modest copy and shipping fee should be all that I charge).
I have disk drives and computer consoles for sale, too. And other hardware.
Email me for questions or comments or offers of "large sums of money" for my classic computer collectables! (just kidding...I will sell for less than I paid for the hardware items.)
Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]
I stopped by the library to find some information on the TMS 9918 VDP that's used in the ADAM and stumbled across this. I also found an informative article on how to program 68701 microcontrollers as well.
This is from the Sept '83 issue of Popular Science: regarding the summer CES '83...
"Adam was the sensation of the show. It attracted attention because it offers a complete system at a price far below any- thing available until now. The system includes a computer with 80k of memory, full-size keyboard with word-processing function keys, high-speed data recorder, and, most surprising, a letter- quality printer. The package also includes BASIC, a word-pro- cessor program, and a game. The price: $600.00 for everything. All that's needed is your home TV."
We all know this information. Down the aisle from Coleco though was Atari, peddling a "similar" system for $600.00
"It's a public-relations coup, nothing more," a rather upset anonymous spokesman for Atari retorted, referring to the over- whelming attention Adam has been paid. "Did you get a chance to even touch Adam? Have you spoken to anyone who has? How good is its software? You've got to look at a competitor with respect, but we have three systems now-ready to go-at a comparable price."
(Now, I'll interrupt here and say that this seems an awful lot like the pot calling the kettle black...considering that the ADAM already had a tremendous amount of software available for it in the form of ColecoVision cartridges...which we know are high-quality software programs, and outnumber those available for Atari's own rival 5200 SuperSystem. Just thought I'd throw that one in there. :)
Now, here's what Atari's idea of a "comparable price" was...
"The system includes Atari's 600XL computer, AtariWriter word- processing software in a plug-in cartridge, a book on how to write, paper, and a letter-quality printer that types at 20 cps. (that's twice as fast as the Adam's printer.) To complete the system, you'll have to add a disc drive or cassette recorder- to save or retrieve your text- and a TV."
Okay, so Atari's idea of comparable in price to the ADAM was to give you a system that had only 16k of memory, NO STORAGE CAPABILITY (at least at the $600.00 price tag) and a printer that's twice as fast. This is actually quite typical of Atari back in those days.
What I find extremely interesting about the article is the contradictory specs found throughout that are different than the production model Adam...for example: They show a picture of the Expansion Module #3 (the ColecoVision upgrade) and it doesn't have the typical DDP drives in it. Instead it looks as though you would insert cassettes the same way you would in a car. The unit is also physically smaller...about the same depth as the ColecoVision. In addition, the following statements were made in the article: "Each cassette holds up to 500,000 bytes of data and can transfer data at about 19.2K baud."
We know now that the Adam DDPs can hold only 256k, rather than 500k, and are substantially faster than 19.2k bps. ' "...That makes it CP/M compatible," said Kahn. To actually use CP/M, however, you'll have to add a CP/M option, disc drives, and an 80-column display board that will be available soon." ' Very interesting, that...about the 80-column display board. Hmmm.... "Most of the electronics for the Adam system is contained in the main console, including the main power supply, which also powers the printer." We know that this is not true now. :) The PS of course is housed in the printer. They also mention a release date 60 days past the publish date of the article (Sept '83), which would place the release in November. November articles reveal that the release date was pushed past the Christmas '83 season.
Oh yes. I think that the DDP's are not what we were supposed to get as well. While Coleco was working on the Adam, they were also developing a device known as the Super Game Module. Now, essent- ially the Super Game Module was supposed to be a memory upgrade and a drive for larger games than would fit economically on a cartridge (the unit is about the size of Expansion module #1... the 2600 adapter). Pilot games for it included Zaxxon, Super Buck Rogers, and Super Donkey Kong. Sound familiar? However, the Super Game Module was not designed to use the familiar DDPs. Instead it was to use what was called a 'Wafertape' drive, which holds approximately 160k per tape, and is housed in a cassette which is physically about the same dimensions as a 3.5" floppy disc (though a bit deeper). This was never produced however, from what I've seen it appears that the agreement between Coleco and the company that manufactured these Wafertape drives broke down, and likely Coleco didn't want to give CV owners a choice between a cheaper Super Game module and the relatively more expensive Expansion Module #3. At about this time, TI was also supposed to get the Wafertape drive as well, they called it WaftertapeTM, and information about it can be seen on the back of the beige console's box...however, again I don't think this was produced. At any rate, I think Wafertape would explain the 3.5" disk drive-like slot on the front of the pictured Expansion Module #3. This is mostly speculation on my part, but I do think it fits the scenario very well.
Anyways, the article I found rather interesting, and I thought I would share it. :)
*Geoff Oltmans*
http://home.sprynet.com/sprynet/geoff
Subject: Interesting info about IDE...
Well, in my searching through the internet I located a page containing information for GIDE...the Generic IDE interface for 8-bit computers....the following statement caught my eye.
> The GIDE board plugs into a Z80 CPU socket, and the Z80 CPU
plugs into the GIDE board. The first round of boards in the US
has gone to developers, since software needs to be written for
different systems. As of January 1996, several developers in
the USA have boards and are writing software for the clock and
for the IDE drive. As their software is received, it is includ-
ed with the development kit, and distributed via the Internet
to all previous developers. An IDE BIOS for the TRS-80 has been
recieved, and developers are writing code for a number of CP/M
systems, the ADAM, and a CD-ROM interface!
Hmmmm! Isn't that interesting?
http://www.psyber.com/~tcj/tcjguide.html if you're interested. :)
*Geoff!*
I think a rather serious problem has surfaced with one of my floppy drives. :( The 360k drive I have will read/write for a while (varies, but around 5-10 tracks) and the drive light the spindle motor stops completely. If I turn off the drive and turn it back on, the drive will work for another 5-10 tracks, and stop, etc.etc.
Anybody have ANY idea what could be causing this?
I'm hoping it's just the drive mechanics or related circuitry (not the ADAM controller itself), because I've got about three more 360k mechanisms I could plug into it. I would try this first, except the drives are at my parent's house, 5 hours away.
* Geoff Oltmans *
From: Guy Cousineau <COUSINEAUG@EM.AGR.CA>
Subject: TDOS/80 columns -Reply
Hi Marcel,
Geee that is a tough question. We never thought that address would be required so there is no direct link to the buffer address. I tried to find a sure path to the buffer but the 162 versions of TDOS all put the buffer in a different place. However, I know the buffer is above the 1K read block buffer and that is just above the allocation vector for the RAM drive. The following technique should work:
--extract address at 01ch past BIOS start (select drive)
--subtract 14 from that address and extract the DPH for the ram
drive
--add 15 to that address to extract get the ALV pointer
--add 64 to that to get end of ALV
--add 1024 to get to the end of the 1K buffer
----phew!!
so in z80 (unless my code is rusty)
ld hl,biosstart ld de,01ch add hl,de ;pointer to select drive ld e,(hl) inc hl ld d,(hl) ;get routine address ld hl,-14 add hl,de ;take 14 away to get DPH ld e,(hl) inc hl ld d,(hl) ;get address of DPH ld hl,15 add hl,de ;pointer to ALV ram drive ld e,(hl) inc hl ld d,(hl) ld hl,1024+64 ;skip ALV length and 1k buffer add hl,de ;hl=start of 24x80 (780h) screen buffer
From what I can see of the code, this should work with any ver- sion of TDOS. I have a shorter version but I am not sure if this will work consistently. This one looks for the address of the READ BLOCK BUFFER in the write block routine:
ld hl,biosstart ld de,06dh ;write block routine add hl,de ld e,(hl) inc hl ld d,(hl) ;extract address of routine****** ld hl,10 ;offset to LD DE,BUFFERADDRESS add hl,de ld e,(hl) ;get address of buffer inc hl ld d,(hl) ld hl,1024 ;add 1K add hl,de ;hl=start of screen buffer
*****at that address you should see the pattern
F5 C5 D5 CD xx xx 30 xx E1 11 xx xx +++++ 01 00 40 ED B0
++++ this is the address you want to get and add 1k to it.
Good luck.......If neither of these techniques work, let me know and I'll go back to the code again.
You've done a great job with the emulator. I've looked at it a couple of times and it does the job. I ran it on a 386x40 and it ran about the same speed as on the ADAM. I'd like to see it running on a pentium II :-)
Guy
Hey Folks...
If you want to write to all on the ADAM internet list, you write to the following address: coladam-list@csclub.uwaterloo.ca
If you want to get a list of the people that are on the list then you write to this address: coladam-admin@calum.csclub.uwaterloo.ca
Oh yea don't forget to put the word "query" in the subject line! no other text is required.
As a collector of old computer/video games, I would LOVE to have an ADAM in its original box, but I'm afraid of the ghastly shipping costs.
I started to write an answer to the guy (Geoff Oltmans) asking what was wrong his disk drive, but I cancelled it because I'm not sure what kind of drive he's talking about. Since I'm writing to the list anyway, I'll answer that guy, too. To whoever you are: are you talking about a drive from some IBM clone hooked up your ADAM with some interface card, or is this some special, Coleco-made, ADAM-only drive? If the former, I can help you find out exactly what's wrong with it. If the latter, I could at least give you some general advice on diagnosing the problem. In either case, you can e-mail me at:
ummaier1@ccu.umanitoba.ca.I don't know how techically knowledgeable you are, either, so let me know that, too, please.
- Kevin
Hello all,
A while ago, Steve Pitman sent me this idea for the ADAMEm
emulator:
>I've been playing with some of the CP/M emulators for the PC,
>but I haven't found any as good as TDOS. TDOS is 80 columns
>(but you have to scroll to see it all), how hard would it be
>to make all 80 colums visible when using Adamem? It seems
>like it wouldn't be hard to do. This would be great to have!
>I could then use my Adam CP/M stuff without scrolling the
>screen all the time. forget the 80 column cards for the Adam
>(that cost $200 or more), we could do this for free on the
>PC, well I shouldn't say "we could", I couldn't, but you're
>the expert.
He's quite right of course. TDOS maintains an off-screen buffer containing all 80 columns and if I could find a way to detect the address of this buffer at runtime I could make the emulator switch to 80x25 text or maybe a super VGA mode and display all 80 columns without having to implement serial port- and terminal emulation. Does anyone know how to detect the address of this buffer ?
Marcel
You just never know who might be listening. Adamites following this broadcast address (coladam-list@calum.csclub.uwaterloo.ca)
now know that Jorge is in Uruguay and knows enough about ADAM's interaction with a UNIX server to be able to send a message to us. (And they said it couldn't be done!) Feel free to introduce yourselves. Jorge seems to be able to read the ADAM list, although a reply sent to the e-mail address he gave me could not be delivered for reason "relaying denied". Not sure what that means. At any rate, I'm sure he'll be happy to hear from us. It's been an interesting night here in the 'snakepit'. There was the message from Jorge, and another from an Amstrad enthusiast in Great Britain who hastened to assure me that Amstrads were still very much in use here. Later versions that the one David Cobley (dcobley@island.net) just donated to my collection, but
Amstrads nevertheless. The sysop on Compuserve in charge of the Amstrad Forum couldn't understand why I would want such a machine. I explained it to him. Now he knows. But that's off- topic here. More to the point is something that I've been want- ing to do for some time. We have a fair number of new ADAM owners (or older ADAM owners who've returned to say hello), and it's possible that some of these newcomers might not be aware of how much the Coleco ADAM computer progressed after it was orphaned by its maker. In short there are products that most of us take for granted which these people might not know about.
At the risk of boring the old hands, I'm going to provide some information for those who might not have it.
The following items of hardware became available for the ADAM. Some of them are still available if you know where to look.
1) Hard disk drive, both MFM and IDE types, 20 and 40 MEG
size. The controller cards for both models are in short supply and are difficult to find. But they are out there. Standard MFM hard drives such as the ST502 are used. For- matting and partitioning software is available for MFM types. The hard drive typically provides up to 10 logical disk drive areas (1 or two Meg each, depending on total hard drive size) for EOS storage, and 5 logical drives for TDOS formatted storage.
2) Memory expanders providing additional RAM. Sizes range
from 64k to 1 meg. (64k, 256k, 512k, 768k, and 1024k). Depending on the software being used, memory expanders can be used either as contiguous RAM for BASIC programs, RAM disk, extra software workspace, or printer spooling.
3) Parallel printer support enabling the use of an Epson
compatible 9 pin or 24 pin dot matrix printer with the ADAM.
4) Serial ports to interface ADAM with various external
devices at speeds of up to 19,200 baud.
5) A MIDI Interface designed to allow connection of standard
MIDI devices such as an electronic piano keyboard or MIDI sequencer. Permits the production and use of MIDI stand- ard files in MF0 or MF1 format. Software utilities and drivers to provide for use of MIDI song files within BASIC programs are also available.
6) An X10 Home Automation control unit, programmable using
ADAM software to allow the automatic switching on and of or dimming of various lights, switches, and appliances on a pre-scheduled basis.
7) A sound digitizer cartridge that enables input of audio
feed from a taped source and production of a digitized sampling for use within BASIC or machine language programs.
8) 80 column display units converting the standard 32 column
ADAM video display to 80 columns. This conversion is poss- ible under CP/M only.
9) Disk drives improving on the 160k storage capacity of the
original Coleco disk drive. Drives capable of storing 360k 720k (3-1/2 inch) and 1.2 Meg (5-1/4 inch) and 1.4 Meg (3-1/2) drives have been produced.
10) External clock and time/date keeping hardware to allow time
keeping functions such as file date stamping on the ADAM.
11) Multi function cards designed to occupy one or more of
ADAM's expansion slots to provide a combination of funct- ions such as parallel printer port, serial ports, and/or hard drive IDE interface.
12) Various cartridges designed to fit in the Colecovision
game slot and to provide file keeping and file mainten- ance functions such as file copying, RAM disk access, and printer interface software.
Looking around my room here, these are the items that I see. By no means do I have everything ever produced for the ADAM, but I believe I'm close. There was available at one time a voice synthesizer for the ADAM, produced I think, by Orphanware or Eve Electronics, (not sure which). There is also a mouse available, but difficult to find. In terms of software, the lineup is equally impressive. Again, I'm not going to produce an all-inclusive list here. If anyone would like to add to it under both hardware and software head- ings, please feel free to do so.
Software:
1) A choice of wordprocessing programs and utilities to
either enhance or to improve upon the capabilities offered by SmartWriter. Most notable of these operating under EOS is Speedywrite which is in my view a much better wordprocessor than Smartwriter for the 40 column environment. It offers features that SmartWriter does not including centering of text, the ability to move quickly around a long file, and the ability to generate macro's and specialized character sets. A small pocket Data base program is also included.
2) Some impressive graphics and drawing software. Most note-
able among these is PowerPaint, which provides a graphics environment that enables production, display and/or printing of impressive graphics screens for the ADAM. Clip art programs are available along with utilities that enable the inclusion of graphics files in BASIC and machine language programs.
3) Updated communications software that takes advantages of
the newer hardware available for the ADAM such as faster external modems and 80 column displays.
4) Improved data base and spreadsheet programs that allow
maximum use of the 64K environment for data keeping and numerical calculation needs.
5) Several improved versions of SmartBASIC, the most notable
of which is SmartBASIC 1.x, a BASIC interpreter that allows access to all modes of ADAM operation and use of new post-market devices developed for the ADAM.
6) Fonts, Clip Art, and RLE files for use within ADAM's
graphics programs. These items can be loaded into Power- paint and used as required.
7) Z80 assemblers and disassemblers that operate both under
CP/M (TDOS) or under EOS. These utilities enable the production of Z80 code for ADAM and the development, testing, and debugging of complex software programs.
8) Several file management utilities designed to facilitate
maintenance and organization of user data on disk, data pack or hard drive. Files can be renamed, copied, moved, or deleted. Media can be formatted, crunched or initial- ized, individual blocks of code on a storage media can be read, written two, copied or moved.
9) Commented disassembly listings of major items of ADAM
software are available to provide the user with much needed information about the operation of ADAM EOS environment. Various instructional texts produced by hobbyists who know ADAM well are available.
10) Graphics printing software is available that enables the
user to manipulate graphics images and combine them with other images thereby producing sophisticated and attract- ive pages, whether they be for newsletters, instructional material, program documentation, or whatever purpose.
11) There is a complete suite of sound recording and playback
software designed for use with the MIDI interface. The software is capable of using either ADAM's own 3 voice sound chip, or a MIDI device if one is present.
12) Games have been written and distributed by talented ADAM
hobbyists. They continue to be available in sufficient quantity and quality so as to keep ADAMites entertained.
13) Through CP/M and TDOS, a very large number of software
programs available on other CP/M machines are also available to ADAM. Much work has been done to install these programs specifically for ADAM and to ensure that appropriate overlays have been developed. These programs, range in type from Data base (DBASE II) to Spreadsheets (SuperCalc), to Word Processing (Wordstar 4), to languages (Forth, Microsoft BASIC, TurboPascal, C, Fortran, Cobol), to many popular utilities required for file housekeeping under CP/M.
This then, is a generalized list of products that are available for the ADAM. I've no doubt omitted something. Feel free to fill in the blanks.
Ron's Week'n'ADAM March 10, 1998
ADAM V Chapter 2
Almost sounds like a Bible reference.
Sometimes when old ADAMs materialize here in the 'snakepit', it's not so much the computer itself that is interesting. It's the goodies packed up and accompanying the orphan to my doorstep that are sometimes quite illuminating.
A half dozen data packs were included in my lastest deal with St. Vincent de Paul which netted the dear Saint, and the local second hand store that bears his name $35. Canadian, and me my fifth ADAM. You already know about that.
I went exploring. There are seven Coleco ADAM data drives in this house. Oddly enough, all of them work very well despite being left to gather dust for a very long time. It seems that Murphy puts the working data drives in places where they will not be used, and leaves non-working units in the hands of people who have nothing else for storage. At least that has been my experience in dealing with ADAMites for more than 10 years. Far be it for me to argue with Murphy. Suffice it to say that if I had had the same types of horror stories happen to me in using data drives that other ADAMites have described over the years, my period of ADAM advocacy would have ended long before this. As it is, I still regard the Coleco data drive as a viable and efficient form of storage, particularly when compared to the Commodore 64 or VIC 20 tape system and others of its era (TI 99/4A, etc etc.).
But then, that's just my experience. And I am a patient man.
Be that as it may, these 6 data packs revealed some interesting clues about the identity of this particular ADAM's ownership and the uses to which it was put. It would seem that for a time at least, the computer was gainfully employed and earned its keep.
DDP #1. Labelled "Insurance Customers from Letter A - Z" (I wonder what other letters might by stashed away somewhere. )
Application: Data base.
The tape contains a list, alphabetically organized, of names and addresses. It seems rather obvious that a good percentage of the clientele was oriental. Some customers were individuals, some businesses. This is the kind of information that detective stories are made of. Fascinating stuff if you let your imagina- tion run wild. I will nonetheless confine myself to the task at hand.
There are 35 files in all, 33 on the main directory and 2 on the backup. Each file contains part of the total list, sorted on the last name.
The idea of keeping a data base with Smartwriter would never have occurred to me. Back in those days, I wanted a proper database program for such work, and anyone in the ADAM User Friendly Group who wanted my advice about setting up such a record would have been told about DBASE II, EZ-Filer (Sol Swift) and SmartFiler in that order. But you know something? The way this particular data pack is set up, I can't fault it in any way based on what this user has done. As long as the data base doesn't get too big, or doesn't require changes too often, it's probably a reasonable way of storing the information. It couldn't be sorted, but as long as each file was kept to a reasonable size, that could probably be done by hand.
DDP #2. Labelled "Programs" (Aha... now the neat stuff)
Application: Programming and Word Processing Files
I booted SmartBASIC in preparation from Data pack for the first time in about 85 years.. The ADAM I'm using has a disk drive, but that would be cheating.
Somebody's personal resume, and a dozen or so SmartBASIC programs. It looks like this user had more than a passing interest in SmartBASIC. There's an adventure game that is 8k long on here, and if I ever get it figured out, I'll pass it along to Bob Slopsema for the ANN disks. There is also another interesting program called "DICE" which I've seen in various forms before. This one is not that remarkable except for the method used for generating random numbers. Obviously this user did not have access to the several articles written for ADAM newsletters by Guy Cousineau et al about how to 'fake' a random seed, thereby generating a better series of random numbers. This program asks the user to enter the seed at the beginning of the program. There are limitations to that way of doing business. At any rate, it's worth passing on for demonstration purposes, and I will do so.
There is another program called "SAVING" which looks like a work in progress. What is interesting is the REM statement at the beginning which reads,
110 REM SAVING 130 REM By JOEL S. MOSKOWITZ 140 REM AND THE HCM STAFF 150 REM HOME COMPUTER MAGAZINE 160 REM VERSION 4.1.1 170 REM APPLE II SERIES APPLESOFT
Unfortunately, the program when run gives an "undefined statement error in line 190". At line 190 there's a GOSUB 1110. The program listing ends at line 340, so we are obviously missing something.
Let's guess. The program probably calculated the interest payable on a given capital amount at a given rate of interest over a stated period of time. It no doubt concluded by telling the user how much richer he or she would be at the end of the time period given. That was fairly typical stuff back in the beginning when the earth was flat and there were dragons at either end. Now we have high powered bank software that is written for us and provides charts of such information on demand. Too bad really.
I still believe that typing in and studying other people's programs is as good a way as any of learning BASIC or any other computer language. Magazines don't provide program listings to type in any more. Pity.
DDP #3. No label, no case. Looks like more programs and Smart- Writer stuff.
It almost looks like this ADAM had two different owners. The list of insurance clients described earlier was almost all oriental, and all address were in Vancouver British Columbia. On this data pack (number 3) there is a letter dated March 13, 1992, from a local Comox address covering submission of a resume. The name of the signer is shown, but I'll leave that out. Suffice it to say that there is a fair amount of employment history given.
Snooping around is interesting, but I'm not about to do anything with this information except perhaps to write my Pulitzer Prize willing novel based on it.
On this data pack, there is a SmartWriter file called "QST". HAMs in the group will recognize QST as an international radio "Q" signal, whose meaning I've long since forgotten (something to do with making a radio call, I think). It is also the name of a rather well known Radio Communications magazine. I believe it's still around. The SmartWriter file so named contains a list of articles published in QST between 1968 and 1971 about radio antennae plus related topics. It would serve as a good outline for a book on the subject. Articles are given by page number and month. Again, another data keeping application.
In summary, I find it rather interesting to snoop about and to discover what other people did with their ADAM's. I find myself wondering whether or not these people were satisfied with the information they were able to keep, and able to live with the limitations imposed by keeping it in this way. I suppose I'll never know.
The other 3 data backs by the way were:
(1) Buck Rogers
(2) SmartFiler
(3) A Data Tape for SmartFiler.
I was never much good at Buck Rogers, and as far as SmartFiler is concerned, I said I was a patient man. But I'm not that patient.
Ron's Week'n'ADAM
March 16, 1998
Sitting here listening to a Seattle radio station, providedvia cable for those of us north of the border who have no sense of patriotism. KJR earlier this evening boasted, "(we're) from the city that gave the world the 747 and Windows.."
I think they're forgetting something. That same city alsogave the world Bart (Zonker) Lynch
Haven't heard from him lately, but that's probably myfault. I haven't spent much time in the Assylum since Christmas. That's my loss mostly, but if I keep this up, Zonkman is going to give up in disgust. Bart operates a full service, text based, BBS known as the Assylum. He does this on a Coleco ADAM, hard drive equipped. The BBS offers an extensive message base, file areas, news bulletins, message threading, software downloads (specific- ally for ADAM) and a way of contacting one of the most dedicated ADAMites on the planet.
(206) 859-2018
That'll get him. The BBS operates 24 hours a day, 7 days aweek. So if you want to catch up on the REAL ADAM chatter, the Assylum is the place to go. Try it, you'll like it!
The BBS Software that Bart uses is called PBBS 5.0. It hasbeen around the CP/M world for years, and furnishes a prime example of the quality of software available to those who will take the time and trouble to learn CP/M (or TDOS, ADAM's CP/M workalike). Many of the titles available on today's modern computers began as CP/M software first. There was Microsoft BASIC, Wordstar, Supercalc, DBASE II, and long list of utilities that evolved along with changing hardware. These programs are still available for the ADAM. For most household applications they are still more than adqequate.
Detractors of CP/M and TDOS over the years have argued thatmost of this available software doesn't work properly and is not user friendly. The difficulties inherent in learning an operating system along with its cryptic syntax and unforgiving nature have detered many from making use of the full capabilities of ADAM. That coupled with the fact that neither TDOS nor CP/M offer much in the way of graphics capability have been sufficient to keep the majority of ADAM users away. These difficulties are real and cannot be ignored. CP/M was an operating system that almost required specialized training which most home users didn't have. It was considered to be more of a programmer's tool than a users' environment, and as the debate raged in the mid-eighties, many ADAMites began to 'freeze' at the very mention of CP/M or TDOS.
I'm not telling you anything new of course. My purpose hereis to restate, (once again) that for a computing device now considered to be dead, there is still a very large quantity of unused potential available in the ADAM, potential that most users will never take advantage of.
There's never enough time for this stuff of course. Life isalways in the way. I've had the MANX C Compiler and Turbo Pascal 3.3 loaded onto my ADAM hard drive for years, along with Forth and even Cobol. I don't suppose there's any point in learning any of these any more except for the pleasure and satisfaction to be derrived from trying something new. I've heard it said that a BASIC programmer who learns Pascal will never go back to BASIC. I've also heard it said that there's really no point in learning anything other than C any more, and you may as well skip over the earlier versions and go on with Visual C++. I've also read that Forth is the most fun for programmers who don't care much for following rules.
I don't know if I really understand the subtleties of allthis. My task as a programmer, no matter what language I'm writing in is to cause the computer to do useful work, get some data, process it in accordance with whatever method it's given and present the results. I need to know enough about what I am doing to present some kind of instruction to the user, get the user to input data, or perhaps read data from a media, and then do something with it.
Even if the objective is to entertain, the way of doingbusiness (input, process, output) doesn't change much.
I'm rambling. The point is this. The things I want to aboutcomputing can be learned as well on an ADAM as they can on a pentium, which for me is why ADAM is not yet dead.
---------------------------------------------------------------
I recently bought an ADAM expansion module # 3 and a Coleco Vision, a 5 1/4 and a 3 1/2 inch disc drive. This all cost me about $35 Canadian from a local flee market.
I have yet to put them all together and see how they all work. Right now everything is in a box at my fiancee's mothers house. However I did try the system with no disc drives and I have to tell you I was just like a little kid waiting for Christmas. I couldn't wait to see what came up on the TV. My fiancee thought I was nuts, but oh well.
I do remember the ADAM when it first came out, I wanted one so badly but my parents never bought it for me, so I had to live with just my Coleco Vision system. The want for the system eventually died out, until about 6-8 years ago when I went to a computer convention and there was a table set up from the people of the Adam Users group from Toronto. That sparked the flame again, and since them I have been on a conquest to find an ADAM system.
What I would like to know is there any C Compilers out there for the ADAM, I seem to remember that when I was talking with the people for the Toronto Adam group they mentions that they had a C Compiler by Abacas(sp??). Is this true?
Dave Kaczanowski Programmer/Analyst Hudson's Bay Company
Also, is there still a Toronto Adam users group. If so, could someone email me some information about it? Thanks in advance.
APRIL 1998 ADAM NEWS NETWORK DISK
****************************************************************
Geoff Geoff Oltmans has disk drive problems
Geoff#2 Geoff send an "old" Popular Science write up on the
ADAM computer
Geoff#3 Geoff send some info about a generic IDE comtroller
Rich Rich Drushel replies about the IDE controller
Dale Dale Wick comments to Rich Drushel
Hurst Mike Hurst has some instructions for adding your
name onto the col-adam.list so that all the email floating around the ADAM community will come to your own mailbox for your reading pleasure
Marcel Marcel DeKogel replies to Steve Pitman's idea to
use ADAMEM as an 80 column ADAM
Guy Guy Cousineau jumps into the Q & A with Marcel
Mitch#1 Ron Mitchell's RonsWeeknADAM of Mar 1, 1998
Mitch#2 Ron MItchell's RonsWeeknADAM of Mar 10, 1998
Mitch#3 Ron Mitchell's RonsWeeknADAM of Mar 16, 1998
Ron#1 Ron strikes up a conversation with a fellow from
Uraguay, South America with an ADAM
Pease A note/offer from an ADAM programmer thought lost!
Outline Outline for the following SmartBasic tutorials
Chapter1-7 SmartBasic tutorials from past disks. Maybe NOW is
the time to start learning SmartBasic! Chapters 1 thru 7 are on this months disk; 8-10 next month.
Readme This file. Although we have no further information
on ADAMCON 10, rest assured that work is going on behind the scenes. It IS scheduled for October in Florida AND you should start saving your pennies for the transportation and convention costs!
From: Richard Drushel <drushel@apk.net>
Subject: Re: Interesting info about IDE...
[Geoff Oltmans] spake unto the ether:
> Well, in my searching through the internet I located a page
containing information for GIDE...the Generic IDE interface
for 8-bit computers....the following statement caught my eye.
>The GIDE board plugs into a Z80 CPU socket, and the Z80 CPU
plugs into the GIDE board. The first round of boards in the US
has gone to developers, since software needs to be written for
different systems. As of January 1996, several developers in
the USA have boards and are writing software for the clock and
for the IDE drive. As their software is received, it is includ-
ed with the development kit, and distributed via the Internet
to all previous developers. An IDE BIOS for the TRS-80 has
been recieved, and developers are writing code for a number of
CP/M systems, the ADAM, and a CD-ROM.
I'm the one responsible for the ADAM mention...I bought a GIDE about 2 years ago ($72), and have never had time to assemble it...I'm pretty sure that Mark Gordon's (Tony Morehen's?) low- level IDE interface could be made to work with the GIDE. Sigh. The GIDE is an elegant little board; as I recall, it was slightly in the way of the VDP (so you'd have to pop off the cemented-on VDP heatsink to get clearance).
And I still owe Geoff Xerox copies...@$#&! I'm so busy!!!
*Rich*
Hi Jorge!
Very special to hear from you.
I am replying via the ADAM broadcast address. When I tried to send a reply to your message to: uy38700@pai.antel.com.uy
I got a notice from the Internet saying "relaying denied". Hope you get this one ok.
QTERM is a telecommunications program that will run on the ADAM. It runs under CP/M.
I don't know if you know it, but ADAM will run CP/M. You load it from disk. There is also an operating system called TDOS which is compatible with CP/M but written for the ADAM. QTERM is the only communications program for ADAM that will do VT100 terminal emulation for ADAM on the Internet. It's not perfect, but it's better than nothing. ADAM'S regular (default) terminal is HEATH or HEATH/Zenith. Unfortunately, that does not work too well with Lynx.
So.... I guess I need to know a little more about your knowledge of computers before we go too much further. Do you know about CP/M? Do you know how to use it? Do you have CP/M for the ADAM?
Let me know. If you don't have these programs, I can make sure you get them.
I think you should introduce yourself on the ADAM List. ADAM owners will be very happy to know that there is someone in another country using the ADAM. They'll be more than helpful with anything you want to know about the ADAM. If you want to reply to me, you can use either the ADAM list or my own Internet address: ronaldm@mars.ark.com
Going on the Internet with ADAM is not easy, but it can be done, even with a 300 baud modem. There are still some ADAM owners using that speed. ADAM will also operate at 1200 or 2400 baud using a serial interface and an external modem. It sounds like you have a good system there. A disk drive is very good to have.
Let me know what you have for software. We see that you get what you need.
Keep in touch.
Ron Mitchell
From Jorge:
Ron. I`m mailing you from Uruguay (South America) with my Adam unit+2; DDP+1; DD+1; Printer; and Modem 300 BPS.
(I`m tired to say this, but here it goes: sorry me about my bad english). In the Adam Mail List I see your QTERM article (I don't know what QTERM is) I have a lot of problems when go to Internet (to a UNIX) and it ask me "Terminal Type?" Responding VT100, Another questions for another mail.
Do you prefer I mail you to the Adam List?
<uy38700@pai.antel.com.uy> Jorge
*****************************************************************
Editor's note:
Here is a truly dedicated ADAM user with enough enthusiasm to try the Internet, and he is from WAY down south. These are the type of contacts we can get when we extend a hand to the world in general and the ADAM world specifically. If you want a truly international pen pal, I think Jorge just just make the grade.
Return to adamcon.org | Adam News Index | Volume 98