IN
LOAD
MP
RUN
7
6
5
4
3
2
1
0
You are experiencing the COSMAC Elf-ish CDP1802 Simulator
(a web app in JavaScript) — aka: SimElf++ / COSMAC Elf2.
This web application is an online implementation of a CRAV (Classic / Retro / Antique / Vintage) microcomputer system known as the COSMAC Elf. It was offered as a DIY build-it-yourself article in the August / September 1976 issues of Popular Electronics magazine, with enhancement articles later. It uses the CDP1802 microprocessor, which is simulated here, along with memory and other hardware items like switches and LED displays. The current interface is one that looks like the original build of the hardware.
At this point, the 1802 simulation is not 100%, in that some aspects have not been implemented. Interrupts, DMA In, and DMA Out are not supported. Therefore, the 00 hex IDL opcode is used as a breakpoint command. And 78h SAV and 79h MARK are not implemented, either, and generate Javascript Alert dialog boxes. The "undefined" 68h opcode is treated like a NOP (no operation -- it just increments the PC to the next memory address)
This web application runs in most popular web browsers. I suggest you use Pale Moon or Firefox, which are the development browsers, so it will always work correctly using them. (currently version PM 23.6.2 and Ffx 47.01 — www.palemoon.org & www.getfirefox.com) Cross-browser development is attempted, but your mileage may vary. (especially Internet Explorer; but it seems to run in Opera (12.17) and Chrome (51.0)) The most recent version of any web browser should be used to insure that compatibility is achieved. It runs online, so there is no need to download anything. A ZIP archive of the project will be available for download at some point so you can run it locally on your computer without the need to be connected to the Internet, although it works better locally in some browsers than others. (Note that you will have to be cognizant that updates, enhancements and bug fixes would need to be re-downloaded at some point)
Check out my other simulator,
Tolkien
– An 1802 COSMAC Elf-ish Retro-Retro Emulator.
Version 0.9 alpha pre-release written in QB64. (Quick BASIC 64) This offline program
should work on most Windows DOS systems, and will eventually work for Mac and *nix.
Visit us at the CRAV Computing and COSMAC Elf Yahoo Discussion Groups.
The User Interface
The default interface has a panel of switches at the bottom that operate the computer system like the actual physical hardware works, and a photo of an actual board at the top with the discrete electronic components and integrated circuit (IC) chips that make up the computer. Some of these items are clickable, as shown with a red box around them above and explanatory text in yellow.
Switches
The toggle switches toggle up and down, on and off, with each click. See below for an explanation of each switch's function. The momentary pushbutton on the left does not change when pressed. Most clickable items change from the default browser cursor pointer to a hand when hovered over. (note that most items have "hover-quick-help" as well)
Clickable Regions
About... pops up a dialog box that has information about this web application. The image also changes to blue when hovered over with the cursor.
Show CDP1802 Internals (the CDP1802 microprocessor chip) is not yet implemented.
Switch to Enhanced CDP1802 Emulator (the power regulator) is not yet implemented. (this will offer an expansive interface that is different from the default interface)
Virtual Hex Keyboard Entry Mode (the hex LED displays) offers a quick-entry mode for programs by using your keyboard. (as an alternative to the eight data/programming toggle switches) This selection must be double-clicked to activate and select. Each time it toggles between three modes (four if you count 'off / back to default'), and there is a pop-up dialog box that informs you of what mode you are in. You must press the OK button on the dialog box to dismiss it and begin entry. Note that you must be in LOAD mode for this feature to work. (see below) All entered values are shown in the browser status bar as: "Address HHHH : HH". You may exit Virtual Hex Keyboard Entry Mode by pressing the ESCape key.
(Note: for the Firefox browser (which we suggest you use, and for which this web app was created), and possibly for other browsers with similar features, you must disable the "Search for text when I start typing" option to enter values using your keyboard — in Firefox 9, this option can be found via main menu item Tools | Options, upper tab Advanced, sub-tab General)
• Auto-enter after every two hex digits is for quick-entry. This allow you to enter continual two-digit hex values (0-9 and A-F (capital or lowercase)), performing an auto-IN after each sequence. The hex digits are shown in the LED display. When you press the first digit, the left LED display is blank / off. If you enter the first digit in error, you may press the BACKSPACE key to delete it. There is no edit mode for the next digit in 'quick entry mode'. All other keys are ignored.
• Must press ENTER to input hex value mode works similarly to the first mode, except, as you press hex digits, they cycle through the display. To enter the value shown, press the ENTER key. If no hex digit is entered for the first / left digit, or both digits are blank, the entry is ignored. You may also use the BACKSPACE key, but it will not only delete the last digit entered, but shift the previous digit right.
• Must press ENTER or SPACE to input hex value mode works similarly to the previous mode, except you may also press the SPACE key to enter the value.
• Hex entry mode is off notifies you that hex entry mode is now off and you are back to the default mode. You must then use the eight data/programming toggle switches to enter values. During any of the Hex Entry Modes, you may press the IN button to enter values using the toggle switches.
Memory Dump, DisAssembler, Program Load & Debug (the memory chips) opens up a window that offers an additional extended interface that allows many features for loading, viewing, and listing memory values and disassembled mnemonic instructions, loading some 'pre-installed' programs, some simple debugging, and some other features and functionality.
... more help text to come ...
Following is what I sent someone as "quick help" when they couldn't figure it out. I will update this and make it better. I thought it was mostly fairly evident, but I guess not.
I haven't added a file open dialog yet, so you have top copy and paste the hex data plain text into the text box.
Then you click the Load From Text Buffer button, but first you choose one of the formats below that: Hex, Intel, Decimal and 'Load Program'. The last two are not used much.
This loads the hex data into the 64K memory.
I'm in the process of updating the way it all works and I can't remember what the old system did versus my new changes that I haven't published yet.
Then you can use the Dump Memory button to output hex to the text box, where you have to copy and paste to wherever you want. (your file)
When you load memory, it sets the Start, End, and Bytes values. But you can set those to whatever you want.
Or you can use the DisAssemble button to disassemble the program into opcode mnemonics. (if there's program code and data, you have to copy and paste the different output formats as needed -- there is no DB type "opcodes" in this version)
And you can use the No Address, Compress SP, ASCII, 2-Byte Addr, and Binary checkboxes to change some of the ways the 'hex' dump and disassembly is formatted for input and (mostly) output.
Project / Webpage Technical Data, Information, Status, Credits, &tc.
Enhanced web application by William Donnelly circa May 2011-2016+ http://www.donnelly-house.net/ -- whd1802 (at) donnelly-house.net http://www.donnelly-house.net/programming/cdp1802/ See Change Log: changelog.txt This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Based on program/system by Maciej Szyc 2005-2006, cosmac'at'szyc.org http://www.cosmac.szyc.org/ (modified and updated 'with his blessing' -- thank you) Archived at: http://www.donnelly-house.net/programming/cdp1802/simelf/original/ (note that this original program has severe bugs -- he never debugged it completely) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. http://www.gnu.org/