Elektronika MK-85 emulator
The program emulates a PDP-11 compatible CPU and uses a ROM dump from the original calculator.
Therefore it should function almost exactly like the real one, inclusive all undocumented features, quirks and bugs and the machine code programming ability.
It works on PC-compatible machines with Microsoft Windows operating system.
Program version 49, updated 2019/09/07
mk85emsr.zip - Delphi sources
mk85emex.zip - compiled executable
Usage: extract the files into an empty directory, then run the program mk85m.exe
mk85emsl.zip - Lazarus port
- On entry, the starting address matches the Program Counter.
It can be modified by clicking on the address in the first line.
Accepted values: $0000..$7FFE for the ROM area and $8000..$7FFE+RamSize for the RAM area.
New value must be confirmed with Enter.
- After clicking on a disassembled instruction, a new instruction can be typed.
As with the starting address, pressing Enter accepts the changes.
Only changes in the RAM area will be saved upon program termination, all ROM modifications will be lost.
Binary Editor box
- The binary editor box allows viewing/changing the RAM contents only.
- It is possible to modify the starting address and the RAM contents by clicking on them.
Enter accepts the changes.
- The contents of the registers can be modified by clicking on them.
Enter accepts the changes.
- The bottom line in the register box shows bits TNZVC of the PSW register.
Program execution control
- Closing the debugger windows resumes the program execution without tracing.
- Pressing the button [Run] in the Single step group box executes a single machine code instruction.
- To execute a specified number of machine code instructions type the required value to the field in the Number of steps group box, then press the associated [Run] button.
Please note that entering the debugger when the calculator is idle usually hits PC=$014A, where the clock is stopped and the processor waits for an interrupt from the keyboard.
Single stepping from this state doesn't have any effect.
- The Breakpoint group box allows to specify condition that determine when the program execution should be interrupted.
Currently it only compares the Breakpoint Address typed in the field with the Program Counter.
When they match, the program execution is stopped and the debugger window reappears.
Some parameters of the emulator can be customised by editing the mk85m.ini file with any text editor.
Description of the contents of this file:
- This setting controls the emulated CPU execution speed (number of instructions executed every 10ms).
- This setting defines the physical size of emulated RAM.
Typical values are 2048 for the MK85 with 2kB of RAM, and 6144 for the MK85M with 6kB of RAM.
After any change, the file ram.bin needs to be deleted (to avoid the warning message about reading past the EOF) and the memory initialisation with the F8 key or the TEST command is required.
- This setting changes the base of the numeral system used by the debugger (16 for the hexadecimal system, 8 for the octal system).
To uninstall the emulator, simply delete the directory where it was installed.
The program doesn't modify anything outside its installation directory.
mk85emut.zip - file size: 31kB, sources and executables, DOS and Windows (in a DOS window)
This utility converts a list of BASIC programs in ASCII format to the MK-85 memory image.
bas2ram.com program1.bas [program2.bas program3.bas ...]
- The utility creates an output file RAM.BIN which can be used by the emulator.
If the output code fits into 2kB then it corresponds to the MK-85 memory organisation, otherwise the MK-85M with 6kB of RAM is assumed as target device.
- Cyrillic characters are expected to be encoded in the Windows-1251 character set.
- Relational operators <>, <= and >= are converted to equivalent MK-85 codes 0x5C, 0x5F,
Forms ><, =< and => are accepted as well.
- Numerical constants in exponential form can be noted as 1.23E5 or 5.67E-8, the E and E- strings are replaced with equivalent MK-85 codes 0x7B and 0x7D.
- String PI is converted to the MK-85 code 0x7C.
This utility does the opposite to the previous one, i.e. displays BASIC programs from the RAM image file specified in the command line.
- Cyrillic characters are encoded in the Windows-1251 character set.
- The output can be redirected to a file or a printer.
Function similar to the previous one, but displays the list of variables instead of programs.