COMPUTER INTRO A BEGINNER'S GUIDE TO COMPUTER TECHNOLOGY By Magnavox Odyssey(2) by Magnavox [GATEFOLD REFERENCE] This gatefold will provide you with an electronic reference. Keep it open as you work with your Odyssey(2) computer. KEY CODES Key Hex Decimal Key Hex Decimal Code Code Equiv Code Code Equiv 0 00 0 O 17 23 1 01 1 P 0F 15 2 02 2 Q 18 24 3 03 3 R 13 19 4 04 4 S 19 25 5 05 5 T 14 20 6 06 6 U 15 21 7 07 7 V 24 36 8 08 8 W 11 17 9 09 9 X 22 34 A 20 32 Y 2C 44 B 25 37 Z 21 33 C 23 35 Blank 0C 12 D 1A 26 : 0A 10 E 12 18 $ 0B 11 F 1B 27 Clear 2E 46 G 1C 28 ? 0D 13 H 1D 29 * 27 39 I 16 22 + 10 16 J 1E 30 - 28 40 K 1F 31 x 29 41 L 0E 14 / 2A 42 M 26 38 = 2B 43 N 2D 45 Enter 2F 47 INTERNAL FLOW [Diagram: Control Unit connected to Accumulator, Program Counter, Subroutine Return Address Register, Registers (0-9 and A-F), and ALU (Arithmetic Logic Unit). Also connected to Memory (ROM) Instructions and Constants, Keyboard, Symbol/Sound Generator, and TV Screen.] KEYBOARD [Diagram showing the Odyssey(2) keyboard layout: NUMERIC: 0 1 2 3 4 5 6 7 8 9 FUNCTION: + - x / = YES NO CLEAR ENTER RESET ALPHA: Q W E R T Y U I O P A S D F G H J K L Z X C V B N M . ? SPACE] Computer Intro is not for everyone--but if you're up for a rewarding mental challenge, here is a fascinating entry point into a complex and highly technical subject. The cartridge turns your Odyssey(2) into a very special kind of computer. It won't balance your checkbook or do your income tax or plot the course of a spaceship to Mars. But it will give you some idea of how those computers do their work. You will begin to understand how a computer "thinks" and even begin to think like a computer "thinks." The initial orientation and explanation are deliberately couched in the most simplistic of terms. They don't assume anything more on your part than a working knowledge of basic arithmetic. After a brief explanation of how computers work and what they are made of--you will start getting "hands on" experience and will learn by doing. You will learn how to enter a program--the first step in learning how to actually write your own. The gatefolds in the front and back of the manual provide you with electronic road maps. Keep these references in front of you and you will clearly understand what's going on and how computers really compute. IN THE BEGINNING In the beginning, there were ten fingers--then a prehistoric Einstein discovered his toes and man could count up to twenty. The oldest computing device we know of is the abacus. It was first used in China in the sixth century B.C. The very first digital computer was designed by Charles Babbage in the 1830's. It was more than a calculator. Babbage designed it to be programmable, and it would have been able to perform any arithmetic or logic calculation. It was designed to use punched cards for entering data and instructing the machine with mathematical commands. There were two problems. Problem one. Babbage's elaborate drawings called for a building the size of a Dickensian shoe factory to house his "analytical engine." Problem two. Babbage died before the machine could be built. The first practical programmable computer was built in a basement at Harvard University during World War II by IBM. It weighed 35 tons! This machine used an exotic combination of electronic, electrical and mechanical gear to do its arithmetic. The instruction program was stored on a punched paper tape that unreeled automatically. Numbers were entered into the machine on a panel covered with 1,440 dials! The first all-electronic computer was built at the University of Pennsylvania shortly after the war ended. ENIAC (Electronic Numerical Integrator and Computer) was 1,000 times faster than its predecessor. But it filled a room 30 feet wide and 50 feet long. Its 18,000 vacuum tubes were connected by about a half-million soldering points. Today, everything that ENIAC could do and far more is performed by a device slightly smaller in size. It is less than one quarter of an inch square--and can make more than one million electronic decisions every second. It is called a semiconductor. It is possible for one semiconductor in one of its newest forms--the microprocessor--to account for more than 310 trillion separate functions. And this is only the beginning! If computer technology continues to develop at its present rate, one of these chips will be able to store about a quarter-million bits (the smallest unit of computer information) in its memory within a few years. Ten years from this point, there will be chips capable of remembering a million bits of information. By 1990, the number of logic or decision-making computer circuits on these one quarter inch chips are expected to number a quarter of a million. Today's large computers, selling in the one million dollar range and as big as several filing cabinets, contain only about 10,000 logic circuits and a main memory capacity of a few million bits. As microprocessor technology progresses, computers may be developed that understand human speech. It is even possible they can be taught to read handwriting! The microprocessor in your Odyssey(2) is infinitely more sophisticated than the mathematical marvels that were the state of the art in the forties and fifties. The technology of the microprocessor is unquestionably going to revolutionize the way the world works--and the way you'll live. A computer will control your car's automatic transmission and fuel injection system. A computer will monitor fire and burglar alarm systems in your home. The lights in your home will be computerized. So will the locks on the doors and windows. A computer will even water the lawn. A computer will do your shopping from the house--and pay your bills without you writing checks. Computers will simulate three dimensional space for architects to help them mentally walk around their houses before they're built. Computers will alert doctors to patient problems that would be imperceptible under today's circumstances. Computers will help composers hear their music as they're writing it--even if it's too complicated for them to play. Businessmen can have electronic simulations of their companies in their attache cases. We are really still just at the very beginning of the computer age. You have picked a very good time to get involved! THE WORLD OF THE COMPUTER IS STRANGE AND WONDROUS Computers have already carried man to the moon--to Mars--and far beyond. They lie at the heart of fearsome weapons systems. They fly planes--monitor automobile engines--run factories--and even translate languages. All of these with the brain power of a good screwdriver. Congratulations! You have just completed your first lesson. You are much smarter than any computer at the present state of the art! For all of its awesome capabilities, the computer is nothing more than a rather simple-minded tool. But once you learn how to use it, you'll have more power at your command than Julius Caesar ever dreamed of. A computer has few basic talents. It can add--and it can move numbers around. A computer never forgets--and computers don't make mistakes. (If a computer churns out misinformation, there's a mistake in the program. Computers are utterly faithful in following instructions.) Big deal. Computers can't multiply, divide, or even subtract the way you do. But what a computer does do, it accomplishes with absolutely astonishing speed. Your Odyssey(2) can make over 100,000 electronic decisions every second--and there are computers around that are more than ten times faster than that! To multiply, Odyssey(2) simply adds numbers together at an incredible speed. To subtract, it moves numbers around in a special way so that adding them together will give the correct answer. This sounds like doing it the long way--but when you're that fast at addition, the juggling act becomes worthwhile. It's not all that hard to talk with a computer. It only understands two words. Yes--and no. Yes--means that an electrical pulse is tickling the computer's sensitivities. No--means that no electrical pulse is going through. The symbol for "yes" in computer language is 1. The symbol for "no" is 0. Once you have memorized 0 and 1, you have memorized the entire alphabet of the only language computers speak in any country of the world. This is called a binary system because there are only two symbols involved. It's sort of a code. Here's the key. BINARY NUMBERS AND THEIR DECIMAL EQUIVALENTS 1 = 0001 5 = 0101 9 = 1001 13 = 1101 2 = 0010 6 = 0110 10 = 1010 14 = 1110 3 = 0011 7 = 0111 11 = 1011 15 = 1111 4 = 0100 8 = 1000 12 = 1100 16 = 0001 0000 LETTERS OF THE ALPHABET AND THEIR BINARY CODE EQUIVALENTS Keyboard Binary Decimal Hexadecimal Letter A 0010 0000 32 20 B 0010 0101 37 25 C 0010 0011 35 23 D 0001 1010 26 1A E 0001 0010 18 12 F 0001 1011 27 1B G 0001 1100 28 1C H 0001 1101 29 1D I 0001 0110 22 16 J 0001 1110 30 1E K 0001 1111 31 1F L 0000 1110 14 0E M 0010 0110 38 26 N 0010 1101 45 2D O 0001 0111 23 17 P 0000 1111 15 0F Q 0001 1000 24 18 R 0001 0011 19 13 S 0001 1001 25 19 T 0001 0100 20 14 U 0001 0101 21 15 V 0010 0100 36 24 W 0001 0001 17 11 X 0010 0010 34 22 Y 0010 1100 44 2C Z 0010 0001 33 21 Working with endless daisy chains of 0's and 1's would be more than tedious for the human brain--but the computer is really good at it. The inside of a computer is mainly a series of little electronic gates. 0--the absence of an electrical pulse--leaves the gate open. 1--the presence of an electrical pulse--closes the gate. And remember--the electronic gates in your Odyssey(2) computer are opening and closing at the rate of 100,000 times every second. You will enter programs in your Odyssey(2) through either the hexadecimal or assembler language (these will be explained later). The Odyssey(2) will then change the data and instruction sets entered into binary language (1's and 0's) and store that information in the Memory and in the registers. The actual computing is done by the computer's Central Processing Unit (CPU). The CPU in your Odyssey(2) is composed of the Accumulator (a working register which stores data temporarily); the Program Counter (a working register which locates and identifies the instruction sets and keeps them in order); the Registers (in which data, implemented by the programmer, is stored); the Sub-Routine Return Register (which is used with a certain instruction set); the Arithmetic Logic Unit (ALU); and the Control Unit. The Control Unit directs the flood of electronic traffic traveling through the computer and controls the data flow between the different components of the computer. For example, it regulates the flow of information between the Memory and Arithmetic Logic sections and also orders processed data to move from the Memory to the Output terminal. The Output terminal of your Odyssey(2) computer is the screen of your television set. The Arithmetic Logic Unit is where the computer teaches numbers to tap dance. Its nickname is "number cruncher." It acts on the binary data fed into the computer's memory and registers--and then changes them according to the programmed instructions. Now, you're ready to learn by doing. You're going to enter a program into your computer. Open the fold-out at the front of the book and you'll see what happens to everything along the way. Important point. The neat thing about computers is that they will always follow your instructions with unflagging good faith. The dumb thing about computers is that they will only do what you have instructed them to do. It's very important to make sure that you enter every step and do it right. If you make an error, the computer is going to make an error. Be sure that the power to your Odyssey(2) console is turned off. Insert the COMPUTER INTRO cartridge into the console. Be sure the label side is facing the alpha-numeric keyboard. Now, turn on the power. You're going to be talking with your Odyssey(2) computer through the keyboard. It will talk back to you over your television screen. Let's take a brief trip around the keyboard. It has forty-eight keys. Each key has been encoded in the computer languages we're going to be using. You'll find this code on the gatefold at the front of the book. The keyboard also contains some surprises--four games that have been pre-programmed in the cartridge. Press 2 on the alpha-numeric keyboard. A FLASH CARD addition game will appear on your television set. An unsolved addition problem flashes on your screen. You enter the solution through the keyboard. If the answer is less than 10, preface the number with a 0. (Important! Always use the numeral 0 at the top of the keyboard when entering a 0.) If you give a wrong answer, an angry NO will appear on the screen. If you give a correct answer, it will appear in its proper position. To bring another problem to the screen, summon it from the computer by pressing any key. Adding numbers is no big deal until you see how many addition problems you can solve in one minute. If you keep trying to beat your own record or another player, you can't help but sharpen your skills. Press RESET, then press 3 on the alpha-numeric keyboard and you're into COMPUTER TELEPATHY! It's a high-low game. The computer secretly chooses a number between 00 and 99. The secret number won't appear on the screen--but a question mark will. You make a guess at the correct number and enter it into the computer. Your guess will appear on the screen. It will be followed by an H if it is higher than the computer's secret number--or an L if it is lower. If you guess correctly, the number will be followed by an X. Play against an opponent and see who can guess the computer's secret number in the fewest number of guesses. Now, press RESET, then press 4 on the alpha-numeric keyboard. BETWEEN THE SHEETS appears on the screen. You'll see three sets of numbers. Example: 03 07 00. The first two numbers are the sheets. The computer has thought of another number which it is keeping to itself. The last number is your score. If you think the computer's secret number is between 03 and 07, press YES on the alpha-numeric keyboard. If you don't think it falls between 3 and 7, press NO. If you are correct, you score a point and the number will appear between the 3 and 7. If you are wrong, the computer rewards you with a couple of BEEPS right in the ear and your score remains the same. Press RESET, then press 1 and a series of blocks appears on the screen. The blocks flash in random order and are accompanied by a buzzing sound. We call this spooky effect "THE CREEPY CRAWLER." You can call it anything you want. We can re-program The Creepy Crawler to display other symbols on the screen. There is a large selection of graphics in the memory of your Odyssey(2). You'll find the complete collection in the fold-out at the back of the book. The Creepy Crawler program is quite short and represents a good starting point. We're going to follow this and succeeding programs with a sort of road map so you can see where your input goes and what the various parts of the computer do with it. There are two ways you can program your computer. You can speak HEXADECIMAL code (machine language). An instruction would look like this: 60. Your computer takes 60 and converts it into its binary equivalent: 0110 0000. Notice that this binary translation has eight digits. These are called BITS. Bits are handled by the computer in groups of eight. One group is called a BYTE. A byte is the smallest piece of information a computer can work with. In Odyssey(2) Hexadecimal language, 60 means "Load a value into Register 0." (A register is a place where a computer stores information. There are sixteen registers in your Odyssey(2). Each register has room for one byte of information.) The second computer language your Odyssey(2) understands is called ASSEMBLER. Assembler uses alpha-numeric symbols to input binary code instructions. An instruction in Assembler is more phonetic than Hex--but it is also longer. Example: LDV.0.38 means--Load a value into Register 0--and that value is 38. (Important: Be sure to enter the periods in the assembler instructions or the computer will not know what you're talking about.) In the back of the book, you'll find a complete chart of Instruction Sets for your Odyssey(2). INSTRUCTION SETS are the codes that tell your computer what you want it to do with the data you're going to give it. Also Important: "0" is the equivalent of zero in the numeric section of your keyboard. "O" is the letter of the alphabet. Now, open the gatefold at the back of the book. You'll find a flow chart that tells you how to get into the various operating modes of your Odyssey(2). These modes are for displaying data in the registers, entering and executing a program, rolling through a program to check data and much more. Leave the front and back gatefolds open. You'll have your reference material right in front of you. We are now ready to re-program the fearsome Creepy Crawler. First, we'll enter in Hex--and then we'll do a variation in Assembler. CREEPY CRAWLER Press the POWER BUTTON OFF and ON to clear the computer. Press RESET "Command" appears on your screen. Your computer is in the COMMAND mode and ready to accept instructions. It knows you want it to do something but doesn't yet know what. Press P "Program" appears on the screen. "Aha," thinks the computer. "Somebody wants to enter a program! I wonder what language this person will speak!" Press M "Hex Input" appears on the screen. The computer now knows you will be communicating in HEX. You're going to be using the Hexadecimal Operational Code (OP CODE). Press I Step 00 appears on the screen and the computer is ready and waiting to accept data. Step 00 Press 60 This is Op Code for Load Register 0. Register 0 is one of sixteen registers in your Odyssey(2) that make up part of its Random Access Memory (RAM). Each register is a small memory device that provides temporary storage for data and instructions which will eventually be needed by the ARITHMETIC LOGIC UNIT (ALU)--the place where all simple reasoning and arithmetic operations are performed. Look at the registers in the computer as sixteen in and out boxes on a desk that is shared by both you and the Arithmetic Logic Unit. Press ENTER Program Step 01 appears on the screen. Register 0 has now been activated to accept your entry upon execution of the program. (The program steps you enter into the computer do not actually become functional until you press E [EXECUTE] at the completion of the program.) Step 01 Press 3A You have just selected an electronic figure from your computer's gallery of electronic art and symbols, which are stored in the symbol/sound generator. You'll find the entire gallery in the fold-out at the back of the book. We've selected the little man as an example, but you can actually use any of the figures or symbols for this program. They have been permanently stored in your computer. There are two parts to the memory unit in your computer. The ROM (Read Only Memory) contains the instruction sets and constants to be used in programming. (The constants may be repetitive numbers needed for mathematical computation by the ALU--Arithmetic Logic Unit, or they may be letters, numbers, or symbols which you have entered into the Odyssey(2) in a program which will remain the same throughout the program. See the program "Message.") The other part of the computer's memory is called RAM (RANDOM ACCESS MEMORY). This memory component is like a blackboard. Programs, instruction sets and constants can be entered and later erased so that new data can be entered. You're writing this program on the RAM component of the microprocessor in your Odyssey(2). Press ENTER Program step 02 appears on the screen. The little man will be loaded into Register 0. Step 02 Press 61 This is Op Code for LOAD REGISTER 1. It tells your computer you want to give input to that data storage unit. Press ENTER Program step 03 appears on the screen--and the door to Register 1 will open to receive data. Step 03 Press 0C This is Op Code for a blank like the space between words in a sentence. Press ENTER Program step 04 appears on your screen. The blank will be loaded into Register 1. Step 04 Press 6B This is Op Code for positioning. You are opening the door to Register B and telling it you want it to display the little man at a certain place on the screen upon execution of the program. You'll let it know where. Press ENTER Program step 05 appears. The door to Register B will open. Step 05 Press 00 This entry tells the computer you will want it to display the little man at the furthest left position on the screen. Press ENTER Program step 06 appears on your screen. The positioning information will be loaded into Register B. Register B is the register that positions symbols or characters on the screen. It has been given eleven positions. 00 is the furthest left. 0A is the furthest right. When Register B outputs on the screen, it automatically increments or advances by one. If we output a symbol in 00 (position one), the symbol will appear in the first position and Register B will then advance automatically to position 1 (01). If Register B outputs in the last position (0A), it automatically resets itself back to the first position (00) on the next step. Whatever data was in that first position will be replaced by the new input. Step 06 Press C8 This is the Op Code that tells the computer you are going to want to bring that little man to the screen. You have given him a way to get out of Register B. Press ENTER Program Step 07 appears on the screen. Step 07 Press C1 This is Op Code for telling the computer you want to bring that blank in Register 1 to the screen. Press ENTER Program step 08 appears on your screen to tell you everything is going along smoothly. Step 08 Press 05 It's sound effects time. This is an Op Code that tells the computer you will want to hear a one second buzz. Press ENTER Program step 09 appears. Step 09 Press 08 This Op Code tells the computer you want it to come up with an unlimited sequence of random numbers. The computers that encipher and decipher secret messages for governments do this everyday. In the old days, crypt keys remained constant and could be broken easily. Today, they change constantly and at random. Today, it takes one computer to break another's cipher. Press ENTER The random number instructions are entered into your computer. Program step 10 appears on the screen. Step 10 Press BB This is Op Code for UNPACK Register B. This is the Register we use to position our little man on the screen. This unpacking instruction takes the random two digit number selected by the Accumulator and places one digit in Register B (we are unpacking Register B, thus the Op Code BB) and the other digit in the Register immediately following B, which is Register C. The digit in Register C is ignored. Another example of unpacking--If we had unpacked Register 0, the Op Code would have been B0, and one digit of the random number would have been placed in Register 0 and the second digit in Register 1. To look at it another way, think of the Accumulator as a suitcase and the registers as a tall dresser with 16 drawers. You unpack two items from your suitcase and put the first away in a drawer. The second item will automatically go to the drawer just below it. At the end of the Creepy Crawler program, a variation is written explaining how to use the second digit of the random number which was loaded into Register C, along with numerous figures to execute a random display of figures on the screen. Through this unpacking instruction, the positioning Register (Register B) is loaded from the Accumulator with a random number. It is this instruction which will cause our little man to travel to unpredictable places on the screen. (The Accumulator is a small memory device in the CPU that provides temporary storage for the Arithmetic Logic Unit. It can store the result of an ALU operation or serve as an operation source [OPERAND] for the ALU.) Press ENTER The unpacking instruction is entered and program step 11 appears on your screen. Step 11 Press 12 This Op Code tells your computer you're going to want it to return to a previously programmed step. Press ENTER Program step 12 appears on the screen and the computer wonders which program steps you wish repeated. Step 12 Press 06 You have just told the computer you want it always to go in motions and always return to program step 06. This was the place you wanted the little man positioned on the screen which was subsequently combined with a random number to change the positioning on the screen. In effect, you have now "looped" part of your program. It will do its thing endlessly with endless variations. Press ENTER The computer salutes and will do as you ordered. Program step 13 appears. Press RESET The program is stored and you are back in the COMMAND mode. "Command" appears on your screen. Press E You have instructed the computer to execute your instructions. The fearsome Creepy Crawler appears on your screen. The little man or whatever symbol you have chosen will flash and buzz in different positions on the screen. Forever. Or, until you turn it off. Or, change the program. Whichever comes first. Important! The power switch on your console is your program eraser. Turn it off and the program is cleared from the unit automatically. Turn it on--and you're ready to enter a new program. Now that you've entered Creepy Crawler in HEX, try entering this variation in ASSEMBLER language. We will call this program Creepy Crawler with an All-Star Cast of Thousands. First, turn the power off and on to erase any previous programming. Now, check the fold-out Operational Flow Chart to see how to get into the Assembler Input Mode. Press RESET Press P Press A Press I You are now in the Assembler Mode at program step 00 and ready to go. One thing. Be sure to enter the periods as well as the letters and numbers. Press L Press D Press V Press . Press 2 Press . Press 3 Press ENTER We are now at Program step 02. Continue entering in Assembler until you get to Program step 12, switch over to the HEX Input Mode. Check the Operational Flow Chart and then-- Press CLEAR Press ROLL Press CLEAR Press M Press I After you finish entering the program, press RESET to store the program--then press E (EXECUTE) and watch what happens! CREEPY CRAWLER VERSION II Step Hex Code Assembler Code Byte Remarks 00 62 13 LDV.2.13 2 Load Reg. 2 with 13 01 00 RND 1 Accum. selects a random number 02 BB UNPB 1 Unpack the random number into Reg. B and C 03 9C LDA.C 1 Load the Accum. from Reg. C 04 E2 ADD.2 1 Add the contents of Reg. 2 to the Accum. 05 AC STO.C 1 Store the contents of Accum. in Reg. C 06 09 MOV 1 Load Accum. from a Program step 07 8B OTA 1 Output from Accum. to screen 08 05 SIG 1 One second buzz 09 09 NOP 1 No operation (used as pause) 10 09 NOP 1 No operation (used as pause) 11 12 82 GTO.82 2 Instructs Odyssey(2) to go to Program step 02 and repeat program (Steps 13-22 require Hex Mode -- see page 27) 13 32 -- 1 14 33 -- 1 15 3A -- 1 16 34 -- 1 17 35 -- 1 Hex codes for various symbols. These symbols 18 3D -- 1 with their Hex Code equivalents are shown at 19 3E -- 1 the front of the book. 20 3F -- 1 21 36 -- 1 22 3C -- 1 THE ROLL MODE--YOUR PROGRAM TROUBLE SHOOTER The Roll Mode is for checking a program step to be sure it contains the correct data. It is also for making a change in a program step without having to erase and re-enter an entire program. To enter the Roll Mode, press R if you are in either the Assembler or HEX input modes. If you are in the EXECUTION mode, press RESET, then P, then M (HEX) or A (ASSEMBLER)--and then press R. Then, press U to display the program steps upward (00-99)--or press D to display the program steps downward (99-00). The Roll Mode will always display its information in HEX--even if you have been entering in Assembler. If everything checks out, roll to the last program step entered and press CLEAR to re-enter the Assembler or HEX Input Mode. If you wish to make a change, press CLEAR at the program step you wish to change. The data will be cleared. Enter M for HEX or A for Assembler, depending on the code you have been using. Press I--the program step you wish to change will appear on the screen. Enter the new data. Press RESET. You will be back in the COMMAND Mode and are ready to go on with the program. The following series of programs will be presented with a running commentary that will tell you exactly where the data is going and what is happening to it. These programs are written in HEX code. At the end of each program, you'll find a summary written in HEX as well as Assembler, so you can enter each program in either language. ADDITION PROGRAM A This program will add two one digit numbers and display the total. Press the POWER BUTTON off and on to clear the computer. Press RESET "Command" appears on your screen. Your computer is ready to accept instruction. Press P "Program" appears on the screen. Press M "Hex Input" appears on your screen. The computer knows you will be using Op Code (Hexadecimal Operation Code). Press I Step 00 appears on the screen. The computer is ready to accept data. Step 00 Press 78 Press ENTER You have told the computer you are going to input the first number into Register 0. Step 01 Press 04 Press ENTER You instruct the computer to feed the second number of the addition problems into the Accumulator. Remember, the Accumulator provides temporary storage for the ALU where the numbers are going to be crunched. Step 02 Press E0 Press ENTER This instructs the computer to add the contents of Register 0 to the contents of the Accumulator and to store the sum in the Accumulator. Step 03 Press B1 Press ENTER This Op Code is an unpacking instruction. It tells the computer to unpack the sum which has been stored in the Accumulator into Register 1 and Register 2. Step 04 Press 6B Press ENTER This starts a positioning instruction. Step 05 Press 00 Press ENTER This Op Code tells the computer to display subsequent information at the 00 position on your TV screen. Step 06 Press C1 Press ENTER You tell the computer you want to output the information in Register 1 (first digit sum). Step 07 Press C2 Press ENTER You also want to output the data in Register 2 (Second digit sum). Step 08 Press 12 Press ENTER This tells the computer you want it always to return to a certain step and repeat the program from that point. Step 09 Press 00 Press ENTER The computer is instructed to return to step 00 and be ready to perform a continuous series of addition problems. The program is now completed. Press RESET The program is now stored in the computer's memory and you are back in the COMMAND Mode. Press E The computer executes your program. A question mark appears on the screen. The computer is asking for two 1 digit numbers to add. Enter the First Number. Press any digit from 0 through 9. You will hear a beep confirming entry. The number will not appear on the screen. That instruction was not included in this program. Enter the Second Number. Press any digit 0 through 9 and the sum total of the two entered numbers will immediately appear on the screen. To enter a new problem, press any single digit number. Then, press the other single digit number. The previous sum will be replaced by the answer of the new addition problem as soon as you have entered the second number of the new problem. Now, here is the addition problem you have just entered expressed in both HEX and ASSEMBLER codes. Note the following points. Important: Remember to get into the proper input mode for the language you are using. Press PMI for HEX. Press PAI for Assembler. Very Important: Look at Program step 04. It is a two Byte instruction. Remember, in Binary each byte is composed of eight bits. 6B (HEX = 0110 1011 (BINARY). 00 (HEX) = 0000 0000 (BINARY). Therefore, 6B 00 is a two byte instruction. If you are in the HEX mode, each Byte must be entered separately. Press 6B Press ENTER Press 00 Press ENTER If you are in the Assembler mode, both Bytes are fed into the computer with one entry. Press L Press D Press V Press . Press B Press . Press 0 Press 0 In either language, you will see Program step 06 on the screen after the data is entered. Now, push the Power Button to erase any previous data... choose one of the input codes...and enter the program. Be sure to press ENTER after each step. ADDITION PROGRAM A -- SUMMARY Step Hex Code Assembler Code Byte Remarks 00 78 INP.0 1 Input Reg. 0 with 1st number 01 04 INA 1 Input Accum. with 2nd number 02 E0 ADD.0 1 Add Reg. 0 to Accum. 03 B1 UNP.1 1 Unpack Accum. into Reg. 1 and Reg. 2 04 6B 00 LDV.B.00 2 Set output position to 00 06 C1 OUT.1 1 Output Reg. 1, 1st digit sum 07 C2 OUT.2 1 Output Reg. 2, 2nd digit sum 08 12 00 GTO.00 2 Go to step 00 and repeat ADDITION PROGRAM B This program will also add two one digit numbers. However, this time when you enter the second number, the entire problem will appear on the screen. (Example: 2+4=6.) You will be entering + and = signs in this program. First, press the POWER BUTTON off and on to clear the computer. Then-- Press RESET "Command" will appear on your screen, and your computer is all ears. Press P "Program" appears on your screen. Press M "Hex Input" appears on your screen. The computer knows you will be using Op Code (Hexadecimal Operation Code). Press I Step 00 appears on the screen. You are ready to input data. Step 00 Press 78 Press ENTER You tell the computer the first number will be entered into Register 0. 01 appears on your screen. Step 01 Press 04 Press ENTER You tell the computer to accept the second number to the Accumulator. 02 appears on the screen. Step 02 Press 6B Press ENTER This starts an output position entry. Step 03 Press 00 Press ENTER The output position is set at 00 at the far left of the screen. Step 04 Press C8 Press ENTER The output channel from Register 0 will open for the first number of the addition problem. Step 05 Press 63 Press ENTER The input channel to Register 3 will open. Step 06 Press 10 Press ENTER 10 will be loaded into Register 3. 10 is Op Code for the (+) sign. Step 07 Press C3 Press ENTER The output channel from Register 3 will open so the (+) sign can be displayed on the screen. Step 08 Press 0B Press ENTER The output channel of the Accumulator will open so that the second number can be displayed on the screen. Step 09 Press 63 Press ENTER The input channel to Register 3 will open. Step 10 Press 2B Press ENTER 2B will be loaded into Register 3. 2B is Op Code for the (=) sign. Step 11 Press C3 Press ENTER The output channel from Register 3 will open so the (=) sign may be displayed on the screen. Step 12 Press E0 Press ENTER This instruction adds the contents of Register 0 to the contents of the Accumulator and stores the result in the Accumulator. Remember, Register 0 contained the first number of the addition problem. The Accumulator held the second number. Step 13 Press B1 Press ENTER This program step unpacks the contents of the Accumulator storing the first digit of the sum in Register 1 and the second digit of the sum in Register 2. Step 14 Press C1 Press ENTER The output channel from Register 1 will open to let the first digit sum be displayed on the screen. Step 15 Press C2 Press ENTER The output channel from Register 2 will open to let the second digit sum be displayed on the screen. Step 16 Press 12 Press ENTER This begins an instruction to return to a previous step. Step 17 Press 00 Press ENTER The computer is instructed to return to step 00 and be ready to solve a new addition problem. The old problem will not erase from the screen until both digits of the new problem are entered. Press RESET The program is now stored in the computer. Press E The computer is ready to execute the program. A question mark appears on the screen asking for input. Press any single digit number. Nothing appears on the screen. Press a second single digit number. The entire problem and the solution appear on the screen. Both will remain there until two new digits are entered. ADDITION PROGRAM B SUMMARY Step Hex Code Assembler Code Byte Remarks 00 78 INP.0 1 Input Reg. 0 with 1st number 01 04 INA 1 Input Accum. with 2nd number 02 6B 00 LDV.B.00 2 Set output position 04 C8 OUT.0 1 Output 1st number from Reg. 0 05 63 10 LDV.3.10 2 Load Reg. 3 with (+) sign 07 C3 OUT.3 1 Out Reg. 3, (+) on screen 08 0B OTA 1 Output 2nd number 09 63 2B LDV.3.2B 2 Load Reg. 3 with (=) sign 11 C3 OUT.3 1 Output (=) sign on screen 12 E0 ADD.0 1 Add Reg. 0 to Accum. 13 B1 UNP.1 1 Unpack Accum. into Reg. 1 and Reg. 2 14 C1 OUT.1 1 Output Reg. 1, 1st digit sum 15 C2 OUT.2 1 Output Reg. 2, 2nd digit sum 16 12 00 GTO.00 2 Go to step 00 and repeat ADDITION PROGRAM C After you enter this program a question mark on the screen asks you to press in two one digit numbers for the computer to add. The first number appears on the screen followed by (+) sign. When you press the second number, it appears on the screen followed by a (=) sign and the answer. When the first digit of the next addition problem is entered, the first problem will disappear from the screen. To begin, turn off the power to erase the previous program. Press RESET Your computer is in the "Command" Mode and ready to accept instructions. Press P The computer enters the "Program" Mode. Press M "Hex Input" appears on the screen. The computer is ready to accept instructions in Op Code. Press I Step 00 appears on the screen and the computer is ready for the program. Step 00 Press 6B Press ENTER You are setting the output position of Register B. Press 00 Press ENTER That output position is 00 at the far left of the screen. Step 02 Press 70 Press ENTER You tell the computer that the first number of the addition problem will be stored in Register 0. Step 03 Press C0 Press ENTER This tells the computer you will want it to output the contents of Register 0. Step 04 Press 63 Press ENTER You are preparing Register 3 to accept data. Step 05 Press 10 Press ENTER Register 3 will be loaded with a 10--the code for a (+) sign. You will find the complete code for all of the graphics stored in your computer on the fold-out at the back of the book. Step 06 Press C3 Press ENTER This will open the way to output the (+) sign from Register 3. Step 07 Press 04 Press ENTER This will open the Accumulator for future input. Step 08 Press 0B Press ENTER The output channel of the Accumulator is set to open. Step 09 Press 63 Press ENTER You want to load a value into Register 3. Step 10 Press 2B Press ENTER That value is 2B--the code for the (=) sign. Step 11 Press C3 Press ENTER This will open the way to output the (=) sign from Register 3. Step 12 Press E0 Press ENTER The computer will then add the contents of Register 0 to the Accumulator. Register 0 has already been instructed to accept the first number in the addition problem (Step 02)--and the Accumulator has been instructed to accept the second number. Step 13 Press B1 Press ENTER This Op Code will unpack the contents of the Accumulator (which contains the sum) into Register 1 and Register 2. Step 14 Press C1 Press ENTER This will open the output channel of Register 1. Step 15 Press C2 Press ENTER This will open the output channel of Register 2. Step 16 Press 70 Press ENTER This input is a pause operation. It tells the computer to leave the first problem on the screen until another problem is entered. Step 17 Press 6C Press ENTER Register C will be opened for loading. Step 18 Press 0B Press ENTER Register C will be loaded with 0B--the Op Code for the decimal number 11, which is exactly the number of positions available on the screen. Step 19 Press 67 Press ENTER Register 7 will be ready for loading. Step 20 Press 0C Press ENTER 0C is Op Code for blank spaces as indicated in the computer graphics section in the fold-out at the back of the book. Register 7 will be loaded with blank spaces. The computer will use these blank spaces to erase the old problem on the screen when the first digit of the new problem is entered. Step 21 Press 9C Press ENTER The Accumulator will be loaded with the contents of Register C--the decimal number 11. Step 22 Press 64 Press ENTER This will open Register 4 to accept data. Step 23 Press 00 Press ENTER Register 4 will be loaded with 00. Step 24 Press 02 Press ENTER The amount in the Accumulator will be decremented (subtracted) by one each time this step is reached. Step 25 Press C7 Press ENTER Register 1 will output its blank spaces. Step 26 Press 24 Press ENTER This is a branch instruction--sort of a fork in the electronic road. The computer is instructed to continue on to the next program step if the number in the Accumulator equals the number in Register 4 (00). Step 27 Press 24 Press ENTER The computer is instructed to return to step 24 if the number in Register 4 is not equal to the Accumulator. Step 24 will decrement the contents of the Accumulator (which originally was 11) by 1 each time until the Accumulator is reset at 00 to match Register 4. Program steps 16 through 27 demonstrate how a computer erases by outputting blank spaces to the screen. Step 28 Press 6B Press ENTER We are resetting Register B to return to its original output position once the Accumulator is equal to Register 4. Step 29 Press 00 Press ENTER The output position of Register B is set at the extreme left position of the screen. Step 30 Press 12 Press ENTER This Op Code instructs the computer to branch to another program step when the amount in the Accumulator equals 00. Step 31 Press 03 Press ENTER The step the computer returns to is 03. Now, you are able to enter and solve repeated addition problems. Press RESET The program is stored. Press E The program is executed. See the beginning of the program for use instructions. ADDITION PROGRAM C SUMMARY Step Hex Code Assembler Code Byte Remarks 00 6B 00 LDV.B.00 2 Set output position to 00 02 70 INP.0 1 Input 1st number to Reg. 0 03 C0 OUT.0 1 Output Reg. 0 04 63 10 LDV.3.10 2 Load Reg. 3 with (+) sign 06 C3 OUT.3 1 Output (+) sign from Reg. 3 07 04 INA 1 Input Accum. (second number) 08 0B OTA 1 Output from Accum. 09 63 2B LDV.3.2B 2 Load Reg. 3 with (=) sign 11 C3 OUT.3 1 Output (=) sign from Reg. 3 12 E0 ADD.0 1 Add Reg. 0 to Accum. 13 B1 UNP.1 1 Unpack Accum. into Reg. 1 and Reg. 2 14 C1 OUT.1 1 Output Reg. 1 15 C2 OUT.2 1 Output Reg. 2 16 70 INP.0 1 This is used as a pause operation 17 6C 0B LDV.C.0B 2 Load Reg. C with Hex 0B (#11) 19 67 0C LDV.7.0C 2 Load Reg. 7 with blank spaces 21 9C LDA.C 1 Load Accum. from Reg. C 22 64 00 LDV.4.00 2 Load Reg. 4 with 00 24 02 DEC 1 Subtract 1 from Accum. 25 C7 OUT.7 1 Output Reg. 7 (blank spaces) 26 24 24 BNE.4.24 2 Branch if Accum. does not = Reg. 4 28 6B 00 LDV.B.00 2 Set output position to 00 30 12 03 GTO.03 2 Go to step 03 and repeat ONE DIGIT MULTIPLICATION After you enter this program a question mark will appear on the screen asking for input. The first digit entered is the number you wish to multiply (the multiplicand). It appears on the screen with an (X) sign. The second digit entered is the multiplier. The complete problem will now appear on the screen along with the answer. Odyssey(2) solves multiplication problems through an addition process. If the problem is 3 X 7, the computer will arrive at the answer by adding 7+7+7. Program steps 00 through 11 are instructions which allow the problem to be displayed on the screen. The mathematical operational sequence begins with step 12. First, press the POWER BUTTON off and on to erase the previous program. Press RESET You are in the "Command" Mode. Press P You enter the "Program" Mode. Press M "Hex Input" appears on the screen. The computer is ready for Op Code instructions. Press I Step 00 appears on the screen and the computer is ready for the program. Step 00 Press 6B Press ENTER The output position of Register B is ready for setting. Step 01 Press 00 Press ENTER You set the output of Register B for the far left of the screen. Step 02 Press 70 Press ENTER The multiplicand is directed to be stored in Register 0. Step 03 Press C0 Press ENTER Register 0 is given an output channel. Step 04 Press 66 Press ENTER The door will be opened to Register 6. Step 05 Press 29 Press ENTER An (X) sign will be entered into Register 6. Step 06 Press C6 Press ENTER Register 6 is given an output channel. Step 07 Press 71 Press ENTER The multiplier will be stored into Register 1. Step 08 Press C1 Press ENTER The multiplier is given a way out of Register 1. Step 09 Press 67 Press ENTER The door to Register 7 is instructed to open. Step 10 Press 2B Press ENTER 2B is Op Code for (=). The (=) sign will be loaded into Register 7. Step 11 Press C7 Press ENTER This will provide an output channel for Register 7. Step 12 Press 90 Press ENTER The Accumulator is instructed to be ready to accept data from Register 0. This is the Register that holds the number you want to multiply. The Accumulator will be loaded with the same value as the contents of Register 0--however, Register 0 will continue to retain its data. Step 13 Press E0 Press ENTER The computer is instructed to add the contents of the Accumulator to Register 0. Remember, that Odyssey(2) multiplies by a series of addition steps. This is the first addition step. Step 14 Press A2 Press ENTER The sum of the digits from the Accumulator and Register 0 will be stored in Register 2. Step 15 Press 91 Press ENTER The Accumulator will be loaded from Register 1 which holds the multiplier. The Accumulator will now know the number of addition steps it must perform to arrive at an answer. Step 16 Press 02 Press ENTER This step will decrement the Accumulator which contains the multiplier by 1 so that the computer can keep track of how many addition steps have been made. Step 17 Press A1 Press ENTER The difference will be stored in Register 1. Step 18 Press 63 Press ENTER The door to Register 3 will open. Step 19 Press 01 Press ENTER 01 will be stored in Register 3. This will give the computer a reference point which will halt the addition process. When the Accumulator contains the contents of Register 1 (the multiplier), it is compared to the contents of Register 3 (which is 01). If the contents in Register 1, which is now in the Accumulator, and Register 3 coincide, the computer will stop adding. If they are not equal, the computer will loop back and continue the addition process. Step 20 Press 33 Press ENTER This starts a branch operation. Step 21 Press 25 Press ENTER The computer is instructed to branch to step 25 if the contents of the Accumulator and Register 3 are equal. In which case, the answer will be unpacked and displayed on the screen. Step 22 Press 92 Press ENTER The Accumulator will be loaded with the information in Register 2, which contains the data fed in Program Step 14. Step 23 Press 12 Press ENTER The computer is instructed to return to a previous step in the program if the conditions in program step 19 have not been met. Step 24 Press 13 Press ENTER The computer is instructed to return to step 13 and once again add the contents of Register 0 to the Accumulator. (Register 0 holds the multiplicand.) Step 25 Press 92 Press ENTER The Accumulator will be loaded with the contents of Register 2 which contains the sum of the addition operations. We are almost at the end of the tunnel. This operation is performed when the contents of the Accumulator and Register 3 are equal. Step 26 Press B4 Press ENTER This is a two digit unpacking operation, which has been explained in Addition Program A. Step 27 Press C4 Press ENTER An output channel for Register 4. Step 28 Press C5 Press ENTER An output channel for Register 5. Step 29 Press 12 Press ENTER You instruct the computer to return to a previous program step. Step 30 Press 00 Press ENTER That step is 00. The computer will now be ready to accept a new multiplication problem. Press RESET The program is stored. Press E The program is executed. ONE DIGIT MULTIPLICATION SUMMARY Step Hex Code Assembler Code Byte Remarks 00 6B 00 LDV.B.00 2 Set output position 02 70 INP.0 1 Multiplicand stored in Reg. 0 03 C0 OUT.0 1 Output Reg. 0 04 66 29 LDV.6.29 2 Symbol (x) stored in Reg. 6 06 C6 OUT.6 1 Output Reg. 6; Reg. 6 (x) 07 71 INP.1 1 Multiplier stored in Reg. 1 08 C1 OUT.1 1 Output Multiplier 09 67 2B LDV.7.2B 2 Symbol (=) stored in Reg. 7 11 C7 OUT.7 1 Output Reg. 7 12 90 LDA.0 1 Add Accum. to Reg. 0 13 E0 ADD.0 1 Add Reg. 0 to Accum. 14 A2 STO.2 1 Store sum in Reg. 2 15 91 LDA.1 1 Load Accum. from Reg. 1 16 02 DEC 1 Decrement Accum. by 1 17 A1 STO.1 1 Store difference in Reg. 1 18 63 01 LDV.3.01 2 Load Reg. 3 with 01 -- Reg. 3 20 33 25 BEQ.3.25 2 Go to step 25 if Accum. = Reg. 3 22 92 LDA.2 1 Load Accum. from Reg. 2 23 12 13 GTO.13 2 Go to step 13 25 92 LDA.2 1 Load Accum. from Reg. 2 26 B4 UNP.4 1 Unpack two digits 27 C4 OUT.4 1 Output Reg. 4 28 C5 OUT.5 1 Output Reg. 5 29 12 00 GTO.00 2 Go to step 00 and repeat ONE DIGIT DIVISION A question mark will appear on the screen. The first number entered will be the dividend and it will be followed by a (/) sign. The second number entered will be the divisor. It will appear on the screen along with an (=) sign and the answer. Your Odyssey(2) computer accomplishes division by a series of subtractions. It's the Odyssey(2) multiplication process in reverse. Note: There are two conditions in division that must be provided. The first condition is when the divisor can be divided into the dividend equally. Example: 6 / 2 = 3. The second condition is when the divisor cannot be divided into the dividend equally and there is a remainder. Example: 9 / 2 = 4 + R. Your Odyssey(2) has been instructed to display (/ R) if there is a remainder. This program provides branching instructions to satisfy both conditions. To begin, turn the POWER BUTTON off and on to erase any previous program. Press RESET You are in the "Command" mode. Press P You have entered the "Program" mode. Press M "Hex Input" appears on the screen. The computer is ready to accept instructions in Op Code. Press I Step 00 appears on the screen, and you are ready to enter the program. Step 00 Press 63 Press ENTER The door to Register 3 will be opened. Step 01 Press 00 Press ENTER We call this "initialization"--a step to insure that Register 3 is set at absolute zero after each problem is solved. Register 3 will contain the sum of the subtraction operations Odyssey(2) will perform to find the quotient. Step 02 Press 6B Press ENTER The door to Register B will be opened. Step 03 Press 00 Press ENTER Register B will be positioned to output at the far left of the screen. Step 04 Press 70 Press ENTER The number to be divided (the dividend) will go into Register 0. The dividend must always be larger than the divisor. Step 05 Press C0 Press ENTER The output channel to Register 0 is set to open. Step 06 Press 69 Press ENTER Register 9 will be opened for input. Step 07 Press 2A Press ENTER 2A is Op Code for (/). The division sign will go into Register 9. Step 08 Press C9 Press ENTER The output channel of Register 9 is set to open. Step 09 Press 71 Press ENTER The divisor will be loaded into Register 1. Step 10 Press C1 Press ENTER The output channel of Register 1 is instructed to open. Step 11 Press 6A Press ENTER The door to Register A will be opened. Step 12 Press 2B Press ENTER 2B is Op Code for (=). The equal sign will go into Register A. Step 13 Press CA Press ENTER The Register A output channel is instructed to open. Step 14 Press 91 Press ENTER The Accumulator will be loaded with the contents of Register 1 which contains the divisor. We are going to use a sample problem so the explanation will be easier (6/2=3). The Accumulator will be loaded with the divisor (2). Step 15 Press D0 Press ENTER The contents of the Accumulator will be subtracted from the contents of Register 0 which contains the dividend (6). Step 16 Press A0 Press ENTER The difference (6-2=4) between the dividend and the divisor (6-2=4) will be stored in Register 0. Step 17 Press 93 Press ENTER The Accumulator will be loaded with the contents of Register 3. This is the Register that was "initialized" at 00 so that we could keep track of the number of times we subtracted. Step 18 Press 03 Press ENTER A 1 will then be added to the Accumulator. This is called an increment. Step 19 Press A3 Press ENTER The sum of the Accumulator is then stored in Register 3. This Register now contains 01. Step 20 Press 90 Press ENTER The Accumulator will be loaded with the contents of Register 0. Register 0 has been loaded with a value of 4, the difference between the dividend and the divisor. This value was loaded into Register 0 in Program step 16. Step 21 Press 13 Press ENTER This will be the start of a branch operation. Step 22 Press 40 Press ENTER The computer will branch to step 40 if the Accumulator equals 0. Once the Accumulator equals 0, the problem is finished and Program step 40 will unpack the answer and it will be displayed on the screen. Step 23 Press 91 Press ENTER If the Accumulator does not equal 0, go to this program step. The Accumulator will be loaded with the contents of Register 1 which contains the divisor (2). Step 24 Press 50 Press ENTER Another branch operation will be started. Step 25 Press 28 Press ENTER The computer will be instructed to branch to program step 28 if Register 0 which contains the dividend (4) is less than the Accumulator which contains the divisor (2) from Register 1. Step 26 Press 12 Press ENTER This tells the computer to return to a previous step if Register 0 is not less than the Accumulator. Step 27 Press 15 Press ENTER This completes the return instructions. The computer is programmed to return to step 15. This step begins the subtraction operations which will continue until Register 0 is loaded into the Accumulator at step 21 and the Accumulator equals 0 in this example. When this condition is met, Odyssey(2) will loop to Program step 40. Step 28 Press 93 Press ENTER This is the step your computer will branch to if a remainder is included. The branching instructions were given in steps 24 and 25. They programmed the computer to branch to step 28 if Register 0 which contains the dividend is less than the Accumulator which at this point contains the divisor. We will use 9/2=4+R as our sample problem. All program steps have been the same up to this point. The computer has looped to step 15 several times. Register 0 now contains 01 and the Accumulator contains 02. This step will load the Accumulator from Register 3 which contains the number of times (2) has been subtracted from (9) which is (4). Step 29 Press B4 Press ENTER This instruction will unpack the answer. Step 30 Press C4 Press ENTER The first digit, stored in Register 4, will be displayed on the screen. Step 31 Press C5 Press ENTER The second digit, stored in Register 5, will be displayed on the screen. Step 32 Press 66 Press ENTER Register 6 will open. Step 33 Press 10 Press ENTER 10 will be loaded into Register 6. 10 is the Op Code for (+). Step 34 Press 67 Press ENTER Register 7 will be opened. Step 35 Press 13 Press ENTER 13 will be loaded into Register 7. 13 is the Op Code for (R). Step 36 Press C6 Press ENTER The output channel for the (+) sign will be opened. Step 37 Press C7 Press ENTER The output channel for (R) will open. Step 38 Press 12 Press ENTER The computer is instructed to return to a previous step. Step 39 Press 00 Press ENTER The computer will return to step 00 and be ready to solve another problem. Our program ends at this point if we have solved a problem that contains a remainder. If not, as in our first example (6/2=3), we would have jumped from Program step 21 to Program step 40. Step 40 Press 93 Press ENTER The Accumulator will be loaded with the contents of Register 3. It will contain the number of times the divisor has been subtracted from the dividend. In step 21, the computer was programmed to branch to this step when the contents of the Accumulator equaled 0. We were doing 6/2=3 so Register 3 contains (3)--the number of times (2) has been subtracted from (6). Step 41 Press B4 Press ENTER This unpacking operation will convert the answer from binary into decimal. Step 42 Press C4 Press ENTER The output channel of Register 4 will be opened for the first digit. Step 43 Press C5 Press ENTER The output channel of Register 5 will be opened for the second digit. Step 44 Press 66 Press ENTER Register 6 will open. Step 45 Press 0C Press ENTER Register 6 will be loaded with 0C which is Op Code for a blank space. Step 46 Press 67 Press ENTER Register 7 will open. Step 47 Press 0C Press ENTER Register 7 will be loaded with a blank space. Registers 6 and 7 have been loaded with blanks so that (+R) will not be displayed on the screen when this branch of the program is employed by the computer. Step 48 Press C6 Press ENTER The output channel from Register 6 will open. Step 49 Press C7 Press ENTER The output channel from Register 7 will open. Step 50 Press 12 Press ENTER The computer is instructed to return to a previous step. Step 51 Press 00 Press ENTER The computer is instructed to return to step 00 and be ready to solve another problem. Press RESET The program is stored. Press E The program is executed. ONE DIGIT DIVISION SUMMARY Step Hex Code Assembler Code Byte Remarks 00 63 00 LDV.3.00 2 Reg. 3 = 00 (initialization) 02 6B 00 LDV.B.00 2 Reg. B = 00 (positioning) 04 70 INP.0 1 Dividend stored in Reg. 0 05 C0 OUT.0 1 Output Reg. 0 06 69 2A LDV.9.2A 2 Symbol (/) stored in Reg. 9 08 C9 OUT.9 1 Output Reg. 9 09 71 INP.1 1 Divisor stored in Reg. 1 10 C1 OUT.1 1 Output Reg. 1 11 6A 2B LDV.A.2B 2 Symbol (=) stored in Reg. A 13 CA OUT.A 1 Output Reg. A 14 91 LDA.1 1 Load Accum. from Reg. 1 15 D0 SUB.0 1 Sub. Accum. from Reg. 0 16 A0 STO.0 1 Store difference in Reg. 0 17 93 LDA.3 1 Load Accum. from Reg. 3 18 03 INC 1 Add 1 to the Accum. 19 A3 STO.3 1 Store sum in Reg. 3 20 90 LDA.0 1 Load Accum. from Reg. 0 21 13 40 BRZ.40 2 Branch to step 40 if Accum. equals 0 23 91 LDA.1 1 Load Accum. from Reg. 1 24 50 28 BLS.0.28 2 Branch to step 28 if Reg. 0 is less than Accum. 26 12 15 GTO.15 2 Go to step 15 28 93 LDA.3 1 Load Accum. from Reg. 3 29 B4 UNP.4 1 Unpack two digits 30 C4 OUT.4 1 Output 1st digit which is stored in Reg. 4 31 C5 OUT.5 1 Output 2nd digit which is stored in Reg. 5 32 66 10 LDV.6.10 2 Symbol (+) stored in Reg. 6 34 67 13 LDV.7.13 2 Symbol (R) stored in Reg. 7 36 C6 OUT.6 1 Output (+) sign 37 C7 OUT.7 1 Output (R) 38 12 00 GTO.00 2 Go to step 00 40 93 LDA.3 1 Load Accum. from Reg. 3 41 B4 UNP.4 1 Unpack two digits 42 C4 OUT.4 1 Output 1st digit from Reg. 4 43 C5 OUT.5 1 Output 2nd digit from Reg. 5 44 66 0C LDV.6.0C 2 A blank is stored in Reg. 6 46 67 0C LDV.7.0C 2 A blank is stored in Reg. 7 48 C6 OUT.6 1 Output blank 49 C7 OUT.7 1 Output blank 50 12 00 GTO.00 2 Branch to step 00 AREA PROBLEMS USING "GO TO SUBROUTINE" AND "RETURN" This program gives you an example of how and when to use the instructions "Go to Subroutine" and "Return." A "Go to Subroutine" instruction tells the computer to branch to a specific program step which contains an operation you may wish to use several times in one program. You can use the same operation several times without having to re-write it. When writing a program using this instruction, the next program step after the "Go to Subroutine" instruction must be reserved for returning from the Subroutine. A program having a "Go to Subroutine" instruction must have a "Return from Subroutine" instruction as well. After you enter this program, you will be able to find the area of a rectangle or the area of a triangle. First, enter the base measurement--then, enter the height measurement. Press 1 to find the area of a rectangle. (Base X Height) Press 2 to find the area of a triangle (Base X Height / 2). Before entering this program, refer to the program on pages 69 and 70 while we explain how it works. Program steps 00 through 08 will be the same for both problems. (00 through 08) Step 08 programs your selection of 1) rectangle area problem, or 2) triangle area problem to be loaded into the Accumulator. First, we'll see what happens when 1 is loaded into the Accumulator. (09 and 10) Steps 09 and 10 instruct the computer to branch to Program step 13 if the Accumulator (which contains 01) equals the contents of Register 1 (which is 01). If we had entered a 2, the computer would have proceeded from Program step 08 to Program steps 11 and 12. (13 and 14) Program steps 13 and 14 instruct the computer to go to step 66 which starts the multiplication subroutine. (Base X Height = Area of Rectangle) (66) Program step 66 loads the Accumulator with the contents of Register 3 which contains the base (Step 06). We'll use 8 as our example of the base measurement. (67) Program step 67 adds the contents of Register 3 (which contains the base measurement of 8 in our example) to the contents of the Accumulator which now also contains 8. (68) The contents of the Accumulator (8+8=16) are stored in Register 5. (69) The Accumulator is loaded with the contents of Register 4 which contains the height. We'll use 3 as our example. This data was entered into Register 4 in Program step 07. (70) In Program step 70, the Accumulator is decremented by 1. (Remember, in multiplying, the multiplier is decremented by 1 with each addition operation until the multiplier equals 01). (71) The contents of the Accumulator (now 2) are loaded into Register 4. (72 through 73) These instructions tell the computer to branch to Program step 77 if the contents of the Accumulator are equal to the contents of Register 1. (Register 1 = 01). This was accomplished in Program step 02. (74) If the Accumulator does not equal 01 at Program step 72, the Accumulator will move to Program step 75 and be loaded from Register 6 which contains 16. (75 and 76) Go to step 67. The addition process is repeated until the amount in the Accumulator is equal to the value of Register 1. When this condition is achieved, the computer will branch to Program step 77 as instructed by Program steps 72 and 73. (77) The Accumulator is loaded from Register 5. (Register 5 now equals 24 which is the answer.) (78) Program step 78 instructs the computer to return from subroutine. This returns the computer to program step 15 which unpacks the contents of Register 5. Program steps 16 and 17 output the answer to the screen. Program step 18 tells the computer to go to the blanking operation at program step 58. Program steps 58 through 63 output blank spaces that erase the old problem and make room for a new one. Program step 64 tells the computer to return to step 00 and get ready to solve a new problem. Now, we'll see how this program computes the area of a triangle (Base X Height / 2). For our example, we'll use 6 as the base and 2 as the height. This time we will choose 2 (triangle routine) at Program step 08 to load into the Accumulator. Since Program steps 09 and 10 do not apply, the computer will jump to Program step 11. Program step 11 instructs Odyssey(2) to branch to program step 20 for the triangle routine. Program step 20 instructs Odyssey(2) to branch to step 66 for the multiply routine. Program steps 66 through 75 perform the addition operations and continue to loop until the Accumulator equals Register 1 (81). Then the Odyssey(2) branches to step 77. Program step 77 loads the Accumulator with Register 5, which holds the answer for B X H or 6 X 2 = 12. We must now divide this answer by 2 to find the area of a triangle. Program step 78 instructs Odyssey(2) to return to the program step immediately following the subroutine from which it branched originally. Program step 22--a pause is implemented. Program step 23 stores Accumulator (which contains 12) in Register 3. This now becomes the dividend. Program steps 24 and 25 load Register 4 with 02; this becomes the divisor. Program steps 26 and 27 load Register 7 with 00. This is the initialization operation, since this Register will hold the sum of the subtraction operations. ("Initialization" was first introduced at the beginning of the One Digit Division Program.) Program step 28 loads Accumulator from Register 4 (which contains the divisor, 2). Program step 29 subtracts Accumulator from Register 3 (which contains the dividend, 12). Program step 30 stores the difference (12-2=10) in Register 3; Register 3 = 10. Program step 31 loads Accumulator from Register 7; Register 7 = 00. Program step 32 adds one to the Accumulator. Remember, this is done to keep track of the number of times we subtract the divisor from the dividend. Program step 33 stores sum in Register 7; Register 7 = 01. Program step 34 loads Accumulator from Register 3; Register 3 = 10, dividend. Program steps 35 and 36 order a branch to step 54 if Accumulator equals 00. Program step 37 loads Accumulator from Register 4; Register 4 = 2, divisor. Program steps 38 and 39 branch to step 42 if Register 3 is less than the Accumulator. Program step 40. If the Odyssey(2) has not branched at this point to another step number, this instruction loops the Odyssey(2) back to Program step 29, so that additional subtraction operations can be performed. At Program step 35, the computer, after completing the subtraction operations so that the Accumulator and Register 3 (the dividend) equal 00, branches to step 54. At Program step 54, the Accumulator is loaded from Register 7 (which contains the number of times we subtracted the answer). Program step 55 then unpacks this answer and Program steps 56 and 57 output the answer to the screen. Blanks are outputted, since in this example there is no remainder, and at step 64, the Odyssey(2) is instructed to return to Program step 00 in preparation for a new problem. *Note: If there had been a remainder, the computer would have branched at Program step 38 to step 42 and when the answer was unpacked and displayed on the screen, a (+R) would also have been displayed. Now, you're ready to enter the program into your Odyssey(2). Be sure to turn the power off and on to erase any previous data. "GO TO SUBROUTINE" AND "RETURN" SUMMARY Step Hex Code Assembler Code Byte Remarks 00 6B 00 LDV.B.00 2 Reg. B = 00 (Positioning) 02 61 01 LDV.1.01 2 Area of rectangle--select (1) 04 62 02 LDV.2.02 2 Area of triangle--select (2) 06 73 INP.3 1 Input value (base) to Reg. 3 07 74 INP.4 1 Input value (height) to Reg. 4 08 04 INA 1 Select 1 or 2 09 31 13 BEQ.1.13 2 Go to rectangle routine 11 32 20 BEQ.2.20 2 Go to triangle routine 13 14 66 GTS.66 2 Go to multiply subroutine 15 B5 UNP.5 1 Unpack Reg. 5 and 6 16 C5 OUT.5 1 Output 1st digit 17 C6 OUT.6 1 Output 2nd digit 18 12 58 GTO.58 2 Go to blanking operation 20 14 66 GTS.66 2 Go to multiply subroutine 22 00 NOP 1 No operation (pause) 23 A3 STO.3 1 Store Accum. in Reg. 3 24 64 02 LDV.4.02 2 Load Reg. 4 with 02 26 67 00 LDV.7.00 2 Load Reg. 7 with 00 28 94 LDA.4 1 Load Accum. from Reg. 4 29 D3 SUB.3 1 Subtract Accum. from Reg. 3 30 A3 STO.3 1 Store difference in Reg. 3 31 97 LDA.7 1 Load Accum. from Reg. 7 32 03 INC 1 Add one to Accum. 33 A7 STO.7 1 Store sum in Reg. 7 34 93 LDA.3 1 Load Accum. from Reg. 3 35 13 54 BRZ.54 2 Branch to step 54 if A = 0 37 94 LDA.4 1 Load Accum. from Reg. 4 38 53 42 BLS.3.42 2 Branch to step 42 if Reg. 3 is less than Accum. 40 12 29 GTO.29 2 Go to step 29 42 97 LDA.7 1 Load Accum. from Reg. 7 43 B8 UNP.8 1 Unpack Reg. 8 and Reg. 9 44 C8 OUT.8 1 Output 1st digit 45 C9 OUT.9 1 Output 2nd digit 46 6E 10 LDV.E.10 2 Load Reg. E with Symbol (+) 48 6F 13 LDV.F.13 2 Load Reg. F with Symbol (R) 50 CE OUT.E 1 Output (+) 51 CF OUT.F 1 Output (R) 52 12 58 GTO.58 2 Go to step 58 54 97 LDA.7 1 Load Accum. from Reg. 7 55 B8 UNP.8 1 Unpack Reg. 8 and Reg. 9 56 C8 OUT.8 1 Output 1st digit 57 C9 OUT.9 1 Output 2nd digit 58 6E 0C LDV.E.0C 2 Load Reg. E with a blank 60 6F 0C LDV.F.0C 2 Load Reg. F with a blank 62 CE OUT.E 1 Output blank 63 CF OUT.F 1 Output blank 64 12 00 GTO.00 2 Go to step 00 66 93 LDA.3 1 Load Accum. from Reg. 3 67 E3 ADD.3 1 Add Reg. 3 to Accum. 68 A5 STO.5 1 Store Accum. in Reg. 5 69 94 LDA.4 1 Load Accum. from Reg. 4 70 02 DEC 1 Decrement Accum. by 1 71 A4 STO.4 1 Store Accum. in Reg. 4 72 31 77 BEQ.1.77 2 If Accum. = Reg. 1, branch to step 77 74 95 LDA.5 1 Load Accum. from Reg. 5 75 12 67 GTO.67 2 Go to step 67 77 95 LDA.5 1 Load Accum. from Reg. 5 78 07 RET 1 Return to subroutine ONE DIGIT ADDITION FLASH CARD When you enter this program, a Flash Card addition game will appear on your television set. An unsolved addition problem flashes on the screen. You enter the solution through the keyboard. If the answer is less than 10, preface the number with a 0. This program is different from the Flash Card game which is already programmed in the computer. In this program, the old problem is erased automatically and a new problem is displayed on the screen. There is also a rather interesting reward for entering the correct answer. Program steps 45 through 61 input a computerized musical comedy production number. Program steps 70 through 78 are the rests (pauses) in the melody. Program step 26 is a packing operation. The data from Register 3 and Register 4 is combined and loaded into the Accumulator. Program steps 62 through 69 reset Register B to 00 so that it's ready for the next problem. Program steps 62 through 69 reset Register 3 to 00 so that it's ready for the next problem. ONE DIGIT ADDITION FLASH CARD SUMMARY Step Hex Code Assembler Code Byte Remarks 00 6A 0C LDV.A.0C 2 Load a blank into Reg. A 02 68 10 LDV.8.10 2 Load a (+) sign into Reg. 8 04 69 2B LDV.9.2B 2 Load an (=) sign into Reg. 9 06 6C 2D LDV.C.2D 2 Load (N) into Reg. C 08 6D 17 LDV.D.17 2 Load (O) into Reg. D 10 08 RND 1 Load Accum. with random number 11 B0 UNP.0 1 Separate digits 12 6B 00 LDV.B.00 2 Set output position 14 C0 OUT.0 1 Output first digit 15 C8 OUT.8 1 Output (+) sign 16 C1 OUT.1 1 Output second digit 17 00 NOP 1 A no operation instruction must follow every third output instruction in a row 18 C9 OUT.9 1 Output (=) sign 19 90 LDA.0 1 Load Accum. from Reg. 0 20 E1 ADD.1 1 Add Reg. to the Accum. 21 A2 STO.2 1 Store sum in Reg. 2 22 73 INP.3 1 Input first digit guess 23 C3 OUT.3 1 Output first digit guess 24 74 INP.4 1 Input second digit guess 25 C4 OUT.4 1 Output second digit guess 26 B3 PAK.3 1 Combine digits. This is a packing operation. 27 CA OUT.A 1 Output blank 28 32 45 BEQ.2.45 2 If correct guess...buzz 30 CC OUT.C 1 Output (N) 31 CD OUT.D 1 Output (O) 32 6B 04 LDV.B.04 2 Set output position to 04 34 73 INP.3 1 Input first number of second guess 35 C3 OUT.3 1 Output first number 36 CA OUT.A 1 Output blank 37 CA OUT.A 1 Output blank 38 00 NOP 1 No operation 39 CA OUT.A 1 Output blank 40 CA OUT.A 1 Output blank 41 6B 00 LDV.B.00 2 Set position to 00 43 CA OUT.A 1 Output blank 44 9B LDA.B 1 Load Accum. from Reg. B 45 14 70 GTS.70 2 Buzz 46 05 SIG 1 Buzz 47 14 70 GTS.70 2 No sound 48 05 SIG 1 Buzz 49 14 70 GTS.70 2 Buzz 50 05 SIG 1 Buzz 51 14 70 GTS.70 2 No sound 52 05 SIG 1 Buzz 53 14 70 GTS.70 2 No sound 54 05 SIG 1 Buzz 55 14 70 GTS.70 2 Buzz 56 05 SIG 1 Buzz 57 14 70 GTS.70 2 No sound 58 14 70 GTS.70 2 No sound 59 14 70 GTS.70 2 Buzz 60 05 SIG 1 Buzz 61 6B 00 LDV.B.00 2 Set position to 00 63 CA OUT.A 1 Output blank 64 9B LDA.B 1 Load Accum. from Reg. B 65 13 10 BRZ.10 2 If Accum. = 0, computer branches to step 10 67 12 64 GTO.64 2 Go to step 64 69 67 00 LDV.7.00 2 Load Reg. 7 with 00 71 00 NOP 1 No operation 72 02 DEC 1 Subtract 1 from Accum. 73 27 75 BNE.7.75 2 Branch if Accum. is not = Reg. 7 which contains 00 75 00 NOP 1 No operation 77 27 75 BNE.7.75 2 Branch if Accum. is not = Reg. 7 which contains 00 79 07 RET 1 Return from subroutine THREE WAYS TO ENTER AND OUTPUT A LETTER These three sample programs are presented to show you the three different instructions which can be used to input and output a letter on the screen. For the first example, we have chosen to input and display the letter "H" or 1D in HEX Code. With this type of program, whatever is loaded into the register and is outputted to the screen will remain on the screen. You cannot change it. With this program, you could enter a complete message and have it remain on the screen. The second example uses the instructions "Input to a Register" and "Output from a Register," but does not designate any particular value. Thus, once the program is entered, any value can be entered and it will be displayed on the screen. The third example is similar to the second in that any value may be entered, but it is inputted to the Accumulator rather than to a register. You will note, in all three examples, the last instruction was "Input to a Register" which was used as a pause since no output instruction was indicated, thus only one keyboard depression could be made. Now, try this--using example two or three, program the appropriate instruction sets in order to create a loop so that all 11 positions on the screen may be used. (Hint! Refer back to the addition programs. Check to see how they let you keep entering one problem after another by returning to a previous program step.) THREE WAYS TO ENTER AND OUTPUT A LETTER (For this example, use "H") EXAMPLE A Step Hex Code Assembler Code Byte Remarks 00 6B 00 LDV.B.00 2 Positioning 02 60 1D LDV.0.1D 2 Load Reg. 0 with H 04 C0 OUT.0 1 Output Reg. 0 = H 05 71 INP.1 1 Input to Reg. 1 (used as pause) EXAMPLE B Step Hex Code Assembler Code Byte Remarks 00 6B 00 LDV.B.00 2 Positioning 02 70 INP.0 1 Input Reg. 0 03 C0 OUT.0 1 Output Reg. 0 04 71 INP.1 1 Input Reg. 1 (pause) EXAMPLE C Step Hex Code Assembler Code Byte Remarks 00 6B 00 LDV.B.00 2 Positioning 02 04 INA 1 Input Accum. 03 0B OTA 1 Output Accum. 04 71 INP.1 1 Input Reg. 1 (pause) SIX LETTER GUESS After being entered, this program allows you to enter a six letter word into the Odyssey(2). Six dots appear on the screen and your opponent enters a letter. If it is used in the word, it appears on the screen in the correct position. If the letter does not appear in the word, nothing happens. Program step 00 used as a flag or reference position. 01 is loaded into Register 7. 01 was chosen rather than 00 because 01 can only mean the decimal number 1 and nothing else, while 00 can be a number or the instruction "No Operation." Program steps 04, 05, and 06 input 1st letter into Register 9, load a dot into Register 1, output Register 1 to screen. This is an initialization process and steps 07 through 27 are the same. This is done so that the six dots appear on the screen when the word is first inputted. Note the Register Use column. Program steps 28 through 37 position Odyssey(2) to 00 each time a guess is made and output to the screen either the correct letter guessed or a dot. Program steps 38 and 39 instruct Odyssey(2) to return to 00 if Accumulator equals the contents of Register 7. The computer is now ready for a new game. (Note: This is a flag or reference point.) Program step 40 inputs a guess to the Accumulator. It is compared to each register in Program steps 41 through 52. Program steps 53 and 54 instruct Odyssey(2) to go to Program step 71 if a letter in the word is missing. Program steps 71 and 72 load Register 8 with a dot. Program step 73 loads the Accumulator from Register 8. Program steps 74 through 85 instruct Odyssey(2) to branch to Program step 28 if any register (1 through 6) is equal to the Accumulator (in other words, if the register still remains a dot.) Program steps 86 and 87 load Register 7 with a 2B (=). This is a flag.* Program steps 88 and 90 sound the buzz which indicates the word has been displayed correctly. Program steps 91 and 92 instruct Odyssey(2) to go to step 28 for positioning. Program steps 28 through 37 display word on screen. Program steps 38 and 39 instruct Odyssey(2) to return to 00 if Accumulator = Register 7. Program step 00 loads Register with 01 and game continues. *Note: The 2B (=) sign was used as a flag in this instance; however, any sign could have been used instead. SIX LETTER GUESS SUMMARY Step Hex Code Assembler Code Byte Remarks Register/Use 00 67 01 LDV.7.01 2 Reg. 7 loaded with reference position (flag) 01 02 6B 00 LDV.B.00 2 Positioning 04 79 INP.9 1 Input 1st letter 2--1st dot 05 61 27 LDV.1.27 2 Read 1st dot 3--2nd dot 07 C1 OUT.1 1 1st dot on screen 4--3rd dot 08 7A INPA 1 Input 2nd letter 5--4th dot 09 62 27 LDV.2.27 2 Read 2nd dot 6--5th dot 11 C2 OUT.2 1 2nd dot on screen 7--6th dot (flag) 12 7C INPC 1 Input 3rd letter 13 63 27 LDV.3.27 2 Read 3rd dot 9--1st letter 15 C3 OUT.3 1 3rd dot on screen A--2nd letter 16 7D INPD 1 Input 4th letter B--Positioning 17 64 27 LDV.4.27 2 Read 4th dot C--3rd letter 19 C4 OUT.4 1 4th dot on screen D--4th letter 20 7E INPE 1 Input 5th letter E--5th letter 21 65 27 LDV.5.27 2 Read 5th dot F--6th letter 23 C5 OUT.5 1 5th dot on screen 24 7F INPF 1 Input 6th letter 25 66 27 LDV.6.27 2 Read 6th dot 27 C6 OUT.6 1 6th dot on screen 28 6B 00 LDV.B.00 2 Position on screen 30 C1 OUT.1 1 Put dots on screen 31 C2 OUT.2 1 Put dots on screen 32 C3 OUT.3 1 Put dots on screen 33 00 NOP 1 No operation 34 C4 OUT.4 1 Put dots on screen 35 C5 OUT.5 1 Put dots on screen 36 C6 OUT.6 1 Put dots on screen 37 00 NOP 1 No operation 38 37 00 BEQ.7.00 2 Reset 40 04 INA 1 Input guess to Accum. 41 39 55 BEQ.9.55 2 Letter in word 42 3A 58 BEQ.A.58 2 Letter in word 43 3C 61 BEQ.C.61 2 Letter in word 45 3D 64 BEQ.D.64 2 Letter in word 47 3E 67 BEQ.E.67 2 Letter in word 49 3F 70 BEQ.F.70 2 Letter in word 51 12 71 GTO.71 2 Wrong guess 53 A1 STO.1 1 1st letter correct 54 12 43 GTO.43 2 Check next position 56 A2 STO.2 1 2nd letter correct 57 12 45 GTO.45 2 Check next position 59 A3 STO.3 1 3rd letter correct 60 12 47 GTO.47 2 Check next position 62 A4 STO.4 1 4th letter correct 63 12 49 GTO.49 2 Check next position 65 A5 STO.5 1 5th letter correct 66 12 51 GTO.51 2 Check next position 68 A6 STO.6 1 6th letter correct 69 12 51 GTO.51 2 Check next position 71 68 27 LDV.8.27 2 Load Reg. 8 with dot 73 98 LDA.8 1 Accum. is loaded from Reg. 8 which contains a dot 74 31 28 BEQ.1.28 2 Position (Step 28) 76 32 28 BEQ.2.28 2 Position (Step 28) 78 33 28 BEQ.3.28 2 Position (Step 28) 80 34 28 BEQ.4.28 2 Position (Step 28) 82 35 28 BEQ.5.28 2 Position (Step 28) 84 36 28 BEQ.6.28 2 Position (Step 28) 86 67 2B LDV.7.2B 2 Set flag to (=) 88 97 LDA.7 1 Accum. loaded from Reg. 7 which contains 01 89 05 SIG 1 90 05 SIG 1 91 12 28 GTO.28 2 Positioning MESSAGE This program gives you a choice of six different messages to display on the screen. By pressing 1, 2, 3, 4, 5, or 6 you can select from the following messages: Hello, Talk A Look, Remarka-ble, New For, Questions, and Come Back. Before entering this program, there are four new Op Codes to learn. INA (Op Code 04) means Input to Accumulator. This instruction allows a number to be entered from the keyboard directly into the Accumulator. ADD.0 (Op Code E0) means Add Register 0 to Accumulator. This instruction adds the contents of Register 0 to the Accumulator. STO.C (Op Code AC) means Store Accumulator in Register C. This instruction stores the contents of the Accumulator in Register C. MOV (Op Code 09) means Move. This is a special instruction. It loads the Accumulator with the contents at the program step whose address is in Register C. To begin, turn the POWER BUTTON off and on to erase any previous program. Press RESET You are in the "Command" mode. Press P You have entered the "Program" mode. Press M "Hex Input" appears on the screen. The computer is ready to accept instructions in Op Code. Press I Step 00 appears on the screen, and you are ready to enter the program. Step 00 Press 60 Press ENTER The door to Register 0 will be opened. Step 01 Press 90 Press ENTER Register 0 will be loaded with 90. This is the address of the first location in the location table. The location table begins at program step 90. It contains the starting addresses of each of the six messages. Step 02 Press 61 Press ENTER The door to Register 1 will be opened. Step 03 Press 0C Press ENTER Register 1 will be loaded with 0C, the Op Code for a blank. Step 04 Press 04 Press ENTER INA -- the keyboard is activated so a number can be entered directly into the Accumulator. Step 05 Press E0 Press ENTER ADD.0 -- the contents of Register 0 (90) are added to the Accumulator. If 1 was entered at the keyboard, the Accumulator now contains 91. Step 06 Press AC Press ENTER STO.C -- the contents of the Accumulator (91) are stored in Register C. Step 07 Press 09 Press ENTER MOV -- the Accumulator is loaded with the contents at the program step whose address is stored in Register C. Register C contains 91. The contents at program step 91 is 36 (the starting address of message 1). The Accumulator is now loaded with 36. Step 08 Press AC Press ENTER STO.C -- the contents of the Accumulator (36) are now stored in Register C. Register C now points to program step 36, where message 1 begins. Step 09 Press 6B Press ENTER The door to Register B will be opened. Step 10 Press 00 Press ENTER Register B will be loaded with 00 (screen positioning). Step 11 Press 62 Press ENTER The door to Register 2 will be opened. Step 12 Press 0B Press ENTER Register 2 will be loaded with 0B (11 decimal) -- the number of screen positions. Step 13 Press 63 Press ENTER The door to Register 3 will be opened. Step 14 Press 00 Press ENTER Register 3 will be loaded with 00. It will be used as a reference value in the blanking loop. Step 15 Press 91 Press ENTER LDA.1 -- the Accumulator is loaded with the contents of Register 1 (the blank, 0C). Step 16 Press 0B Press ENTER OTA -- the blank is output to the screen. Step 17 Press 92 Press ENTER LDA.2 -- the Accumulator is loaded with the contents of Register 2 (countdown value). Step 18 Press 02 Press ENTER DEC -- the Accumulator is decremented by 1. Step 19 Press A2 Press ENTER STO.2 -- the decremented value is stored back in Register 2. Step 20 Press 23 Press ENTER BNE -- branch if not equal. Step 21 Press 15 Press ENTER Branch to step 15 if the Accumulator does not equal Register 3 (00). This loops to blank all 11 screen positions. Step 22 Press 6B Press ENTER The door to Register B will be opened again. Step 23 Press 00 Press ENTER Register B is repositioned to 00 (left side of screen) for displaying the message. Step 24 Press 09 Press ENTER MOV -- Register C moves to the next program step and the Accumulator is loaded with the character stored at that step. (Register C stays pointing to the message data area; the program counter auto-increments by 1 each time through this step, fetching successive characters.) Step 25 Press 33 Press ENTER BEQ -- branch if equal. Step 26 Press 04 Press ENTER Branch to step 04 if the Accumulator equals 00 (end-of-message sentinel). The computer returns to step 04 to wait for a new message selection. Step 27 Press 0B Press ENTER OTA -- the character in the Accumulator is output to the screen. Step 28 Press 12 Press ENTER GTO -- go to. Step 29 Press 24 Press ENTER Go to step 24 to fetch the next character and continue displaying the message. The message data follows. Each message is stored as a sequence of character codes, ending with 00 (end-of-message). Step 30: 1D (H) Step 31: 12 (E) Step 32: 0E (L) Step 33: 17 (L) Step 34: 1F (O) Step 35: 00 End of Message 1 (HELLO) Step 36: 17 (T) Step 37: 20 (A) Step 38: 0E (L) Step 39: 17 (L) Step 40: 0C (blank) Step 41: 20 (A) Step 42: 0C (blank) Step 43: 0E (L) Step 44: 17 (L) Step 45: 1F (O) Step 46: 12 (K) Step 47: 00 End of Message 2 (TALL A LLOK / TAKE A LOOK) Step 48: 13 (R) Step 49: 12 (E) Step 50: 26 (M) Step 51: 20 (A) Step 52: 13 (R) Step 53: 1F (K) Step 54: 20 (A) Step 55: 25 (B) Step 56: 0E (L) Step 57: 12 (E) Step 58: 00 End of Message 3 (REMARKABLE) Step 59: 2D (N) Step 60: 12 (E) Step 61: 11 (W) Step 62: 0C (blank) Step 63: 1B (F) Step 64: 1F (O) Step 65: 13 (R) Step 66: 0C (blank) Step 67: 00 End of Message 4 (NEW FOR) Step 68: 12 (Q) Step 69: 18 (U) Step 70: 12 (E) Step 71: 15 (S) Step 72: 19 (T) Step 73: 16 (I) Step 74: 1F (O) Step 75: 2D (N) Step 76: 15 (S) Step 77: 0C (blank) Step 78: 00 End of Message 5 (QUESTIONS) Step 79: 23 (C) Step 80: 1F (O) Step 81: 26 (M) Step 82: 12 (E) Step 83: 0C (blank) Step 84: 25 (B) Step 85: 20 (A) Step 86: 23 (C) Step 87: 1F (K) Step 88: 00 End of Message 6 (COME BACK) Location Table (starting addresses of each message): Step 90: 36 (start of Message 1) Step 91: 36 (start of Message 1 -- note: table entries map selection 1=91, 2=92, etc.) Step 92: 48 (start of Message 2) Step 93: 59 (start of Message 3) Step 94: 6A (start of Message 4) Step 95: 79 (start of Message 5) Step 96: 81 (start of Message 6) Note: When entering single letters and numbers, the Hex Code only is used, since there is no Assembler Code equivalent. Press RESET The program is stored. Press E The program is executed. MESSAGE SUMMARY Step Hex Code Assembler Code Byte Remarks 00 60 90 LDV.0.90 2 Location table address (90) loaded into Reg. 0 02 61 0C LDV.1.0C 2 Blank (0C) loaded into Reg. 1 04 04 INA 1 Press 1, 2, 3, 4, 5, or 6 05 E0 ADD.0 1 Add Reg. 0 to Accumulator 06 AC STO.C 1 Store Accumulator in Reg. C 07 09 MOV 1 Load Accumulator with contents at address in Reg. C 08 AC STO.C 1 Store message start address in Reg. C 09 6B 00 LDV.B.00 2 Position output to left of screen 11 62 0B LDV.2.0B 2 Load Reg. 2 with 11 (screen positions countdown) 13 63 00 LDV.3.00 2 Load Reg. 3 with 00 (reference for BNE) 15 91 LDA.1 1 Load Accumulator from Reg. 1 (blank) 16 0B OTA 1 Output blank to screen 17 92 LDA.2 1 Load Accumulator from Reg. 2 (countdown) 18 02 DEC 1 Decrement Accumulator by 1 19 A2 STO.2 1 Store decremented value in Reg. 2 20 23 15 BNE.3.15 2 Loop to step 15 if Accumulator not equal Reg. 3 22 6B 00 LDV.B.00 2 Reposition Reg. B to left of screen 24 09 MOV 1 Load next message character into Accumulator 25 33 04 BEQ.3.04 2 Branch to step 04 if Accumulator equals 00 (end of message) 27 0B OTA 1 Output character to screen 28 12 24 GTO.24 2 Go to step 24 for next character 30 1D * 1 H 31 12 * 1 E 32 0E * 1 L 33 17 * 1 L 34 1F * 1 O 35 00 * 1 End of Message 1 36 17 * 1 T 37 20 * 1 A 38 0E * 1 L 39 17 * 1 L 40 0C * 1 Blank 41 20 * 1 A 42 0C * 1 Blank 43 0E * 1 L 44 17 * 1 L 45 1F * 1 O 46 12 * 1 K 47 00 * 1 End of Message 2 48 13 * 1 R 49 12 * 1 E 50 26 * 1 M 51 20 * 1 A 52 13 * 1 R 53 1F * 1 K 54 20 * 1 A 55 25 * 1 B 56 0E * 1 L 57 12 * 1 E 58 00 * 1 End of Message 3 59 2D * 1 N 60 12 * 1 E 61 11 * 1 W 62 0C * 1 Blank 63 1B * 1 F 64 1F * 1 O 65 13 * 1 R 66 0C * 1 Blank 67 00 * 1 End of Message 4 68 12 * 1 Q 69 18 * 1 U 70 12 * 1 E 71 15 * 1 S 72 19 * 1 T 73 16 * 1 I 74 1F * 1 O 75 2D * 1 N 76 15 * 1 S 77 0C * 1 Blank 78 00 * 1 End of Message 5 79 23 * 1 C 80 1F * 1 O 81 26 * 1 M 82 12 * 1 E 83 0C * 1 Blank 84 25 * 1 B 85 20 * 1 A 86 23 * 1 C 87 1F * 1 K 88 00 * 1 End of Message 6 90 36 * 1 Location table: start of Message 1 91 36 * 1 Location table: start of Message 1 (selection 1 offset) 92 48 * 1 Location table: start of Message 2 93 59 * 1 Location table: start of Message 3 94 6A * 1 Location table: start of Message 4 95 79 * 1 Location table: start of Message 5 96 81 * 1 Location table: start of Message 6 CONCLUSION You have now had some experience in entering programs and should have some insight into how a computer "thinks." As you have learned, Odyssey(2) has 16 registers, each containing 8 bits of information. It has 99 program steps and 11 screen positions. There are blank program sheets in the back of this booklet for your use. As you gain experience you will find it less and less necessary to refer to the programs in this book and will be entering them from memory. OPERATING MODE REVIEW There are eight Operating Modes: 1. Command Mode 2. Assembler Mode 3. Execution Mode 4. Hex Input Mode 5. Display Mode 6. Input Mode 7. Program Mode 8. Roll Mode COMMAND MODE The Command Mode is the mode in which you have access to all other modes. To enter the Command Mode: - Press RESET or CLEAR from the Assembler Mode, Display Mode, or Hex Input Mode. - Press RESET from the Execution Mode. From the Command Mode you may enter the following modes: - Press E to enter Execution Mode. - Press C to enter Continue Mode. - Press D to enter Display Mode. - Press P to enter Program Mode. CONTINUE MODE (C) The Continue Mode is used to locate problems in a register or program step. To use it: 1. Use Roll Mode to find the suspect program step. 2. Replace the Op Code at that step with FF (the halt statement). 3. Run the program (press E). The program will halt at the FF step. 4. Press D to enter Display Mode and examine the program counter (P), registers, or Accumulator (X) to check the state of the computer at that point. If the program counter shows the step after FF, you know the branch was taken to that step. 5. Press CLEAR to return to Command Mode. 6. Press P to enter Program Mode, then M for Hex Input, then R for Roll Mode. 7. Roll to the FF step and replace FF with the original Op Code. Note: Only one FF halt statement at a time should be used. DISPLAY MODE (D) The Display Mode allows you to examine the contents of registers and other internal components. To enter Display Mode: Press D from Command Mode. To display contents: - Press 0 through 9 to display Registers 0 through 9. - Press A through F to display Registers A through F. - Press P to display the Program Counter. - Press S to display the Subroutine Counter. - Press X to display the Accumulator. To leave Display Mode: Press CLEAR or RESET. PROGRAM MODE The Program Mode sets the Odyssey(2) to accept a program. To enter Program Mode: Press P from Command Mode. From Program Mode: - Press A to enter Assembler Mode. - Press M to enter Hex Input Mode. To leave Program Mode: Press RESET (returns to Command Mode). You may also press A or M. ASSEMBLER MODE To enter Assembler Mode: Press A from Program Mode, or press CLEAR from Input Mode. From Assembler Mode: - Press I to enter Input Mode. - Press R to enter Roll Mode. To leave Assembler Mode: Press CLEAR or RESET. HEX INPUT MODE To enter Hex Input Mode: Press M from Program Mode, or press CLEAR from Input Mode. From Hex Input Mode: - Press I to enter Input Mode. - Press R to enter Roll Mode. To leave Hex Input Mode: Press CLEAR or RESET. INPUT MODE To enter Input Mode: Press I from Assembler Mode or Hex Input Mode. In Input Mode: Type assembler mnemonics or hexadecimal Op Codes to enter program instructions. To leave Input Mode: - Press RESET to return to Command Mode. - Press CLEAR to return to Assembler Mode or Hex Input Mode. ROLL MODE To enter Roll Mode: Press R from Assembler Mode or Hex Input Mode. In Roll Mode: - Press U to roll up through program steps (00 to 99). - Press D to roll down through program steps (99 to 00). To leave Roll Mode: Press CLEAR (returns to Assembler Mode or Hex Input Mode). HOW A COMPUTER ADDS 1+1 The following diagram illustrates the logic gate operations the Odyssey(2) performs when computing 1+1=2. The problem "1+1=?" is entered via the keyboard. The two inputs (both 1) pass through an Or gate, which outputs 1. They also pass through an And gate, which outputs 0 (the carry bit). The Or gate output (1) then passes through a Not gate, which outputs 0 -- wait, the actual flow is: the Or gate output (1) and the inverted carry (Not gate output, 1) pass through a second And gate, producing binary output 1 in the ones place and 0 in the carry -- yielding binary 10, which equals decimal 2. The Symbol/Sound Generator then converts this binary result into the decimal display "1+1=2." GLOSSARY GLOSSARY OF FREQUENTLY USED COMPUTER TERMS Accumulator. A working register within a computer. It is a small memory device that provides temporary data storage and/or instruction storage for the ALU. It can also store the result of the ALU's operation and may be used as an operand source for the ALU. Applications. A job given to the computer to do. Application Software. Programs written for the computer. Arithmetic Logic Unit (ALU). A part of the Central Processing Unit (CPU). The ALU accepts data from different sources, acts upon it, then outputs one result. It is in the ALU that all arithmetic and logic operations are performed. It is also known as the "number cruncher" since it's here that all binary data is acted upon. Binary Numbers. A number based on two digits, 1 and 0. With enough 1's and 0's, any number can be expressed. The inside of a computer is basically a series of on-off switches that turn on an electrical charge to express 1. They turn off the electrical charge to express 0. A computer performs binary calculations by sending these on-off signals through logic gates which pass on information according to the rules built into them. The functions of these logic gates are called AND, OR and NOT. This diagram demonstrates how a computer's logic circuit adds 1 and 1. 1. Two electrical currents enter the logic circuit. (Remember -- the presence of the electricity signals 1. The absence signals 0.) 2. The incoming currents flow to the OR gate at the top and to the first AND gate at the bottom. The OR gate lets the current through because at least one of the circuits is carrying an electrical charge. The AND gate lets the current through because both circuits are carrying a charge. 3. The current at the top heads to the second AND gate. The bottom stream is divided with one part flowing to the exit and the other part heading toward the NOT gate. 4. A NOT gate is a "reverser." It changes 1's to 0's and 0's to 1's. The NOT gate turns off the current flowing through it. 5. The second AND gate senses the absence of current from the NOT gate and the presence of current coming to it from the OR gate. 6. Since one of the streams entering the second AND gate is charged and the other is not, the second AND gate will not allow any current to pass to the exit. 7. The original two electrical currents representing 1 and 1 come out of the logic circuit as only one stream of electrical current. This is expressed as 1 and 0 -- the binary equivalent of 2. Computers operate only on binary numbers. A computer can add, subtract, multiply (by adding the same number repeatedly), and divide (by using subtraction and addition). When a computer adds and subtracts binary numbers, there are several rules which it follows: Binary Addition: 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 with a carry of 1 A carry bit is produced from the addition of 1+1. Binary carries are treated in the same way as decimal carries; they are carried to the left. Example: 9 = 0000 1001 +7 = 0000 0111 16 = 0001 0000 Binary Subtraction: 1. All ones in the subtrahend are changed to zeros and all zeros are changed to ones. 2. A one is then added to the least significant bit of the new subtrahend. 3. Add the result to the minuend and ignore the carry bit, if there is one. Example: 10 = 0000 1010 minuend -5 = 0000 0101 subtrahend Rule 1: 0000 0101 becomes 1111 1010 Rule 2: 1111 1010 + 1 1111 1011 Rule 3: 0000 1010 +1111 1011 0000 0101 Listed below are some binary numbers and their decimal equivalents. Try adding and subtracting in binary. It really works. 1 = 0001 5 = 0101 9 = 1001 13 = 1101 2 = 0010 6 = 0110 10 = 1010 14 = 1110 3 = 0011 7 = 0111 11 = 1011 15 = 1111 4 = 0100 8 = 1000 12 = 1100 16 = 0001 0000 Basic. Beginners All-Purpose Symbolic Instruction Code. This is one of the simplest programming languages and is in general use on many computers. Bit. The basic unit of information used by a computer. A bit is a binary number: 1 or 0. A simple pocket calculator may store less than a hundred bits of information. A large computer may have somewhere between a billion and a trillion bits in storage. Byte. A byte is eight bits on smaller computers, such as your Odyssey(2). A byte can be twelve, sixteen or more bits on larger computers. Chip. Nickname for Integrated Circuit (IC). Cobol. Common Business-Oriented Language. A computer programming language used widely in the business world. Computer System. The computer and all of its related hardware. Your Odyssey(2) system consists of the console, the computer cartridge and your TV -- the video terminal. Control Unit. The internal part of a computer that directs the binary traffic. Core Memory. The internal memory of a computer. Today, this memory consists of Integrated Circuits (IC's). In the old days, the core memory was stored on magnetic cores made from tiny rings of magnetic material strung on a grid of fine wire. Central Processing Unit (CPU). This is the brain of the computer. The CPU of your Odyssey(2) is contained on a microprocessor which can make over 1,000,000 electronic decisions every second. Cursor. A visual indicator on the video display terminal of some computers that signals where a character must be corrected or the position where data should be entered. It is usually a star or an asterisk. Data. Refers to all letters, numbers, symbols and facts which can be processed or used by a computer. External Memory. That memory used by the computer which is not stored within the computer itself. External memory is usually stored on cassette tape, floppy or hard disk, or paper tape. Firmware. A combination of hardware and software. This term is generally used in reference to software stored permanently on Read Only Memory chips (ROM). Floppy Disk. It's thin, flexible and looks like a square record -- a storage device that typically holds more than 250,000 eight bit bytes of information. Fortran. FORmula TRANslator. The most widely used scientific computer programming language. Hardware. The physical devices that form a computer system -- including all mechanical, magnetic, electronic, electromechanical and electric components. "Software" contains the instructions that tell all this what to do. High-Level Language. Software that makes it possible to program a computer in more or less plain English. Basic, Cobol and Fortran are all examples. Input. The data entered into computers. Integrated Circuit (IC). Many hundreds of electronic circuits on a single chip of silicon. This circuitry can be contained in less than a quarter inch square and can make more than one million electronic decisions per second. There are no moving parts. It is theoretically possible for an integrated circuit to function for thousands of years. Internal Memory. Memory located within the computer itself. Interface. Refers to the connection of one computer component to another. When your TV is connected to your Odyssey(2), it is interfaced. Machine Language (Binary). The instructions that a computer actually follows. High-level language instructions in Basic, Cobol and Fortran are broken down into machine language by the computer before they are executed. Maxicomputers. The giant computers used by governments, insurance companies and businesses. Microcomputers. Small computers with Central Processing Units contained on one single integrated circuit called a microprocessor. Microprocessor. An integrated circuit that contains the complete central processing unit for a computer. Today, microprocessors are designed by computer technology on a much larger than life scale. Then, the circuits are transferred photographically to a chip of silicon less than one quarter of an inch square. Nonvolatile Memory. That part of a computer's memory that is not lost when the computer is turned off. Output. Information that comes out of a computer and is displayed on a screen (as with Odyssey(2)) or on a tape, floppy disc, print out, etc. Programmable Read Only Memory (PROM). The nonvolatile memory stored on an integrated circuit from which the computer can read information. The computer cannot store information on a PROM. The PROM is programmable because the information stored on it can be changed one or more times depending on the type of PROM. Read Only Memory (ROM). Permanent, nonvolatile memory stored on an integrated circuit (IC). The computer cannot store information on a ROM but can read the information on it whenever necessary. The ROM is not re-programmable and the information on it cannot be modified or changed. Random Access Memory (RAM). This is the volatile memory of a computer which is stored on integrated circuits. The computer can read the data stored on the chips -- and new data can be entered onto the chips. This information disappears when the current is turned off. Think of the ROM as the computer's dictionary and encyclopedia and the RAM as the computer's scratch pad. One is printed and kept forever. The other is used as a worksheet and thrown away. Software. All of the instructions used by the computer to perform its functions. This includes languages, operating systems and programs. INSTRUCTION SETS Instruction Hex Code Assembler Code Byte Input Input to Register 7R INP.R 1 Input to Accumulator 04 INA 1 Output Output from Register CR OUT.R 1 Output from Accum. 0B OTA 1 One second Buzz 05 SIG 1 Change Accumulator Contents Set to 0 01 CLR 1 Subtract 1 02 DEC 1 Add 1 03 INC 1 Load with Random No. 08 RND 1 Load from Prog. Step 09 MOV 1 Combine 2 digits 8R PAK.R 1 Separate 2 digits BR UNP.R 1 Load from Register 9R LDA.R 1 Subtract from Register DR SUB.R 1 Add Register ER ADD.R 1 Change Register Contents Store Accumulator AR STO.R 1 Load A Value 6RNN LDV.R.NN 2 Control Execution Order No Operation 00 NOP 1 Halt FF HLT 1 Go to Subroutine 14NN GTS.NN 2 Return from Subr. 07 RET 1 Branching Decision Branch on Decimal Borrow 10NN BDB.NN 2 Branch on Decimal Carry 11NN BDC.NN 2 Branch Unconditionally 12NN GTO.NN 2 Branch if Accum. is 0 13NN BRZ.NN 2 Branch if Reg. not = Accum. 2RNN BVN.R.NN 2 Branch if Reg. = Accum. 3RNN BEQ.R.NN 2 Branch if Reg. > Accum. 4RNN BGT.R.NN 2 Branch if Reg. < Accum. 5RNN BLS.R.NN 2 INSTRUCTION SET FUNCTIONS INP.R: To store a value from the keyboard (symbol or numeral) in a specified register. INA: To input data from the keyboard (symbol or numeral) into the Accumulator. OUT.R: To display the contents of a specified register on the television screen. If you have a series of output instructions, one right after another, you must place a "No Operation" instruction after every third output instruction. OTA: To display data stored in the Accumulator on the television screen. SIG: To implement a one second buzz. CLR: To clear Accumulator and set its contents to 0. DEC: To decrement the contents of the Accumulator by one. INC: To increment the contents of the Accumulator by one. RND: To load Accumulator with a random number from 00 to 99. MOV: To load Accumulator with the contents (two-digit value) contained in the program step specified by Register C. When using the MOV instruction in a program, Register C must remain empty. In other words, you should not program any value in Register C. PAK.R: To combine two digits from two specified registers in the Accumulator. This instruction is used when working with numbers. Since the microprocessor reads the numbers in Binary, we must instruct it to combine two digits in order to produce and display a base 10 number. The first register must always contain a number less than ten. UNP.R: To separate two digits in the Accumulator and store them in two specified Registers. LDA.R: To load the Accumulator with the contents of a specified register. SUB.R: To subtract the contents of the Accumulator from a specified register and store the results in the Accumulator. ADD.R: To add the contents of a specified Register (R) to the Accumulator and to store the result in the Accumulator. If the result is larger than two digits, only the lowest two digits will be kept. STO.R: To store contents of the Accumulator in a specified register. LDV.R.NN: To load a value (NN) into a specified register (R). Registers may be 0 through 9 or A through F. NOP: To implement a delay in execution of the program. Can be used when writing a program to utilize several program steps, so that when checking the program, if an extra instruction step is needed, several will be vacant. HLT: To halt execution of program in order to enter a different operational mode to check registers. Used for trouble-shooting. The halt instruction is entered after your program is entered. Using the Roll Mode, you would enter a halt instruction (FF) in place of an instruction already programmed. After entering the Display mode and checking the registers for errors, you would return to the program step containing FF, clear it, and re-enter the program step you had removed. (See Continue Mode description in the Operating Mode Review.) GTS.NN: To instruct the microprocessor to branch to a specified program step (NN) which contains an operation which you may wish to use several times in one program. This instruction set allows you to use the same operation several times without having to rewrite it. The next sequential step number is saved for returning from the subroutine. (See sample program "Area Problems Using Subroutine and Return.") You must have a "Return from Subroutine" when you have a "Go to Subroutine." RET: To instruct the microprocessor to return to a specified program step. This would be the step immediately following the instruction set "Go to Subroutine." (See sample program "Addition Flash Cards.") You must have a "Go to Subroutine" in order to have a "Return from Subroutine." BDB.NN: To instruct the microprocessor to branch to the specified program step (NN) if the high order bits of the Accumulator equal a (9).* BDC.NN: To instruct the microprocessor to branch to the specified program step (NN) if the high order bits of the Accumulator do not equal a (0).* GTO.NN: To instruct the microprocessor to move to another program step if conditions are satisfied. Most often used in arithmetic problems. (See 1 Digit Division.) BRZ.NN: To instruct the microprocessor to branch to a specified program step (NN) if the Accumulator is 0. (See sample program "Message.") BVN.R.NN: To instruct microprocessor to branch to a specified program step (NN) if Accum. is not equal to a specified register (R). (See sample program "Message.") BEQ.R.NN: To instruct the microprocessor to branch to a specified program step (NN) if the contents of the Accum. are equal to the contents of the specified register (R). (See sample program "Message.") BGT.R.NN: To instruct the microprocessor to branch to a specified program step (NN) if the specified register (R) is greater than the Accum. BLS.R.NN: To instruct the microprocessor to branch to a specified program step (NN) if the specified register (R) is less than the Accum. (See sample programs "One Digit Multiplication" and "Six Letter Guess.") *The Accumulator contains eight bits of data. The first four are the high order bits and the last four are the low order bits. PROGRAM SHEETS [Blank program recording sheets follow for entering your own programs. Each sheet has columns for: Step, Hex Code, Assembler Code, Byte, Remarks, and Register Use (0-9, A-F).] GATEFOLD This gatefold will provide you with an electronic road map -- please keep it open as you work with your Odyssey(2) computer. BACK COVER IB3389-1 AJ9406 THE ULTIMATE COMPUTER VIDEO GAME SYSTEM...BY MAGNAVOX COMPUTER INTRO! It's not for everyone -- but if you're up to a rewarding mental challenge, here is a fascinating entry point into a complex and highly technical subject. This cartridge turns your Odyssey(2) into a very special kind of computer. It won't balance your checkbook or plot the course of a spaceship to Mars -- but it will give you some idea of how those computers do their work. You will learn how computers "think." You will learn how to enter a program -- the first step in learning how to actually write one. Electronic road maps graphically show you where each byte of data goes -- and what happens to it. Then, you will actually run the program and see the exciting results on your TV. Shut off the power and the old program is automatically erased so you can enter a new one immediately! (c)1979 Magnavox Consumer Electronics Company Odyssey is a trademark of the Magnavox Company