UNIX version is under development, 0.1 version is the first one which works.
MCS51 Simulator for DOS: s51.zip
164k
MCS51 Simulator for UNIX: s51-0.2.0.tar.gz
162k (included these pages in doc directory)
Get the ZIP file and unzip it. ZIP file contains three files: s51.exe the executable itself, dpmi16bi.ovl and rtm.exe. Last two files are required because s51.exe is a DOS protected mode program. Put these files in a directory which is in the PATH or keep them together with the s51.exe.
UNIX version
UNIX version is distributed in source.
S51 for DOS has written in Borland Pascal using Turbo Vision to produce menu driven, multiwindow user interface which is very easy to use. The program can be started using following command:
C:\> s51 [input file]
Parameter is optional. If it specified it must be the name of an Intel hex file. Some screenshots of the program and short descriptions of them:
UNIX version
The simulator can be started in the following way:
$ s51 [-hHVvP] [-p prompt] [-t CPU] [-X freq[k|M]] [-c file] [-s file] [files...]
Specified files must be names of Intel hex files. Simulator loads them in specified order into the ROM of the simulated system.
Options:
$ s51 -p "s51> " Software Simulator of MCS51, version 0.0.1 s51>
The simulator can be controlled with a simple monitor program which
uses the command console to read commands and print out results. After
starting the program you see a prompt on the command console and you
can write in commands after the prompt:
$ s51
S51 0.2.0, Copyright (C) 1997 Daniel Drotos, Talker Bt.
S51 comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
> h
l file Load (intel hexa) file
dl,do Download (intel hex) data
g [start [stop]] Go
pc [address] Get/set content of PC
s [step] Step
n [step] Next
bs f|d addr [hit] Set FETCH Breakpoint
bse wi|ri|wx|rx|ws|rs|rc f|d addr [hit]
Set EVENT Breakpoint
bd addr Delete FETCH Breakpoint
bde wi|ri|wx|rx|ws|rs|rc addr
Delete EVENT Breakpoint
ba Delete all breakpoints
bl List Breakpoints
dis [start [offset [lines]]]
Disassemble code
dc [start [stop]] Dump code in disass form
dch [start [stop]] Dump code in hex form
di [start [stop]] Dump Internal RAM
dx [start [stop]] Dump External RAM
dr Dump registers
dp Dump ports
ds [addr...] Dump SFR
db addr... Dump bit
si addr data... Set Internal RAM
sx addr data... Set External RAM
sc addr data... Set code (ROM)
ss addr data... Set SFR area
sb addr data... Set bit
sp port data Set port pins
fi start stop data Fill IRAM area with `data'
fx start stop data Fill XRAM area with `data'
fs start stop data Fill SFR area with `data'
fc start stop data Fill ROM area with `data'
res Reset
wi,Wi string Search for `string' in IRAM (Wi case sensitive)
wx,Wx string Search for `string' in XRAM (Wx case sensitive)
wc,Wc string Search for `string' in ROM (Wc case sensitive)
sopt opt value Set value of option
gopt [opt] Get value of option(s)
q Quit
show c|w Show licensing information
h,? Help about commands
>
In command reference you can find more
information about breakpoints and execution of the simulated program.
This problem is solved in very simple way in UNIX version. If the execution reaches an umarked address, the analyzer is called to analyze the code starting at actual address pointed by the PC. This method is not included into DOS version but this re-analyzation can be requested by pressing Ctrl-F7 at any time.