------------------------ Emulator / PC  EXecution TeST ------------------------

This is a little "quick and dirty" tool I wrote while evaluating some 8086
PC/DOS emulators, to get a feel for how closely they could approximate the
"real time" of my actual PC systems.

To see the command line options which can be used with EPCEXTST, run it with
no arguments: EPCEXTST<enter>

It is NOT a detailed instruction/timing analysis or test - all it does is
provide a feel for "how many instructions" are performed in 1 second.
- The instructions it tests with are very simple... basically just incrementing
  a 32 bit counter (represented as 2 16-bit words) with a few extra test and
  housekeeping instructions "thrown in".
* The -I option adds a few extra Instructions (ADD, SUB, MUL, DIV, SHIFT etc.)
  to the loop.


Something that can be a problem with doing this kind of test of emulators is
that it has to know exactly how much "real time" is passing, and the emulator
in reproducing the various bits of PC hardware which sense time, can lose track
of the passage of time when it gets "bogged down".

To try and help overcome this limitation, I have provided a number of command
line options to control how EPCEXTST detects the passage of time.

------------------------------- READ CAREFULLY -------------------------------

The -Rvalue option reduces how often EPCEXTST check to see if a second has
passed. Normally it does this on every loop - but this often involves I/O
access to hardware, or calls to the operating system - These can be SLOW and
indetereminate which will skew the results -R{value} causes EPCEXTST to check
if a second has elapsed only every {Value} loops. This reduces hardware/OS
dependancy but will cause calculated loop counts to be a multiple of {value}


The type of elapsed second test can also affect the results:


=== COM ports (-1, -2, -3, -4)
The best way to detect the passage of time in an emulation, is if you can use
external "real hardware"(outside the emulation). Some emulators provide access
to real serial (COM) ports on the host.

COM ports take a known amount of time to send a character. EPCEXTST sets up
a COM port to send 10 bit characters at 100 bits per second, meaning every 10
characters sent indicate 1 "real" second.

...Unfortunately there can be some problems...
Often the host system "caches" access to a serial port - this means it can
appear to send characters faster than it actually does. To allieviate this,
EPCEXTST uses a full loopback - the serial port must be "looped back" to
itself so that it can receive the data it sends. EPCEXTST keeps the output
queue "full" and times the characters being received.

	 1   2   3   4   5		 1  2  3  4  5  6  7  8  9 10 11 12 13
       6   7   8   9		  14 15 16 17 18 19 20 21 22 23 24 25
			RXD(2)  \			/  RXD(3)
					 > Connect <
			TXD(3)  /			\  TXD(2)
			RTS(7)  \			/  RTS(4)		   \
					 > Connect <					> These should not be
			CTS(8)  /			\  CTS(5)			> needed by EPCEXTST
			DTR(4)  \			/  DTR(20)			> but would be included
					 > Connect <					> in "proper" loopback
			DSR(6)  /			\  DSR(6)		   /
	Numbers shown are for MALE connector (pins) - on PC
	Reverse for FEMALE connector (holes) - plugs in to PC

To avoid having to spend a lot of time counting characters, EPCEXTST uses
a serial rate of 100 bits/second, so it only has to adjust it's internal
counter 10 times each second.... but 100 baud, while fully possible on a PCs
8250 based serial port, is not common, and some hosts may not provide support
for it.

Also note that the COM port has to be "real" on the host. Virtual loopback or
network connected COM ports etc. may not present accurate transmission time!


=== HardwareRTC (-H)
Available in AT+ PCs, there is a CMOS/RTC chip which contains a real-time
clock. IF an emulator supports it, this is at a low/hardware level and may
take priority when the emulator is "busy".


=== BIOStick (-B)
The PC BIOS maintains "real time" with a 55ms interrupt, which advances a
"tick count" in memory. This is the next lowest way time is tracked.


=== DOS clock (-D)
DOS itself maintains a "time of day" clock (INT 21h, AH=2Ch) which reports the
"current" Hour/Minite/Second


For best EPCEXTST results, you should do some experiments to determine which
clock method works best in your emulator. Durinf the test, EPCEXTST shows each
"tick" by writing a "*" to the screen (this is done by memory access, so it
does not rely on hardware speed) - the default number of seconds the test runs
is 10 - use a stopwatch and see how close displaying the 10 '*'s takes to 10
seconds!

Dave Dunfield   -   https://dunfield.themindfactory.com


---------------------- Here are some of my test results ----------------------
*** Emulators (run on I7 Win7 system) ***
86BOX 8088 4.77Mhz IBMDOS 2.10
      154010/          10=       15401  -BR10
       33180/          10=        3318  -BIR10
86BOX 80286 8Mhz IBMDOS 2.10
      638000/          10=       63800  -BR10
      225280/          10=       22528  -BIR10

MartyPC 8088 4.77mhz IBMDOS 2.10
      134740/          10=       13474  -BR10
       32190/          10=        3219  -BIR10

DosBox (250cycles) IBMDOS 2.10
      111400/          10=       11140  -BR10
       34150/          10=        3415  -BIR10
DosBox (500cycles) IBMDOS 2.10
      223240/          10=       22324  -BR10
       68430/          10=        6843  -BIR10
DosBox (1000cycles) IBMDOS 2.10
      446920/          10=       44692  -BR10
      136990/          10=       13699  -BIR10
DosBox (5000cycles) IBMDOS 2.10
     2235870/          10=      223587  -BR10
      685340/          10=       68534  -BIR10
DosBox (10000cycles) IBMDOS 2.10
     4472610/          10=      447261  -BR10
     1370940/          10=      137094  -BIR10
DosBox (MAXcycles) IBMDOS 2.10
    22366590/          10=     2236659  -BR10
     6855790/          10=      685579  -BIR10
DosBox (MAXcycles) EPCEXTST.COM direct
    30760580/          10=     3076058  -BR10
     7025220/          10=      702522  -BIR10

MS-DOS Player (i8086) EPCEXTST.COM direct
    40816020/          10=     4081602  -BR10
    41168900/          10=     4116890  -BR10

VMwarePlayer7 IBMDOS 2.10
   409328560/          10=    40932856  -BR10
   111373020/          10=    11137302  -BIR10

*** Actual machines ***
PoqetPC 8088 (docs: 2-7mhz NotFoundWayTo Set/Chg) MSDOS 3.3
      202930/          10=       20293  -BR10
       48280/          10=        4828  -BIR10

Pentium200MMX 200mhz MSDOS 5.0
    69088030/          10=     6908803  -BR10
    11582740/          10=     1158274  -BIR10

Pentium3 733mhz MSDOS 5.0
   350053570/          10=    35005357  -BR10
    38318950/          10=     3831895  -BIR10

Pentium4 200mhz MSDOS 5.0
   975968100/          10=    97596810  -BR10
   117228210/          10=    11722821  -BIR10

VIA-C7 1.0ghz MSDOS 5.0
   307728690/          10=    30772869  -BR10
    58412850/          10=     5841285  -BIR10
