| 1 | <!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01//EN"> |
| 2 | |
| 3 | <html> |
| 4 | <head> |
| 5 | <title> Pep/8: Writing Programs Documentation </title> |
| 6 | <style type="text/css" media="all"> |
| 7 | img { vertical-align:text-top; } |
| 8 | code { font-family:Courier, 'Courier New', monospace; font-size:11pt } |
| 9 | </style> |
| 10 | </head> |
| 11 | <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#000033" alink="#29316B"> |
| 12 | <table bgcolor="#FB9F14" width="100%" cellpadding="2" cellspacing="0" border="0"> |
| 13 | <tr><td> |
| 14 | <p style="text-align:center; font-family:helvetica, arial, sans-serif; font-size:14pt; font-weight:bold; color: #29315E"> |
| 15 | Writing Programs |
| 16 | </p> |
| 17 | </td></tr> |
| 18 | </table> |
| 19 | <p> |
| 20 | Pep/8 is a virtual machine for writing machine language and assembly language programs. |
| 21 | It is designed to be used with the textbook, <i>Computer Systems</i>, J. Stanley Warford, Fourth edition, Jones and Bartlett, Publishers, 2010. |
| 22 | The goal of the book is to teach the fundamentals of the classic von Neumann machine. |
| 23 | You should use the Pep/8 system in conjunction with the textbook to write machine language and assembly language programs. |
| 24 | <p> |
| 25 | <a name = "Topics">Topics:</a> |
| 26 | <a href="#Viewing">Viewing panels</a>, |
| 27 | <a href="#Input">Input and output</a>, |
| 28 | <a href="#Endless">Endless loops</a>, |
| 29 | <a href="#File">File extensions</a>. |
| 30 | |
| 31 | <h3><a name="Viewing">Viewing panels</a></h3> |
| 32 | |
| 33 | The Pep/8 system has three panels — the code panel, the CPU panel, and the memory dump panel. |
| 34 | You can change which of these panels is visible by making the appropriate selection from the View menu or clicking the corresponding |
| 35 | icon on the tool bar. |
| 36 | <p> |
| 37 | <img src="qrc:/help/images/codecpumemory.png" alt="codecpumemory" hspace=10 vspace=10> |
| 38 | <img src="qrc:/help/images/viewicon.png" alt="viewicon" hspace=10 vspace=10> |
| 39 | <p> |
| 40 | When you click in one of the panes inside a panel it becomes the active pane, which is indicated by the blue color |
| 41 | of its label at the top of the pane. |
| 42 | If you double click on the label the pane will expand to its maximum height. |
| 43 | The following screenshot shows the label at the top of the Source Code pane in the code panel. |
| 44 | <p> |
| 45 | <img src="qrc:/help/images/sourcecode.png" alt="viewicon" hspace=10 vspace=10> |
| 46 | <p> |
| 47 | <a href="#Topics">Scroll to topics</a>. |
| 48 | |
| 49 | <h3><a name="Input">Input and output</a></h3> |
| 50 | |
| 51 | The top part of the CPU panel shows the content of the Pep/8 central processing unit. |
| 52 | The bottom part of the panel shows the input and output of your machine language or assembly language program. |
| 53 | The Pep/8 system supports both batch and interactive I/O, which you can select by clicking the appropriate tab. |
| 54 | <p> |
| 55 | <img src="qrc:/help/images/iotab.png" alt="iotab" hspace=10 vspace=10> |
| 56 | <p> |
| 57 | When you execute in batch mode, you must enter the input in the Input pane before you run your program. |
| 58 | The output will appear in the Output pane as the program executes. |
| 59 | <p> |
| 60 | Your program executes in interactive mode when you select the Terminal I/O tab. |
| 61 | In this mode, executing an input statement in your program will make the program pause and wait |
| 62 | for you to enter the input in the Input/Output pane. |
| 63 | The executing program accepts your input and continues executing when you press the enter or return key. |
| 64 | <p> |
| 65 | <a href="#Topics">Scroll to topics</a>. |
| 66 | |
| 67 | <h3><a name="Endless">Endless loops</a></h3> |
| 68 | |
| 69 | If you execute a program with an endless loop, you can interrupt it by pressing <command>+<code>.</code> on a |
| 70 | Mac or <control>+<code>.</code> on a Windows computer. |
| 71 | Or, you can select Build->Interrupt Execution from the menu. |
| 72 | Either of these actions will pause execution of the program, allow you to use the debugging tools, |
| 73 | and, if you wish, continue execution of your program. |
| 74 | <p> |
| 75 | <img src="qrc:/help/images/interruptexecution.png" alt="interruptexecution" hspace=10 vspace=10> |
| 76 | <p> |
| 77 | Alternatively, you can terminate execution of your program by selecting Build->Stop Debugging from the menu |
| 78 | or clicking the Stop icon in the tool bar. |
| 79 | <p> |
| 80 | <img src="qrc:/help/images/stopdebugging.png" alt="stopdebugging" hspace=10 vspace=10> |
| 81 | <img src="qrc:/help/images/stopdebuggingicon.png" alt="stopdebuggingicon" hspace=10 vspace=10> |
| 82 | <p> |
| 83 | <a href="#Topics">Scroll to topics</a>. |
| 84 | |
| 85 | <h3><a name="File">File extensions</a></h3> |
| 86 | |
| 87 | The Pep/8 system uses the following file extensions: |
| 88 | <p> |
| 89 | <code>.pep</code> is the file extension for source code programs.<br> |
| 90 | <code>.pepo</code> is the file extension for object code programs.<br> |
| 91 | <code>.pepl</code> is the file extension for the formatted program listing. |
| 92 | <p> |
| 93 | All these files are text files that you can modify with your favorite text editor or word processor outside the Pep/8 application. |
| 94 | When you open a <code>.pep</code> file, it opens in the Source Code pane. |
| 95 | When you open a <code>.pepo</code> file, it opens in the Object Code pane. |
| 96 | Although you can save a <code>.pepl</code> file, there is no facility for inputting it into the Pep/8 application. |
| 97 | <p> |
| 98 | <a href="#Topics">Scroll to topics</a>. |
| 99 | <p> |
| 100 | </body> |
| 101 | </html> |