flexemu - an MC6809 emulator running FLEX


SYNOPSIS

On Linux

flexemu [-i] [-h] [-f path] [-p path] [-c color] [-0 path] [-1 path] [-2 path] [-3 path] [-t] [-r <two_hex_digits>] [-v] [-u] [-j screen_factor] [-C startup_command] [-O cccc]

On Windows

flexemu [-i] [-h] [-f path] [-p path] [-c color] [-0 path] [-1 path] [-2 path] [-3 path] [-v] [-u] [-j screen_factor] [-C startup_command] [-O cccc]

DESCRIPTION

flexemu emulates a MC6809 microprocessor system running FLEX Operating System. Additional hardware modules as for ex. two MC6821 parallel input/output ports, a floppy disk controller WD1793, a MC146818 real time clock and a special video screen interface completely emulate the hardware of an Eurocom II/V5 or an Eurocom II/V7 computer. It was developed by ELTEC Elektronik and mainly distributed in Germany in the 1980ies.

flexemu supports the following features:

OPTIONS

In general there are command line options and preferences editable in the flexemu preferences dialog. Command line options supersede preferences and makes the corresponding preferences together with its dependent preferences read-only.

Command line options on Linux and Windows

-f <hexfile>
Specifies the name of a program read during startup, usually a system monitor. Intel Hex, Motorola S-record and FLEX binary file format is supported. The default is neumon54.hex The file will be looked for in the working directory or in the directory specified as -p option or as Disk/Monitor directory. Flexemu can be used with other monitor programs as long as they support the special hardware needs of the Eurocom II/V7.
-c <color>
Specifies the foreground color. The default is green. The background color is always black.
-i
Inverse video display (foreground and background colors exchanged).
-p <path>
Specifies a path in which disk image files or virtual disks (directory disks) will be looked for.
Defaults:
-0|1|2|3 <path>
Specifies a disk image file or a directory path for drive 0, 1, 2 or 3. The default is system.dsk for drive 0. The file or directory will be looked for in the actual directory. If nothing is found the directory specified with the -p option used for Disk/Monitor files will be looked for.
-j <screen_factor>
Specifies a factor to multiply the size of the flexemu video display. Default is 2. Valid values are 1, 2, 3, 4 and 5. It depends on the host screen size where flexemu is executed which screen_factor is supported.
-u
Enables the support of undocumented MC6809 Instructions. See Chapter Undocumented Instructions for details.
-C <startup_command>
When starting flexemu a startup command can be specified. Multiple commands can be separated by the FLEX end-of-line character, which by default is a colon. The emulator will be exited when specifying exit as the last command. Example: "list 0.termcon.txt:dir 0:exit" will print the file contents of 0.termcon.txt, make a directory listing of drive #0 and immediately exits the emulator. The startup command accepts a maximum of 128 characters.
-m
Use 2 x 288 KByte RAM extension. Only for Eurocom II/V7.
-F <frequency>
Set frequency value in MHz. 0.0 runs CPU with maximum frequency. -1.0 runs CPU with the original hardware frequency which is the default.
-n <number_of_colors>
Number of shades or colors. Default is 2. Valid values are 2, 8 and 64.
-O <cccc>
Support formatting disk in drive 0..3 (Overwrite format). This option enables or disables the write track command on the floppy disk controller. c represents drive 0..3 in this order. All drives have to be specified. Only disk image files (not virtual disk images) support formatting a disk. Supported values:

Only disk image files which do not have a valid file format are allowed to be formatted this way.
Example: -O 001-
Drive 2 allows format, drive 0 and 1 not, drive 3 is kept unchanged.

-h
Print a command line parameter description and exit.
-v
Print version number and exit.

Command line options only on Linux

-t
Terminal only mode. All input/output will be done on the terminal from which flexemu is started. All Escape-Sequences of this terminal can be accessed. Montior program neumnt54.hex is NOT needed for this any more. neumon54.hex can be used for both terminal and GUI mode.
-r <two_hex_digits>
Define a reset key for terminal mode specified as two hex digits. The default is 1E, means Ctrl+^.

Flexemu Preferences

In flexemu menu Edit->Preferences opens the preferences dialog. The following preferences can be modified.

Name Description Eurocom II Default
V5 V7
Emulated Hardware
Emulated hardware flexemu can either emulate an Eurocom II/V5 or Eurocom II/V7. Eurocom II/V7
CPU frequency The CPU frequency can be set to:
  • The original frequency of the emulated hardware, which is 1.3396 MHz.
  • To be emulated as fast as possible.
  • Set to a static frequency in the range of 0.1 ... 10000 MHz.
Original frequency
MC146818 Realtime Clock Optionally emulate a MC146818 real time clock, which is a hardware extension. - Emulate realtime clock
User Interface
Screen size The screen size can be set to default, double, triple, quadruple or quintuple size. Double size (1024x512 pixel)
Number of shades or colors Depending on the available RAM extension 2, 8 or 64 shades can be supported. Only if a RAM extension is selected, 8 or 64 shades are available. 2/8/64
/-/-
2/8/64
//
2
Monochromatic color A monochromatic color like green or orange can be selected. green
Multi color scheme Displaying multiple colors (not only shades of a monochromatic color). Only if 8 or 64 shades are selected. - off
Display Inverse Display video normal or inverse. - off
Memory
RAM extension
-
-


2 x 96 KByte
Files and Directories
Disk/Monitor directory A Directory Path containing FLEX disk images and monitor program. Windows: <INSTDIR>\data
Linux: /usr/share/flexemu
Monitor program A Filename or Directory Path for the monitor program. neumon54.hex
Disk Drive 0 A filename or directory Path for disk drive 0. - system.dsk
Disk Drive 1 A filename or directory path for disk drive 1. - Not set
Disk Drive 2 A filename or directory path for disk drive 2. - Not set
Disk Drive 3 A filename or directory path for disk drive 3. - Not set
Cassette Drive 0 A filename for cassette drive 0. - system.mdcr
Cassette Drive 1 A filename for cassette drive 1. - Not set
Terminal (Linux only)
Ignore output of NUL (0x00) characters In terminal mode the output of NUL characters can be ignored. Their initial usage to wait until the teleprinter returns to the first printing position is not needed any more. There are terminals which incorrectly display it as a space. For details see: Wikipedia Null character. Some terminals also use NUL characters in escape sequences. on
Ignore output of ESC (0x1B) characters In terminal mode the output of ESC characters can be ignored. This option has to be switched off, to send escape sequences to the terminal. When doing this it is recommended to change TTYESC to a different character than ESC using TTYSET DOS Utility. This can avoid the terminal to stick in an escape sequence. on
Expert Preferences
Undocumented instructions Optionally emulate MC6809 with undocumented instructions. off
More flexible MMU Optionally emulate a more flexible MMU. Only if 2 x 288 KByte RAM extension is selected. - off
Enable formatting disk in drive 0 - off
Enable formatting disk in drive 1 - off
Enable formatting disk in drive 2 - off
Enable formatting disk in drive 3 - off

[1] When this option is enabled a floppy disk can be formatted from within the emulator. Only disk image files (not virtual disk images) support formatting a disk. When this option is on, the corresponding disk image file can be an empty or non existent file. NEWDISK.CMD distributed on system.dsk for example can be used to format a disk.

Breakpoint support

With the menu CPU->Breakpoints up to two breakpoints can be set. They have to be input as a one to four digit hexadecimal address. Execution automatically stops when the PC register contains one of the breakpoint addresses.

CPU Instruction Logging

With the menu CPU->Logging the logging of each executed CPU instruction can be enabled. The Instruction Logging Dialog contains the following entry fields. Addresses have to be input as a one to four digit hexadecimal address:

Fieldname Default value Description
Min Address 0000 Only log instructions on an address higher or equal to this address.
Max Address FFFF Only log instructions on an address lower or equal to this address.
Start Address <not set> Start Instruction logging when the value of the PC is equal to the Start Address.
Stop Address <not set> Stop Instruction logging when the value of the PC is equal to the Stop Address.
Log cycle count off Log the number of cycles the CPU executed since the last reset.
Log register values all off Log a combination of CPU register values. The PC address is always logged. Register values are logged before executing the instruction on the current PC address.
Filename <not set> Filename to be used for the instruction logging. Independant of the Start and Stop Address this file remains open as long as Flexemu keeps running until another Filename is set. An empty filename finishes Instruction logging.

CPU Frequency control

With the toggle menu item "CPU->Original Frequency" 1.3396 MHz the CPU frequency can be switched between the maximum possible frequency (depending on the available host CPU performance) and the original CPU frequency which exactly is 1.3396 MHz. With the command emu freq other frequencies can be specified. See FLEX Utilities for details.

KEYBOARD

Eurocom PAT09 keyboard

The Eurocom II/V7 typically was shipped with a PAT09 keyboard:

PAT09 keyboard

PAT09 can emit the whole ASCII character set (hex code 00 .. 7F) together with some additional keys codes (hex code > 7F). flexemu emulates almost all keys available on PAT09 as discribed in the following chapters. Eurocom II/V5 strips off the most significant bit from the keyboard input with the concequence of only supporting the ASCII character set.

Hotkeys

The following table shows the hotkeys available in flexemu.

Hotkey Description
Ctrl+Shift+Q Exit application
Ctrl+1 Set default screen size
Ctrl+2 Set double screen size
Ctrl+3 Set triple screen size
Ctrl+4 Set quadruple screen size
Ctrl+5 Set quintuple screen size
Ctrl+F12 Toggle smooth display
Pause Toggle CPU to stop or run
Shift+Pause Send non maskable interrupt (NMI) to CPU
Shift+Alt+Pause Reset and run CPU

There is also a hotkey for toggling full screen and window mode. It depends on the user interface.

User Interface Hotkeys
Windows F11 or Alt+Enter
macOS Ctrl+Meta+F
KDE F11 or Ctrl+Shift+F
GNOME Ctrl+F11
Others F11

Function keys

All PAT09 function keys F1 up to F19 are emulated as defined in the following table:

PAT09 key Mapped key Emitted hex code
F1 F1 C0
F2 F2 C1
F3 F3 C2
F4 F4 C3
F5 F5 C4
F6 F6 C5
F7 F7 C6
F8 F8 C7
F9 F9 C8
F10 F10 C9
F11 Shift+F1 CA
F12 Shift+F2 CB
F13 Shift+F3 CC
F14 Shift+F4 CD
F15 Shift+F5 CE
F16 Shift+F6 CF
F17 Shift+F7 D0
F18 Shift+F8 D1
F19 Shift+F9 D2

ASCII control characters

All ASCII control characters with hex code 00 up to 1F and 7F can be entered with flexemu:

key combination Control character hex code
Ctrl+@ or Ctrl+` [1] NUL 00
Ctrl+A ... Ctrl+Z SOH ... SUB 01 ... 1A
ESC or Ctrl+[ or Ctrl+{     [1] ESC 1B
Ctrl+\ or Ctrl+| [1] FS 1C
Ctrl+] or Ctrl+} [1] GS 1D
Ctrl+^ or Ctrl+~ [1] RS 1E
Ctrl+_ or Ctrl+Delete [1] US 1F
Delete [2] DEL 7F

[1] Depending on the keyboard layout evtl. also Alt Gr has to be pressed.

[2] Works only for the Delete key located on the main keypad.

Numeric Keypad and Cursor Control

On a standarized keyboard a separate numeric keypad can be used for both entering numbers (Num Lock is switched on) or cursor control characters (Num Lock is switched off). The Eurocom II PAT09 keyboard has both a separate cursor control keypad and numeric keypad:

On flexemu both keypads are emulated using the numeric keypad:

If Num Lock is switched on all keys of the PAT09 numeric keypad are emulated one by one. Depending on the current locale setting the decimal point character can be a comma or period. flexemu always maps this to a period because it is not locale aware.

If Num Lock is switched off the cursor control keys of the PAT09 keyboard are mapped to a standardized keyboard on the numeric keypad. The following hex codes can be generated.

PAT09 key Mapped key Emitted hex code
<key> Shift+<key> Ctrl+<key> Shift+Ctrl+<key>
Thick left arrow Pos1 F1 E1 B1 A1
Down arrow F2 E2 B2 A2
Thick lower right arrow Page Down F3 E3 B3 A3
Left arrow F4 E4 B4 A4
Mode Clear F5 E5 B5 A5
Right arrow F6 E6 B6 A6
Thick upper left arrow Page Up F7 E7 B7 A7
Up arrow F8 E8 B8 A8
Thick right arrow End F9 E9 B9 A9
Left limit Insert     [1] FA EA FA EA
Right limit Delete [2] 91 81 91 81

[1] The Insert key located on the main keypad does not emit any hex code.

[2] The Delete key located on the main keypad emits hex code 7F, Ctrl+Delete key emits key code 1F.

SEE ALSO

Documents on the behalf of the FLEX User Group

BUGS

If a drive can not be logged in no error message will be displayed. If a directory will be logged in as a drive and it has too much files or its filesize all together is too large no error message will be displayed and as much files as possible will be managed. emu commands (See FLEX Utilities for details) only have poor error messages.