As promised when I released my chip-8
emulator and debugger, I have some old emulators and debuggers to release.
I encountered some unexpected detours, but finally have things ready.
I'm starting with my Microchip PIC emulators (PICEMU), both 12-bit core and 14-bit core. Although they started from common code, they diverged during development and I never completely re-integrated them, and so there are 2 sets of source code.
P12 is the 12-bit core, with a specific configuration to emulate the 12C509A processor. The source and executable are at github.com/datapackrat/Microchip-PIC-12-bit-core
. P12_SRC.ZIP is the source, with documentation and .BAT files to build the project. P12C509A.ZIP is the executable, with documentation and demo files. COMPILER.ZIP is the C compiler (DeSmet C) used to build the project. P12C509A.TXT is the documentation by itself, in case you want to look things over before getting the whole project.
P14 is the 14-bit core, with specific configurations to emulate the 12F675, 16F84A, 16F648A, and 16F877 processors. The source and executables are at github.com/datapackrat/Microchip-PIC-14-bit-core
. P14_SRC.ZIP is the source, with documentation and .BAT files to build the various configurations. P12F675.ZIP, P16F84A.ZIP, P16f648A.ZIP, and P16F877.ZIP are the executables with documentation and demo files. COMPILER.ZIP is the C compiler (DeSmet C) used to build the project. The documentation files for the chip-specific builds are also available.
I also wrote a disassembler, PICDIS, for both the 12-bit and 14-bit cores as a single program, available at github.com/datapackrat/Microchip-PIC-disassembler
. PDSRC05.ZIP is the source, PICDIS05.ZIP is the executable, and COMPILER.ZIP is the C compiler (DeSmet) used to build the project.
Remember, these are DOS programs. To run them under modern Windows releases, you need to use DOSBOX. I suggest the DOSBOX-STAGING fork from dosbox-staging.github.io
for reasons I will describe below.
There is a file called DOSBOX.README.TXT in all the source and executable downloads that describes how to setup DOSBOX for best performance.
The various versions of PICEMU will note the available video modes and use the "Best Available" video (this can be over-ridden). The preferred UI uses 132 x 50 text mode (VESA), but will fall back to 80 x 50 text mode (VGA) and 80 x 25 text (standard video). It turns out that the standard DOSBOX program from DOSBOX.COM
does not support 132 x 50 VESA text, but the DOSBOX-STAGING fork does.
I also found a bug in both DOSBOX and DOSBOX-STAGING that broke the gets() function in PICDIS. I've coded a replacement that works, hopefully a later release will fix the bug.
A note about the PALIGN program in the PICEMU source files -- when I wrote PICEMU, I needed to squeeze all the speed possible from the programs. This means aligning code and data on 32-bit (4 byte) boundaries as much as possible. So various #IFDEF blocks were put in the source code to place NOPs and dummy data bytes to align code and data as much as possible. The PALIGN program looked at the link map and optionally the speed of executing a known task to determine which #IFDEF blocks were needed for optimal alignment.
However, with the processors available in 2020, PALIGN isn't needed anymore. With "core=dynamic" in the configuration for DOSBOX, a reasonable processor (I'm using a i7-4770) runs PICEMU faster then an actual PIC processor. Rather than play around with removing the #IFDEF blocks and PALIGN and risk breaking something, I decided to leave them alone.