Documentation for dis96

Dis96 is an interactive disassembler for the Intel 8096 microcontroller. 
This type of microcontroller was used in the S-50 and S-330/S-550 series
of Roland samplers and that was the main reason for me to write this
program.

Installation
------------

Under linux simply create a directory for example dis96 and change to this
directory. Untar the archive with
  tar xzf dis96.tar.gz
and do 
  make install
This will install dis96 in $HOME/bin. If you prefer another directory, e.g.
/usr/local just do
  make INSTDIR=/usr/local install

with 
  make dist
you can create a tar containing Makefile, source and header files and this 
readme.

Usage
-----

dis96 <binfile> [offset]

will start dis96 and load <binfile>. If an hexadecimal offset is given then
<binfile> will be loaded at this offset. The default offset is 0.
A maximum of 64KB will be loaded as this is the maxumum address space of
the 8096. An internal variable will be set to the highest address.
Any command with an address above this value will be ignored.
If an offset is given then all bytes up to this address are set to 0.

Commands
--------

Any command starts with a single character and up to 2 parameters. With
the command 'h' you can get a short help as follows.

dis96 v. 1.05 (Jan  6 2003) (c) 1998-2003 P. Heitzer
Available commands are: 
 h: this help
 [n] d [addr] : dump next 16*n bytes as DB ..
 [n] l [addr] : disassemble next n instructions
 [n] x [addr] : dump next 16*n bytes as hex digits
 c addr {i|b} : set list control for address addr to i(nstruction) or b(yte)
 = addr name : assign addr symbolic name
 . byte name : assign SFR byte symbolic name
 r filename : read control table from file
 s filename : save control table to file
 q : quit
 at start n defaults to 10

Most commands should be self explaining. An empty line, i.e. if only return
was pressed repeats the last dump or disassemble command starting from the
current address.

List control
------------

List control allows disassembly of memory areas that contain a mixture of
code and data. If the disassemble command 'L' finds an address with list
control set to 'B' it switches to hexadecimal dump format. On the other
case if list control for an address is set to 'I' (Instruction) then
normal disassembly format is used until an address with list control set
to 'B' is found. 

Symbols and SFR names
---------------------

16 bit addresses can be assigned symbolic names. For example the reset address
of the 8096 is 2080h. After the command
= 2080 reset
any address with the value 2080h will be listed as the name 'reset' and
any command with an address value of 'reset' will be applied to address
2080h. Any address can only have one symbolic name. If an address that already
was assigned a symbol then its name will be overwritten. 
A maximum of 1024 symbols can be defined. This should be sufficient for
most cases. If you wish you can change the number in symdef.h an do a
make.
Additionally any of the 8096 256 registers in the register file can be given
a symbolic name. Some of the locations 0..1f called SFR (special function
registers) have already assigned a name at compile time. 

loc		name
02 		AD_PORT
04 		HSI_TIME
06 		HSI_STAT
07 		SBUF
08 		INT_MASK
09 		INT_PEND
0a 		TIMER1
0c 		TIMER2
0e 		PORT0
0f 		PORT1
10 		PORT2
11 		SP_STAT
18 		SP

You are however free to change this definitions with the '.' command.

The list control and synbol and SFR definitions can be saved to a file
with the 's' command and loaded with the 'r' command.

Bugs and unwanted features
--------------------------

List control only changes its mode if set for the current address within
a disassemble command. If you use
c 0 b
c 7 i
and do a 'l 0' then list control wont change because it is only checked 
any 16 bytes if in dump mode.

Have fun!

2003-01-07 PH.

