
	S86KIT VERSION 2 DOCUMENTS


	1)  README


	1.1 SUMMARY

	S86KIT -- A cross development kit for an 8086 subset.
	Copyright (C) 1997-2000 Nils M Holm. All rights reserved.

	This archive contains all tools which are necessary to build
	native DOS executables from assembly language output generated
	by the T3X compiler using the 86A or 86S backends.

	*** WARNING ***

	While the assemblers may be used as standalone assemblers
	as well, they have been primarily created for assembling
	the output of the T3X compilers which is supposed to be formally
	correct. Hence, only little error checking is peformed by
	the assemblers.

	S86Q, the 'quick' assembler should under no circumstances be
	used by human programmers.


	1.2 FILELIST

	Changes		change log
	LICENSE		conditions of use
	Makefile	Makefile for FreeBSD
	README		this file
	S86KIT.sd	documentation in structured document format
	Todo		todo list
	cvexe.t		X.OUT --> DOS EXE conversion tool
	cvimg.t		X.OUT --> image (DOS COM) conversion tool
	hd.t		hex dump utility
	rmsym.t		remove symbol tables from X.OUT programs
	s86.t		8086 one-pass assembler
	s86b.t		8086 two-pass assembler
	s86q.t		quick version of S86B -- DO NOT USE!
	sdv-config	SDV config file
	sld.t		X.OUT and DOS EXE linker
	snm.t		dump symbol tables of X.OUT and SLD object files
	sz.t		print segment sizes of X.OUT files
	xo.t		examine SLD object files


	1.3 DESCRIPTION

	Thew S86 Kit contains just a set of command line utilities.
	Most of them simply read their input from the standard input
	stream and write their output to the standard output stream.

	To create a DOS EXE file from an S86 source file, the steps
	outlined in the following example are required. $ is the
	command line prompt.

	$ s86 <test.s >test.o
	$ sld
	-t exe
	-o test.exe
	test.o
	-g
	$

	SLD reads linker commands from the standard input, since it
	may have to read multiple input files. See the online
	documentation in the file 'S86KIT.sd' for further details.


	1.4 BUILDING AND INSTALLING THE PROGRAMS

	The S86 Kit can be build on any machine providing a T3X compiler,
	either Release 5 or Release 6. To build the programs, two
	variables in 'Makefile' must be set:

	TXLOCAL	the T3X compiler command used to build native programs
	TXDOS	the T3X compiler command used to build DOS programs

	TXDOS may be left undefined, if only native program shall be
	built.

	Running MAKE(1) should compile all programs.

	To install the programs and documentation files, root permissions
	are required. 'make install' will copy all program files files to
	the directory $(BINDIR) and documentation to $(DOCDIR). BINDIR
	and DOCDIR are defined in Makefile.


	2)  CVEXE -- convert  SLD files to DOS EXE files 


	2.1 USAGE

	CVEXE  <SLD-module  >EXE-file


	2.2 DESCRIPTION

	CVEXE  reads  an SLD-style executable file from the standard
	input  and writes an equivalent DOS EXE file to the standard
	output.   Diagnostic  messages  go  to  the  standard  error
	stream.

	CVEXE  is  now  obsolete  and  kept  only  for compatibility
	reasons. To generate DOS executables, the '-t exe' option of
	the linker SLD should be used instead.


	2.3 TECHNICAL DETAILS

	SLD  and  EXE  format files are both executable file formats
	consisting of three parts:

	o  a header holding information about the program

	o  an image of the program code

	o  an image of the initialized data segment.

	The  two  file  formats  use  different  headers  containing
	different  information. Therefore, the main task of CVEXE is
	to convert the SLD header into an EXE header.

	The  other  difference  between the formats is harder to get
	around.  SLD  modules  expect that the operating system sets
	up  the  segment  registers  before  calling  the executable
	module   while   DOS   leaves  this  task  to  the  program.
	Therefore,  CVEXE  has to insert some code to set up the DS,
	ES,  and SS registers according to the information stored in
	the  SLD header. It inserts the setup code at the end of the
	TEXT segment and adjusts the segment size acordingly.


	2.4 FILES

	    *.exe -- By convention, DOS EXE modules have a .exe suffix.
	    X.OUT -- The default output file of SLD.


	2.5 SEE ALSO

	SLD -- load SLD style object programs.
	CVIMG -- convert image files.

	"The SLD executable file format" (paper)


	2.6 BUGS

	CVEXE  has  been  designed  to convert programs generated by
	the  T3X  compiler.  Therefore, it can convert only programs
	whose  first  instruction  is a direct near call instruction
	(opcode   E8h).  It  redirects  this  call  to  the  segment
	register setup code.

	Any  debug  information  stored  in  the SLD module will get
	lost during the conversion.


	3)  CVIMG -- convert SLD files to pure TEXT image files


	3.1 USAGE

	CVIMG  <SLD-module  >image-file


	3.2 DESCRIPTION

	CVIMG  reads  an SLD-style executable file from the standard
	input  and  writes  an  image  file containing only the TEXT
	segment   of  its  input  module  to  the  standard  output.
	Diagnostic  messages  go  to  the standard error stream. The
	DATA  and  BSS  segment  size of the input file must both be
	zero -- the file must be a pure text file.

	The  output  of  CVIMG is a pure, single-segment, executable
	machine  code  image  without an executable module header or
	any  relocation  information.  For  execution,  it  must  be
	loaded  exactly  at  the  same address is has been loaded at
	(SLD loads modules at location 0).

	Since  T3X  programs always contain some data, no images may
	be created from them.


	3.3 FILES

	X.OUT -- The default output file of SLD.


	3.4 SEE ALSO

	SLD -- load SLD style object programs.
	CVEXE -- convert EXE files.

	"The SLD executable file format" (paper)


	4)  RMSYM -- remove symbol tables from SLD object files


	4.1 USAGE

	RMSYM  <file1  >file2


	4.2 DESCRIPTION

	RMSYM  reads an SLD executable file from the standard input,
	removes  its symbol table, and writes the executable without
	its   symbol   table  to  the  standard  output.  Diagnostic
	messages will be sent to the standard error stream.

	If  RMSYM  is  applied  to  a  file with no symbol table, it
	prints an error message and writes no output file.

	Executable   programs   with   no  symbol  table  are  still
	executable,  but  it  is  no  longer  possible to locate any
	global  objects  inside  of them. Particularly, SNM will not
	be  able  to  extract  any  information from executables not
	containing a symbol table.


	4.3 FILES

	X.OUT -- The default output file of SLD.


	4.4 SEE ALSO

	CVEXE -- convert EXE files.
	SLD -- load SLD object files.
	SNM -- list names in object files.
	SZ -- examine program sizes.
	XO -- examine object files.

	"The SLD executable file format" (paper)


	5)  S86, S86B -- assemblers for an 8086 subset


	5.1 USAGE

	S86 <input-file >output-file
	S86B <input-file >output-file


	5.2 DESCRIPTION

	S86  reads  an  8086 assembly language program in S86 format
	from  the  standard  input  and  writes  an SLD-style object
	program  to  the  standard  output.  Any errors found in the
	input  program  will  be  reported  via  the  standard error
	stream.  S86B  differs  from S86 only in some internals. S86
	is  a  one-pass assembler and processes most of its input in
	core  while  S86B  is a two-pass assembler and works heavily
	on  disk  files.  Therefore, S86 is much faster, but it will
	fail  to  compile programs which will not fit in its memory.
	In such cases, S86B should be used.


	5.3 FORMAT

	S86  accepts  input  programs  in  its  own  format which is
	similar  to the MASM source format. Although, some mnemonics
	and  conventions  are  different.  Generally, statements are
	written in the form

	INSTRUCTION   DESTINATION, SOURCE

	A  semicolon  may  be  used  to  introduce  a  comment which
	extends  up  to the end of the current line. All labels must
	be delimited with a colon -- even in data definitions:

	xyz: dw 0

	The following mnemonics will be accepted by S86:

	aaa  aad  aam  aas  adc add and call cbw clc cld cli cmc cmp
	cmpsb  cmpsw  cseg  cwd  daa  das dec div dseg eseg hlt idiv
	imul  inb  inc int into inw iret ja jae jb jbe jc jcxz je jg
	jge  jl  jle  jmp  jmps  jnc jne jno jnp jns jnz jo jp js jz
	lahf  lock lodsb lodsw loop loopnz loopz mov movsb movsw mul
	neg  nop  not  or  outb outw pop popf push pushf rcl rcr rep
	repnz  repz ret rol ror sahf sal sar sbb scasb scasw shl shr
	sseg stc std sti stosb stosw sub test wait xchg xlat xor

	All  mnemonics must be written in lower case. Otherwise they
	will   not   be   recognized  as  such.  S86  does  not  use
	instruction  prefixes.  Therefore,  instructions  like cseg,
	repz, etc always must be placed in a separate line.

	Operands  may  be prefixed with the modifiers byte, word, or
	offset. Offset computes the address of an object.

	mov   ax,offset obj

	loads  the  address  of obj into the ax register rather then
	the  value stored at location obj. Byte and word are used to
	explicitly   specify   the   size  of  an  operand.  If  not
	specified,  S86  attempts  to  find out the size by checking
	the  registers  involved.  If  no  registers  are  used,  it
	defaults to word size.

	Some  instructions  like  outw,  stosb, etc have an implicit
	operand  size  which  is  denoted  by  the last character in
	their   name.   No   modifiers   may   be  applied  to  such
	instructions.  There is no short modifier in the S86 syntax.
	Instead,  the  jmps  instruction  has  been  added  to allow
	unconditional short branches.

	Numeric  literals may be written in decimal notation with an
	optional  leading  minus  sign  or in hexa-decimal notation.
	Hexa-decimal  numbers  must  be  prefixed with a dollar sign
	($).  ASCII  characters  may  be  written instead of numeric
	values  by  enclosing  them in apostrophes. For example, 'A'
	is the same as 65 or $41.

	Registers  are  written  in  all lower case characters. They
	may  not  be used as symbolic names. The following names are
	reserved for registers.

	16-bit registers: ax, bx, cx, dx, si, di, bp, sp
	8-bit registers: al, bl, cl, dl, ah, bh, ch, dh
	segment registers: cs, ds, es, ss

	The  following  indirect  addressing modes are recognized by
	S86:

	[si], [di], [bx], [bx+si], [bx+di], [bp+si], [bp+di]
	[bp], [bp+disp], [bx+disp], [si+disp], [di+disp]

	where   disp   denotes   either   an   8-bit   or  a  16-bit
	displacement. Displacements also may be negative.


	5.4 COMMANDS

	S86 understands the following pseudo instructions:

	.bss
	Set  the  output  segment  to  BSS,  the  uninitialzed  data
	segment.  All following instructions will be emitted to this
	segment.  Note that only uninitialized data declarations are
	allowed in BSS sections.

	.data
	Set  the  output  segment  to  DATA,  the  initialized  data
	segment.  All  following instructions will be emitted to the
	data segment of the output program.

	.extrn identifier , ...
	Declare  a list of identifiers as external symbols. S86 does
	not   automatically   assume  that  undeclared  symbols  are
	externals.  When an externally defined symbol shall be used,
	it must be declared explicitly using .extrn.

	.globl identifier , ...
	Declare  a list of identifiers as global symbols. .globl may
	be  specified  before  or after the definition of the global
	symbol,  but  the  symbol  must  be  defined within the same
	module.  Only  global symbols will be included in the public
	symbol  table which is exported to the object file generated
	by  S86.  Global  names  will  be  used  to resolve external
	references at load time.

	.text [origin]
	Set  the  output  segment  to  TEXT, the segment holding the
	executable  part  of  the  generated  program. All following
	instructions  will  be  emitted  to  the  TEXT segment. If a
	numeric  value  is  specified for origin, the following code
	will  be  located at address origin. Origin is initially set
	to 0.

	[name:]   db   item , ...
	[name:]   dw   item , ...
	Emit  the  specified  list  of  data  items to the currently
	selected  segment. An item may have one out of the following
	formats:

	Number  --  Numeric literals are included as the values they
	represent.  In  db  instructions,  their range is limited to
	-128...255.

	String  --  A  string is written as a sequence of characters
	enclosed  by  double quotes ("). Each characters is compiled
	literally.  In  dw instructions, each character is placed in
	the low byte of a separate word.

	Offset  --  The  notation offset symbol compiles the address
	of the specified symbol.

	Number  *  Count  --  The  specified number will be compiled
	count  times. Currently, only literal numbers are repeatable
	this way.

	*  Count  --  This  special  form  allocates  count bytes or
	words,  but  does  not  emit anything. Its use is limited to
	the BSS segment.

	name:   equ   value
	Assign  value  to  the  address field of the label name. The
	effect  of  equ  is  to  allow access to the absolute memory
	location  with  the  address  value  through the label name.
	When defining

	there:   equ   1024

	for example, the statement

	mov   al,there

	would load al with the content of memory location ds:1024.


	5.5 FILES

	*.s  -- Assembly language source programs normally have a .s
	suffix.
	*.o -- SLD object files normally have a .o suffix.

	S86B,  the  two-pass  assembler uses the following temporary
	files:
	-- stores the source code for the second pass.
	_DATA -- holds an image of the data segment.
	_TEXT -- holds an image of the text segment.
	_RELOC -- holds an image of the relocation table.


	5.6 BUGS

	Currently,  not  all 8086 addressing modes are recognized by
	the assembler.

	Symbolic  names  beginning  with  an  upper case A or T have
	special  meanings  to S86 and therefore should never be used
	by   programmers.   (They  are  used  to  build  labels  and
	temporary labels when compiling T3X output).


	5.7 SEE ALSO

	CVEXE -- convert EXE files.
	RMSYM -- remove symbol tables.
	SLD -- load SLD style object programs.
	SNM -- list names in object files.
	SZ -- examine program sizes.
	XO -- examine object files.

	"The SLD object file format" (paper)

	For  details  on  8086 programming refer to an 8086 assembly
	language handbook of your choice.


	6)  SLD -- load SLD-style object programs


	6.1 USAGE

	SLD   <commands


	6.2 DESCRIPTION

	SLD  loads  each  SLD  style  object  file  specified  in an
	appropriate  command,  relocates  it,  attempts  to  resolve
	external   references,   and  finally  combines  all  loaded
	objects  into  one  single SLD-style executable file or DOS-
	style EXE file.
	The  loader  reads  a  line from standard input, attempts to
	interpret  the  command  contained  in it, and then succeeds
	with  the next line. It writes informational messages to the
	standard  output, if advised to do so, and error messages to
	the standard error stream.

	6.3 COMMANDS

	-d
	Toggle  debug  mode.  In  debug  mode,  SLD  will print very
	detailed  information  about  what  it  is  currently doing.
	Although,  most  of  this  information is not intended to be
	understood by anyone but its author.

	-g
	Generate  the  executable  file  immediately  and then exit.
	Basically,  this is the same as entering an EOF character on
	the beginning of a fresh command line.

	-h or -?
	Print a terse summary of SLD commands.

	-o file
	Write  the  resulting executable file to file instead of the
	default file, X.OUT.

	-q
	Quit immediately. Do not generate any output.

	-s
	Strip  symbol  information.  Normally,  SLD appends a symbol
	table containing all public symbols to the executable output
	file.  This  option  supresses  the  generation  of a symbol
	table. This is the default for -t exe and -t img.

	-t type
	Specify t he type of the output file.  'Type' may be one out
	of the following:
	'exe' - a DOS-style EXE file.
	'img' - a shared text/data image file.
	'oxy' - an Oxygene executable (default).
	This option must be specified before any object file names.

	-v
	Toggle  verbose  mode.  In  verbose  mode,  SLD will print a
	brief  message  before  executing  each  step.  The names of
	input   modules   will  be  echoed  and  after  writing  the
	executable, a summary of the segment sizes will be given.

	name
	When  only a file name is specified on the command line, SLD
	loads  the  given  file  which  must  be  in SLD object file
	format.  The  file  name may not start with a minus sign (-)
	because  otherwise the second character of the name would be
	taken for a command.


	6.4 FILES

	_LDDATA  -- the temporary file used to hold the data segment
	during load time.
	_LDTEXT  -- the temporary file used to hold the text segment
	during load time.
	X.OUT -- the default output file.
	*.o -- SLD object files normally have a .o suffix.


	6.5 BUGS

	SLD currently cannot handle archive files.


	6.6 SEE ALSO

	CVEXE -- convert EXE files.
	RMSYM -- remove symbol tables.
	S86 -- assemble 8086 programs.
	SNM -- list names in object files.
	SZ -- examine program sizes.
	XO -- examine object files.

	"The SLD object file format" (paper)
	"The SLD executable file format" (paper)


	7)  SNM -- print name lists in SLD object and executable files


	7.1 USAGE

	SNM   <file


	7.2 DESCRIPTION

	SNM  reads  an  SLD style object or executable file from the
	standard  input  and  writes  all  public and external names
	found  in  the  module  to  the  standard output. Diagnostic
	messages  will  be  written to the standard error stream. No
	name  lists  can be extracted from executable files with the
	symbol table removed.


	7.3 FORMAT

	SNM  reports  each  symbol  on  a  separate  line and in the
	following format:

	{P|X}{T|D|B} addr symbolname

	where  P  or  X  denotes  the  type of the symbol (public or
	external),  T,  D, B indicates its class (TEXT, DATA, or BSS
	),   addr  is  the  address  of  the  symbol  written  as  a
	four-digit  hex  number,  and  symbolname is the symbol name
	associated with the given address.


	7.4 FILES

	*.o  --  SLD  object  files  have a .o suffix by convention.
	X.OUT -- the default name of the SLD output file.


	7.5 SEE ALSO

	RMSYM -- remove symbol tables.
	XO -- examine object files.

	"The SLD object file format" (paper)
	"The SLD executable file format" (paper)


	8)  SZ -- print the sizes of SLD executable programs


	8.1 USAGE

	SZ   <file


	8.2 DESCRIPTION

	SZ  reads  the header of an SLD executable from the standard
	input  and  writes  the  size  information  contained in the
	header  to  the  standard  output.  Error  messages  will be
	directed to the standard error stream.

	SZ  will  print the sizes of the TEXT, DATA, and BSS segment
	of  the  specified  program as well as its symbol table size
	and  total  size  (not including the symbol table). A symbol
	table  size  of 0 indicates either that the program does not
	contain  any  public  symbols  or  the symbol table has been
	removed.


	8.3 FILES

	X.OUT -- the default name of the SLD output file.


	8.4 SEE ALSO

	RMSYM -- remove symbol tables.
	SNM -- list names in object files.
	XO -- examine object files.

	"The SLD executable file format" (paper)


	9)  XO -- examine  SLD object files


	9.1 USAGE

	XO   <file


	9.2 DESCRIPTION

	XO  reads  an  SLD-style object file from the standard input
	and  writes  detailed  information  about  that  file to the
	standard  output.  Diagnostic  messages  are directed to the
	standard error stream.


	9.3 FORMAT

	The  output  of  XO  is divided into six sections. The first
	section  describes  the HEADER of the object module. It will
	contain  information  about  the  magic  number,  flags, and
	machine  type  of  the  module as well as the lengths of the
	single  parts  of  the  module. The flags have the following
	meanings.

	Bit   0  -  If  set,  the  module  is  a  pure  text  module
	(containing no BSS or data DATA segments).
	Bit 1 - If set, the module contains a relocation table.

	All other header entries should be self-explanatory.

	The  next  two  sections  contain hexa-decimal and character
	dumps  of  the  TEXT and the initialized DATA segment of the
	module.  In  the  character dump, unprintable characters are
	substituted with underscores (_).

	The  fourth  section  contains  a  dump of the PUBLIC SYMBOL
	TABLE of the module. Each symbol is dumped in the format

	segment address name

	where  segment  is  the  segment in which the symbol name is
	defined  and  address  is the address of the object relative
	to  the  beginning of segment. Segment may be one out of the
	following list.

	T - Text
	D - Data
	B - BSS

	The  EXTERNAL  SYMBOL  TABLE  is dumped in a similar format,
	but  the  address  of  an  external  will  always  be FFFFh,
	because  it  has  to be resolved at load time. Each external
	entry  is  followed  by a mark list containing the addresses
	at  which the external has to be resolved. Each mark has the
	form

	segment address [+]

	where  segment  may be either T or D (see above) and address
	is  the  segment-relative  address where the external symbol
	is  referenced.  A  trailing  plus  sign  indicates that the
	reference  uses  PC-relative addressing rather than absolute
	addressing.  In  8086 programs this usually indicates a jump
	or a procedure call.

	The  last section of the XO output is a dump of the module's
	RELOCATION  TABLE.  Up  to nine entries are dumped per line.
	The format of each entry is

	base dest address

	base  is  the  referencing  segment,  dest is the referenced
	segment,  and  address  is  the  address of the reference in
	base.


	9.4 FILES

	*.o -- SLD object files usually have a .o suffix.


	9.5 SEE ALSO

	RMSYM -- remove symbol tables.
	SLD -- load SLD object files.
	S86 -- assemble 8086 programs.
	SNM -- list names in object files.
	SZ -- examine program sizes.

	"The SLD object file format" (paper)


	10) THE SLD EXECUTABLE FILE FORMAT


	10.1 FILE SECTIONS

	+-------------------------------+
	|       Header                  |
	+-------------------------------+
	|       Text                    |
	+-------------------------------+
	|       Data                    |
	+-------------------------------+
	|       Public Symbols          |
	+-------------------------------+


	10.2 THE HEADER

	All 16-bit values are stored in little endian format
	($1211 = $11, $12)

	 OFFSET   NAME    DESCRIPTION
	+-------------------------------------------------------+
	|    0  | MAGIC | Magic Number ($19720424)              |
	+-------------------------------------------------------+
	|    4  | FLAGS | Flags (see below)                     |
	+-------------------------------------------------------+
	|    6  | LTEXT | Size of the TEXT section              |
	+-------------------------------------------------------+
	|    8  | LDATA | Size of the DATA section              |
	+-------------------------------------------------------+
	|   10  | LBSS  | Size of the BSS segment               |
	+-------------------------------------------------------+
	|   12  | LSYM  | Size of the symbol table              |
	+-------------------------------------------------------+
	| 14-15 | ----- | Reserved                              |
	+-------------------------------------------------------+

	10.2.1 FLAGS

	$0001 = PURE executable. Text, data, and stack share the
		same segment. There is no BSS segment.
		Default = IMPURE.
	$0002 = RELOCATIBLE. All relocation information is
		appended to the file. May be used to locate
		the code at absolute positions or to create
		relocatible PURE executable modules. NYI.


	10.3 THE TEXT SECTION

	This section contains the pure machine code of the
	program. The section is padded with zeroes to a length
	which is a multiple of 16 bytes.


	10.4 THE DATA SECTION

	This section contains a dump of all initialized data used
	by the program. The section is padded with zeroes to a
	length which is a multiple of 16 bytes.


	10.5 THE SYMBOL TABLE

	This is a dump of the PUBLIC symbol table at the end of
	the load time. The dump consists of entries which have
	the following format:

	 OFFSET  NAME     DESCRIPTION
	+-------------------------------------------------------+
	|   0   | LSYM  | Length of the symbol name             |
	+-------------------------------------------------------+
	|   2   | ADDR  | Address of the referenced object      |
	+-------------------------------------------------------+
	|   4   | CLSS  | Class of the object (see below)       |
	+-------------------------------------------------------+
	|   6   | NAME  | The symbol name (LSYM chars)          |
	+-------------------------------------------------------+

	Consequently, the size of each entry is LSYM+6 bytes.

	The class CLSS of a symbol may be either 'T' (TEXT) or
	'D' (DATA).


	11) THE SLD OBJECT FILE FORMAT


	11.1 FILE SECTIONS

	+-------------------------------+
	|       Header                  |
	+-------------------------------+
	|       Text                    |
	+-------------------------------+
	|       Data                    |
	+-------------------------------+
	|       Public Symbols          |
	+-------------------------------+
	|       External Symbols        |
	+-------------------------------+
	|       Relocation Table        |
	+-------------------------------+


	11.2 THE HEADER

	All 16-bit values are stored in little endian format
	($2307 = $07, $23)

	 OFFSET   NAME    DESCRIPTION
	+-------------------------------------------------------+
	|    0  | MAGIC | Magic Number ($19710416)              |
	+-------------------------------------------------------+
	|    4  | FLAGS | Flags (see below)                     |
	+-------------------------------------------------------+
	|    6  | LTEXT | Size of the TEXT section              |
	+-------------------------------------------------------+
	|    8  | LDATA | Size of the DATA section              |
	+-------------------------------------------------------+
	|   10  | LBSS  | Size of the BSS segment               |
	+-------------------------------------------------------+
	|   12  | LPUB  | Size of the PUBLIC section            |
	+-------------------------------------------------------+
	|   14  | LEXT  | Size of the EXTERNAL section          |
	+-------------------------------------------------------+
	|   16  | LRLOC | Size of the RELOCATION table          |
	+-------------------------------------------------------+

	11.2.1 FLAGS

	The first byte in the FLAGS field indicates the machine type
	for which the instructions in the TEXT segment have been
	generated. Currently, these machine types are supported:

	001 - 8086

	The second byte contains a bit pattern where the bits
	2 through 7 are reserved for later extensions. The Least
	significant two bits have the following meanings:

	#1 -    The executable is an 'pure' executable with a
		merged TEXT and DATA segment. Pure executables
		are limited to a total of 64K for code, data,
		and stack space.

	#2 -    The executable is relocatible. This means that the
		relocation tables generated by the assembler are
		concatenated and appended to the executable.
		(Currently, this is never required).


	11.3 THE TEXT SECTION

	This section contains the pure machine code generated by
	the assembler S86/S86B. All references inside the module
	are relative to the beginnings of the TEXT, DATA, or
	BSS segment. An entry in the RELOCATION section exists
	for each reference.
	Relative branches with both, the origin and the destination
	within the same object will be resolved by the assembler.
	No further relocation is necessary for those references.


	11.4 THE DATA SECTION

	This section contains a dump of all initialized data used
	by the module (NOTE: uninitialized data stored in the BSS
	segment will not be saved -- it is sufficient to memorize
	the size of the BSS segment).
	Like the TEXT section, this section may reference data in
	the TEXT, DATA, and BSS segment. A relocation entry exists
	for each reference.


	11.5 THE PUBLIC SYMBOLS SECTION

	This is a dump of all symbol table entries which contain
	public symbols (symbols declared using a .globl statement).
	Each entry has the following format:

	 OFFSET  NAME     DESCRIPTION
	+-------------------------------------------------------+
	|   0   | LSYM  | Length of the symbol name             |
	+-------------------------------------------------------+
	|   2   | ADDR  | Address of the referenced object      |
	+-------------------------------------------------------+
	|   4   | CLSS  | Class of the object (see below)       |
	+-------------------------------------------------------+
	|   6   | NAME  | The symbol name (LSYM chars)          |
	+-------------------------------------------------------+

	Consequently, the size of each entry is LSYM+6 bytes.

	The class CLSS of a symbol may be either 'T' (TEXT) or
	'D' (DATA). TEXT symbols usually reference procedures
	and DATA entries denote initialized data objects.


	11.6 THE EXTERNAL SYMBOLS SECTION

	This is a dump of all symbol table entries which contain
	external symbols (symbols declared using a .extrn statement).
	Each entry has the same format as a PUBLIC entry.
	Additionally, each entry has an appended mark table which
	contains the addresses where the external symbol has to be
	resolved in the current module. The mark table has the
	following format:

	+-------+-------+.......+-------+
	|  N*4  |  M-1  |       |  M-N  |
	+-------+-------+.......+-------+

	where N is the number of entries. The table themselves
	occupy the subsequent N*4 bytes. Each entry has the following
	format:

	 OFFSET  NAME     DESCRIPTION
	+-------------------------------------------------------+
	|   0   | XLOC  | The location of the reference         |
	+-------------------------------------------------------+
	|   2   | XCLS  | The calss of the symbol (see PUBLIC)  |
	+-------------------------------------------------------+
	|   3   | XREL  | Relative flag, see below              |
	+-------------------------------------------------------+

	Each entry is 4 bytes long.

	The XREL flag will be set to 1, if XLOC is part of an
	instruction which uses PC-relative addressing (like CALL
	and JMP instruction on the i8086). It the flag is zero,
	absolute addressing is to be used.


	11.7 THE RELOCATION TABLE

	The relocation table consists of entries which describe
	which addresses in the TEXT and DATA sections contain
	references to other section (or themselves) which must
	be adjusted when concatenating sections like it will be
	done by the loader.
	Each entry contains the following fields:

	 OFFSET  NAME     DESCRIPTION
	+-------------------------------------------------------+
	|   0   | BASE  | The base (referencing) segment        |
	+-------------------------------------------------------+
	|   1   | REFD  | The referenced segment                |
	+-------------------------------------------------------+
	|   2   | RADR  | The location of the address to adjust |
	+-------------------------------------------------------+

	Each entry is 4 bytes long.


	12) THE SLD RELOCATION / RESOLUTION STRATEGY

	for each module:

	+ load public symbols
	  + report duplicate public symbols
	+ load external symbols
	  + merge duplicate externals
	+ load relocation table
	+ adjust public symbol addresses
	+ adjust external symbol marks
	+ load code
	+ relocate code
	+ append code
	+ load data
	+ relocate data
	+ append data
	+ clear relocation table

	postprocessing:

	+ resolve externals
	+ adjust BSS references
	+ write image header
	+ write image
	+ write symbol table

