Using the DDS C Compiler with the PRIMER The DDS C compiler is an option that must be purchased separately. When using DDS C for the 8085 on the PRIMER there are a few modifications required after DDS has been installed. A batch file (PRIMERC.BAT) is provided on disk that automatically makes these modifications for you. The modifications are all contained in the file 8085rlp.asm. The batch file replaces this file with one that contains the modifications. The modifications are the starting address for downloaded programs (8200H) and the stack address (0FFD4). The starting address gives you the most run space available and the stack address is the default for the PRIMER. Note that the C compiler requires the upgrade option or the deluxe upgrade option be installed in the PRIMER for both the memory and serial communication aspects. To start the Integrated Development Environment (IDE) change directories to C:\MC CD C:\MC then type C You should now be presented with the option to select a file. Using the cursor keys select... Hello.C and press Enter. You are now in the Editor screen where you can enter programs and make changes. The file 8085.ide which is copied from the disk by the PRIMERC.BAT file contains all of the configuration defaults for DDS. Two of these configurations are COM2 serial port and 9600 baud. If these are incorrect you can change them by pressing... Alt O (that is the key and the O key at the same time). You are now presented with a menu of choices. Make any changes that are required by selecting with the up/down cursor keys and pressing Enter. When you are through, press Esc to return to the Edit screen. The next step is to compile the Hello.C program. This is done by pressing... Alt C (that is the key and the C key at the same time). Use the cursor key to select "Compile" and press Enter. A window appears at the bottom of the screen. If any syntax errors had occured this is where you would be notified of them. You would then fix the errors in your program and recompile until you have 0 errors. Once you have a clean compile an Intel Hex file of the same names is created with a .Hex extension, this is the file which will be downloaded to the PRIMER. To download the Hello.Hex file just created, press Alt T (that is the key and the T key at the same time). Use the cursor key to select "Connect" and press Enter. -------------------------------------------------------------------- (EMOS) If you are using EMOS, on the PRIMER's keypad press Func followed by 0 This places you in the terminal mode. Upon pressing the 0 key, you should see the EMOS menu on your PC's screen. If you do not see the menu then make sure the PRIMER is in FUNC 0 mode, make sure the baud rate and the COM port are correct and try again. You may also try establishing communications with Procomm which is provided on the disk. Once communications have been established press > You should then be prompted for the starting download address, type... 8200 followed by the Enter key. Now press your PC's function key F3 You will be prompted for the Hex file to download, if the file is correct hit Enter. Once the download is complete, provided it was successful, the "-" prompt will return. Now change the PRIMER's starting address by pressing G followed by the Enter key. You will now be prompted for the starting run address, type... 8200 followed by the Enter key. You will now be prompted for a breakpoint address. Since we do not require a breakpoint just press Enter again. The program should now print on your PC's screen Hello World then terminate. To return to the Edit screen just press... Esc -------------------------------------------------------------------- (MOS) If you are using MOS, on the PRIMER's keypad press Func followed by 4 this places you in download mode. Upon pressing the 4 key, you should see "rEC.." on the PRIMER's 7 segment LED displays. Now press your PC's function key... F3 You will be prompted for the Hex file to download. If the file is correct press Enter. Once the download is complete, provided it was successful, the rEC.. is no longer present on the display and has been replaced by Hex numbers. If an error occurred (the display reads "Err.." or the "Rec.." is still present) make sure the baud rate and the COM port are correct and try again. You may also try establishing communications with Procomm which is provided on the disk. Now change the PRIMER's starting address by pressing... Func followed by the key labeled... P.C. Now enter, on the PRIMER's keypad the starting address... 8200 followed by the key on the keypad labeled... ENTER The PRIMER's LED display should now read 8200. To run the program press... Func followed by the key labeled... RUN The program should now print on your PC's screen Hello World then terminate. To return to the Edit screen just press... Esc -------------------------------------------------------------------- (CONTINUED) There are a few other C programs that work with the PRIMER, The first is BJ8085.C this is a simple Black Jack program. This program has been enhanced by EMAC and is far superior to the one that is included with DDS. Another program is DEMO.C which allows you to practice Decimal/Hex to binary conversions, and DEMO2.C which allows you to do Binary to Decimal/Hex conversions. Both of the Demo programs provide a function that allows you to Call MOS services from C. For additional information on these programs consult the source file and vies the comments. The C compiler has a number of options of its own. By pressing... Alt C and selecting "options" you can turn on/off Full ASM Listing which will give you a .lst file (ASM source file with Addresses, Opcodes, and comments) and C-Source Comments that can be very useful for debugging. These options are on by default.