\documentclass[a4paper,twoside,12pt]{book}
\usepackage[utf8]{inputenc}

\title{MCU 8051 IDE handbook}
\author{Martin Ošmera <martin.osmera@gmail.com>}

\newcommand{\mysubject}{MCU~8051~IDE handbook}
\newcommand{\mykeywords}{8051, IDE, Linux}

% \usepackage[light,condensed,math]{iwona}

%\usepackage{lmodern}
%\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif

\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{longtable}
\usepackage[usenames,dvipsnames]{color}
\usepackage{pifont}
\usepackage{wrapfig}
\usepackage[footnotesize,bf]{caption}
\usepackage[pdftex,colorlinks=true,linkcolor=blue,urlcolor=blue,pdftitle={\title{}},pdfauthor={\author{}},pdfsubject={\mysubject{}},pdfkeywords={\mykeywords{}},bookmarksopen=false,pdfpagemode=None]{hyperref}

\floatstyle{ruled}
\newfloat{code}{thp}{lop}
\floatname{code}{Code}

\definecolor{highlight_constant}{rgb}{0.333, 0.666, 0.0}
\definecolor{highlight_unknown_base}{rgb}{0.533, 0.133, 0.133}
\definecolor{highlight_comment}{rgb}{0.533, 0.533, 0.533}
\definecolor{highlight_symbol}{rgb}{0.666, 0.0, 1.0}
\definecolor{highlight_oper_sep}{rgb}{0.866, 0.533, 0.0}
\definecolor{highlight_directive}{rgb}{0.533, 0.533, 1.0}
\definecolor{highlight_label}{rgb}{0.533, 0.333, 0.0}
\definecolor{highlight_instruction}{rgb}{0.0, 0.0, 1.0}
\definecolor{highlight_sfr}{rgb}{0.0, 0.0, 0.866}
\definecolor{highlight_indirect}{rgb}{0.866, 0.0, 0.0}
\definecolor{highlight_imm_hex}{rgb}{0.666, 0.0, 0.866}
\definecolor{highlight_macro}{rgb}{0.8, 0.0, 0.866}
\definecolor{highlight_imm_dec}{rgb}{0.0, 0.533, 0.866}
\definecolor{highlight_hex}{rgb}{0.533, 0.0, 0.733}
\definecolor{highlight_oct}{rgb}{0.533, 0.0, 0.0}
\definecolor{highlight_dec}{rgb}{0.0, 0.333, 0.666}
\definecolor{highlight_bin}{rgb}{0.2, 0.2, 0.333}
\definecolor{highlight_string}{rgb}{0.533, 0.533, 0.0}
\definecolor{highlight_control}{rgb}{1.0, 0.0, 0.0}
\definecolor{highlight_imm_oct}{rgb}{0.666, 0.0, 0.0}
\definecolor{highlight_imm_bin}{rgb}{0.333, 0.333, 0.666}
\definecolor{highlight_char}{rgb}{0.0, 1.0, 1.0}
\definecolor{highlight_imm_constant}{rgb}{0.937, 0.737, 0.168}
\definecolor{highlight_imm_unknown}{rgb}{0.666, 0.2, 0.2}
\definecolor{highlight_lst_number}{rgb}{0.0, 0.882, 1.0}
\definecolor{highlight_lst_code}{rgb}{1.0, 0.2, 0.968}
\definecolor{highlight_lst_address}{rgb}{0.349, 0.356, 1.0}
\definecolor{highlight_lst_line}{rgb}{0.074, 0.003, 0.513}
\definecolor{highlight_lst_macro}{rgb}{0.533, 0.533, 0.533}
\definecolor{highlight_lst_include}{rgb}{0.533, 0.533, 0.533}
\definecolor{highlight_lst_msg}{rgb}{0.0, 0.0, 0.0}

\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ \MakeUppercase{#1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}

\newcommand{\menuitem}[1]{\texttt{#1}}
\newcommand{\fileextension}[1]{\texttt{#1}}
\newcommand{\mysmallfont}{\fontsize{8pt}{10pt} \selectfont{}}
\newcommand{\uC}{$\mu$C }

\pdfadjustspacing=1
\raggedbottom

\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL,OR]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}

\fancypagestyle{plain}{
	\fancyhead{}
	\fancyhead[EL,OR]{\bfseries\thepage}
	\renewcommand{\headrulewidth}{0pt}
}



\begin{document}
\maketitle
\thanks{
	I would like to thank to the following people for their support during the project development:

	\begin{itemize}
		\item \textbf{Andre Cunha}~\textit{(Brazil)} for review of this document.
		\item \textbf{Yuanhui Zhang}~\textit{(China)} for bug reports and help with debugging.
		\item \textbf{Kara Blackowiak}~\textit{(USA)} for certain code reviews.
		\item \textbf{Marek Nožka}~\textit{(Moravia, CZ, EU)} for help with debugging.
		\item \textbf{Kostya V. Ivanov}~\textit{(Russia)} for bug fixes in the simulator engine.
		\item \textbf{Shakthi Kannan}~\textit{(India)} for adding this software to the FEL project and for a few patches.
		\item \textbf{Trevor Spiteri}~ for help with debugging (patches) the HD44780 simulator.
		\item \textbf{Miroslav Hradílek}~\textit{(EU)} for bug reports and suggestions
		\item \textbf{Fabricio Alcalde}~\textit{(Argentina)} for suggestions and bug reports.
		\item \textbf{Francisco Albani}~\textit{(Argentina)} for suggestions and a few bug reports.
	\end{itemize}
}

\tableofcontents
\newpage

\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
	\section*{Goals of the project}
	\addcontentsline{toc}{section}{Goals of the project}
		MCU~8051~IDE is an integrated development environment for microcontrollers based on MCS-51 intended for Assembly language and C language. This IDE is currently available on GNU/Linux and Microsoft\textregistered\~Windows\textregistered\ (since version 1.3.6). This program was originally intended for education purposes, but now the area of potential usage is surely significantly wider. This program was created to fill a gap in the open source software of this kind. User interface, source codes, documentation, web pages, etc., are written in English in order to make this software available to as many user as possible, but there is support for internationalization using i18n since version 1.3.10. This documentation is written in \LaTeX. It is very important to note that this software was not developed for any company, person or something similar and it is completely noncommercial, open source software distributed under \href{http://gnu.cz/article/30/pdf/gpl-cz.pdf}{GNU GPLv2} license intended for a group of
people with common interest, in this case 8051.

		\subsection*{MCU 8051 IDE should offer:}
			\begin{dingautolist}{172}
				\setlength{\itemsep}{-3pt}
				\item A transparent view on a simulated program for 8051;
				\item Easy source code editing even for an user with small knowledge of the assembly language;
				\item User friendly advanced IDE for MCS-51.
			\end{dingautolist}

		\subsection*{List of the most important parts of MCU 8051 IDE:}
			\begin{dinglist}{43}
				\setlength{\itemsep}{-3pt}
				\item Source code editor;
				\item Optimization capable macro-assembler;
				\item Advanced MCU simulator;
				\item Hexadecimal editor;
				\item Interface for hardware tool control plug-ins;
				\item Scientific calculator and special calculator optimized for 8051.
			\end{dinglist}

	\section*{Requirements}
	\addcontentsline{toc}{section}{Requirements}
		Hardware requirements are not defined. This program should run without problems on all POSIX systems (like GNU/Linux, etc.), where all of the software dependencies were satisfied. The IDE is officially distributed as a source code package (primary programming language is TCL), RPM package (currently available in official RHEL repositories), DEB package (currently available in official Debian repositories) and ebuild for Gentoo Linux (currently NOT available in the portage tree).
		\begin{table}[h]
			\centering{}
			\mysmallfont{}
			\begin{tabular}{|l|c|l|}
				\hline
				\textbf{Package}	& \textbf{Min. version}	& \textbf{Download location}			\\\hline
				\multicolumn{2}{|l}{\textbf{Required packages:}}
					& (The IDE will not run without these packages)						\\\hline
				tcl		& 8.5		& \url{http://www.tcl.tk/software/tcltk/downloadnow85.html}	\\\hline
				tk		& 8.5		& \url{http://www.tcl.tk/software/tcltk/downloadnow85.html}	\\\hline
				bwidget		& 1.8		& \url{http://sourceforge.net/projects/tcllib}			\\\hline
				itcl		& 3.4		& \url{http://sourceforge.net/projects/incrtcl}			\\\hline
				tdom		& 0.8		& \url{http://www.tdom.org}					\\\hline
				tkimg		& 1.3		& \url{http://sourceforge.net/projects/tkimg}			\\\hline
				tcllib		& 1.6		& \url{http://sourceforge.net/projects/tcllib}			\\\hline

				\multicolumn{2}{|l}{\textbf{Optional packages:}}
					& (Functionality might be unnecessarily limited without these packages) 		\\\hline
				Tclx		& 8.4		& \url{http://tclx.sourceforge.net}				\\
					& \multicolumn{2}{l|}{\textit{(Signal handling (signals like SIGINT)}}			\\\hline
				cmake		& 2.6		& \url{http://www.cmake.org/HTML/Download.html}			\\
					& \multicolumn{2}{l|}{
							\textit{(If you prefer this way of installation:}
							\texttt{``./configure \&\& make \&\& make install''})
						}										\\\hline
				rxvt-unicode	& 8.3		& \url{http://software.schmorp.de}				\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want terminal emulator)}}				\\\hline
				asem-51		& 1.3		& \url{http://plit.de/asem-51/download.htm}			\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want to use a really good assembler :) )}}	\\\hline
				sdcc		& 2.9		& \url{http://sdcc.sourceforge.net/}				\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want to used C language compiler)}}		\\\hline
				doxygen		& 1.3		& \url{www.doxygen.org/}					\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want to use doxygen directly from the IDE)}}	\\\hline
				indent		& 1.2		& \url{http://www.gnu.org/software/indent/}			\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want to use auto-indent function for C language)}}\\\hline
				hunspell	& 1.2		& \url{http://hunspell.sourceforge.net}				\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want to have spell checker function available)}}	\\\hline
				bash		& 4.0		& \url{http://tiswww.case.edu/php/chet/bash/bashtop.html}	\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want to have spell checker function available)}}	\\\hline
				gawk		& 3.1		& \url{http://www.gnu.org/software/gawk/}			\\\hline
					& \multicolumn{2}{l|}{\textit{(If you want to have spell checker function available)}}	\\\hline
			\end{tabular}
			\caption{Software requirements}
		\end{table}


	\section*{Intended Audience}
	\addcontentsline{toc}{section}{Intended Audience}
		This manual is intended for any individual, regardless of his or her experience with assembler, C language, MCU~8051~IDE or Linux, but it is assumed here that the reader is familiar with basic concepts of assembly language programming and with 8051 processor architecture.
		Advanced users are not likely to read this manual, but all suggestions on documentation will be considered. If you would like to contribute to this project or the documentation, please consult the project web page.

% 		The preferred way to ask technical questions or start a discussion is to use our mailing list: (mcu8051ide-devel AT lists.sourceforge.net). TODO: finish it

		Thanks for your cooperation which helps to make this software better.

\chapter{Brief introduction}

	This chapter will provide you with a brief introduction about the main components that are part of MCU 8051 IDE. The purpose of this chapter is to contextualize you on the sofware, informing about the parts that composes it. The next chapter will cover rapidly the Graphical User Interface, which will be described in further details on chapter.

	\section{Main components of MCU 8051 IDE}
		\paragraph{Editor} The code editor is featured with syntax highlighting and validation, auto-completion and spell checking for comments \footnote{Spell checking for comments is available only if you have installed the Hunspell program. This feature is currently not available on MS\textregistered Windows\textregistered OS.}, as well as a command line that speeds up the access to various editor options. It also provides a panel showing line numbers, bookmarks, breakpoints and warnings from syntax validator. Editor is capable to export the source code within it as XHTML and \LaTeX\ and contains a number of useful tools like automatic indentation, searching and replacement of expressions, copy to clipboard, paste from clipboard, among others.

		\paragraph{Assembler} The assembler is one of the integral parts of MCU 8051 IDE. It is a macro assembler with support for dozens of directives and capable of performing peephole optimizations. Support for peephole optimizations means that the assembler can attempt to optimize the resulting code for higher execution speed and lower size without tempering with its very functionality. It is important to note that automatic peephole optimization can sometimes be harmful and so it is disabled by default. A macro assembler is a software that allows  the user to define a \textbf{macro instruction}, which consists of a sequence of basic instructions, and use it later instead of repeatedly copying and pasting the set of instructions over and over along the source code. Assembler behavior can be configured either globally, using the proper configuration dialog, or locally in source code, by means of assembler directives and control sequences (e.g. \texttt{\$TITLE('Some title to show in the code listing')}). The
assembler is capable of generating four kinds of output code:
		\begin{dinglist}{43}
			\setlength{\itemsep}{-3pt}
			\item Object code (machine code) as an hexadecimal file, with \fileextension{.hex} extension and in Intel\textregistered\ 8 HEX format;
			\item Object code (machine code) as a binary file, with \fileextension{.bin} extension and in format of raw binary data;
			\item Code listing, in \fileextension{.lst} extension;
			\item Code for integrated MCU simulator, in \fileextension{.adf} extension.
		\end{dinglist}

		\paragraph{Simulator} The simulator is a software component intended for the simulation of the chosen microcontroller in a virtual environment. It allows user to monitor precisely what is happening in the MCU in an exact moment in time, as well as to modify its components, for instance by altering the value of a register, canceling an interrupt or forcing a subprogram to return. In that way it might be possible to ferret out certain flaws in the  program being debugged, which would be hard or nearly impossible to find and/or fix in other ways. Even though it is better to have ICD (In-Circuit Debugger) or ICE (In-Circuit Emulator) at hand, MCU~8051~IDE in current version does not support neither of them % \textcolor{blue}{[MARTIN, ARE YOU PLANNING TO ADD SUPPORT ON NEXT VERSIONS? IF SO, IT IS GOOD TO MENTION THIS HERE.]}. :) Sorry Andre, the only think I plan regarding this project is to "retire", I was working on it during my studies on the school, now I've got another responsibilities to attend to, I am
really sorry.
		MCU simulator implemented in this IDE supports dozens of microcontrollers and most of them are treated in slightly different way allowing to take into account most of the nuances between the supported MCUs. User can adjust simulator behavior to fit his or her needs by modifying clock frequency, size of connected external code, data memory and others, or for instance by disabling or enabling certain warnings, which pops up when the simulated program do something ``strange'', like some kind of invalid access into memory or stack overflow or underflow. Besides that, it is possible for the user to modify all registers which the MCU deals with, including those which are not accessible by the running program, like the Program Counter. User have always an overview of all possible, pending and active interrupts and can tamper with them at any time. The simulator also allows for altering code memory and all kinds of data memories. The program being simulated can be at any time "hibernated" into a file, preferably
with \fileextension{.m5ihib} extension, and resumed later from this same file. Such a file contains the entire state of the simulator at the point in which the program was hibernated.

		\paragraph{Project management} It is a functionality that allows the IDE to remember certain set of source code files along with a set of configuration parameters. Projects are stored in XML (eXtensible Markup Language) files with extension \fileextension{.mcu8051ide}. These files are human readable and their precise formatting is described in their inline DTD (Document Type Declaration). Their encoding is UTF-8 (Unicode Transformation) and as EOL (End Of Line) character they use LF (Line Feed). The reason for that is to make it possible for the user to implement his or her own tools for manipulating with them.

		\paragraph{Scientific calculator} MCU 8051 IDE scientific calculator is implemented as a simple scientific calculator capable of computation in four number systems: hexadecimal, decimal, octal and binary, and with three angle units: radians, degrees and grad. Integral part of the calculator is also a simple tool intended solely for computing preset values for MCU timers.

		\paragraph{Special calculator} The experience in MCU programming shows that it is very useful to have some tools at hand, capable of performing recurrent boring calculations that spend time to be done by hand. MCU 8051 IDE special calculator is intended for performing certain simple specialized calculations related to 8051. For instance, this calculator is capable of generating assembly language code implementing a wait loop with specified parameters.

		\paragraph{Hexadecimal editor} This utility is used here for watching and modifying large blocks of raw data in various memory types of the simulated MCU (Code, IDATA, XDATA, EEPROM, etc.). There is also hexadecimal editor intended for editing Intel\textregistered{}~HEX~8 files. Other hexadecimal editors are specially designed to fit specific needs of the given purpose; for example, there is an hexadecimal editor for viewing and editing code memory, which displays the current position of the program counter in the machine code of the simulated program.

		\paragraph{Disassembler} This tool can translate once assembled code back to source code. It is important to note that it is somewhat improbable that the resulting source code will look "reasonable" It is due to \texttt{DB} and \texttt{DW} and not fixed instruction word length on 8051. Nevertheless, such a generated source code must posses exactly the same functionality when it gets assembled again. Disassembler implemented in this IDE is frankly speaking only a little more that just a toy. If you want a really capable disassembler, maybe you should try some tool like D52 \url{http://www.8052.com/users/disasm/}.

		\paragraph{Notepad} In this IDE, it is a simple rich text editor for writing user notes of whatever kind. Originally, it was intended for writing a list of things which remain to be done in your project.

		\paragraph{Command Line Interface (CLI)} It is a tool that allows the use of some IDE functions without entering it's GUI. You can get list of available options by typing \texttt{mcu8051ide -h} or \texttt{mcu8051ide --help} to your terminal emulator. You can, for example, use just the assembler of the IDE or convert an Intel\textregistered{}~HEX~8 file to a raw binary file.

	\section{What is MCS-51}
		\begin{wrapfigure}{r}{120pt}
			\centering{}
			\includegraphics[width=110pt]{img/545px-Intel_8051_arch.png}
			\caption{i8051 micro-architecture}
		\end{wrapfigure}
		The Intel MCS-51 is a Harvard architecture, single chip microcontroller series which was developed by Intel in 1980 for use in embedded systems. Today there is a vast range of enhanced 8051-compatible devices manufactured by a number of independent manufacturers. They have 8-bit ALU, accumulator and 8-bit Registers (hence they are an 8-bit microcontrollers), they have 16-bit address bus, 8-bit data bus, boolean processing engine which allows bit-level boolean logic operations to be carried out directly and efficiently on select internal registers and select RAM locations, etc.
	\enlargethispage{10\baselineskip}

	\section{What is the Assembly language}
		An assembly language is a low-level programming language for computers, microprocessors, microcontrollers and other integrated circuits. It implements a symbolic representation of the binary machine codes and other constants needed to program a given CPU architecture. Processors based on MSC-51 have compatible instruction set, similar registers and many other things are generally very similar among them.

		Here is an example of how a piece of 8051 assembly code looks like:
		\begin{code}[h]
			\mysmallfont{}
			{\color{highlight_label}\verb'        main:'}\\
			{\color{highlight_directive}\verb'        if'}\verb' '{\color{highlight_constant}\verb'test'}\verb''{\color{highlight_symbol}\verb'='}\verb''{\color{highlight_unknown_base}\verb'2'}\\
			\verb'                '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}\verb''{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#25h'}\\
			\verb'                '{\color{highlight_comment}\verb'; Configure EEPROM'}\\
			\verb'                '{\color{highlight_instruction}\verb'orl'}\verb'     '{\color{highlight_sfr}\verb'EECON'}\verb''{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#38h'}\\
			\verb'                '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_sfr}\verb'R0'}\\
			{\color{highlight_directive}\verb'        endif'}\\
			{\color{highlight_label}\verb'        X0MI:'}\\
			\verb'                '{\color{highlight_instruction}\verb'anl'}\verb'     '{\color{highlight_sfr}\verb'EECON'}\verb''{\color{highlight_oper_sep}\verb','}\verb' #'{\color{highlight_symbol}\verb'('}\verb''{\color{highlight_hex}\verb'0FFh'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_hex}\verb'020h'}\verb''{\color{highlight_symbol}\verb')'}\\
			\verb'                '{\color{highlight_instruction}\verb'movx'}\verb'    '{\color{highlight_indirect}\verb'@R0'}\verb''{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'A'}
			\caption{An example piece of code written in 8051 assembly language}
		\end{code}

\chapter{Quick start}
	\section{Demonstration project}
		The aim of the demonstration project is to provide an easy way to explore the IDE without reading long and boring documents like this one. :) The demonstration project can be opened from the welcome dialog ( ``\menuitem{Main Menu}'' $\rightarrow$ ``\menuitem{Help}'' $\rightarrow$ ``\includegraphics[height=8pt]{img/messagebox_info.png}~\menuitem{Welcome dialog}'' $\rightarrow$ ``\menuitem{Open demonstration project}''. ) Demonstration project should introduce new user into usage of the most common functions of the IDE like assembling the code, running simulator and so on. Demonstration project cannot be modified by the user in order to make it ``less volatile''.
		\begin{figure}[h!]
			\centering{}
			\includegraphics[width=\textwidth]{img/024.png}
			\caption{MCU~8051~IDE with the demonstration project opened within it}
		\end{figure}

	\section{Your first project in MCU~8051~IDE}
		\begin{wrapfigure}{r}{160pt}
			\centering{}
			\includegraphics[width=150pt]{img/025.png}
			\caption{Project creation dialog}
		\end{wrapfigure}
		At first let me explain what the MCU~8051~IDE's project really is. It is a set of some files in some directory, let's call this directory the project directory. And this along with the file with extension \fileextension{.mcu8051ide} forms the project. The file with \fileextension{.mcu8051ide} extension defines what source code files belongs to the project and contains additional information about the project, like who is the project author or for what exact MCU is the project intended.

		To create you project you have to specify the project directory and the MCU type for which you will develop your code. This is done in project creation dialog. This dialog can be accessed from main menu ``\menuitem{Main Menu}'' $\rightarrow$ ``\menuitem{Project}'' $\rightarrow$ ``\includegraphics[height=8pt]{img/filenew.png} \menuitem{New}''. After this step you can specify some additional information about the project in project editing dialog.

		Once you have created a new project you can begin to develop you code from your chosen processor. When you want to save your code press Ctrl+S, Ctrl+N creates a new file and an existing file can be opened by Ctrl+O. Each opened file can be added or removed to/from your current project. Ctrl+B creates or deletes bookmark and Ctrl+Shift+B creates or deletes breakpoint. Project files, the files which are parts of the project, are opened each time you open the project. You can have more than one project opened at the time.

		Simulator can be started and shut down by pressing F2 key and assembler or compiler is run when F11 is pressed. Output from assembler or compiler is displayed on the bottom panel in tab ``Messages''. And main MCU simulator panel is also available on the bottom panel in tab ``Simulator''.

		On the left side you can find list of currently opened source code files and list of project files. And on the right side probably most useful tool at the beginning might be ``Instruction~details'', this tool displays help for instruction in the code editor on line with cursor. In the right panel you can find for example also list of bookmarks and breakpoints.

\chapter{Detailed introduction to GUI}
	\section{Source code editor}
		\subsection{Syntax highlight and validation}
			\begin{wrapfigure}{r}{100pt}
				\centering{}
				\includegraphics[width=90pt]{img/036.png}
				\caption{Syntax validation configuration button}
			\end{wrapfigure}
			The editor is equipped with an implementation of a syntax highlighting algorithm based on simplified syntax analysis. And that enables a limited on-line syntax validation. That means that as the user writes down the code, editor tries to check it for syntactical correctness. Syntax validator marks ``strange looking'' lines with exclamation mark and tries to underline exact point of potential syntax errors. This feature can be disabled as well as syntax highlighting can be disabled. By disabling these features you can make the editor work faster, but it would probably mean only a unnecessary limitation.
			There are three levels of syntax validation:\\
			\begin{itemize}
				\item 0: Disabled
				\item 1: Fast basic validation
				\item 2: Slow advanced validation
			\end{itemize}
			Syntax validation configuration button react to left and right click with the mouse pointer. Right button click decreases the level of validation and the left button click increases it.
		\subsection{Spell checking}
			\begin{wrapfigure}{l}{100pt}
				\centering{}
				\includegraphics[width=90pt]{img/037.png}
				\caption{Spell checker configuration button}
			\end{wrapfigure}
			There is also configurable spell checking function available. It underlines words which are marked by Hunspell\footnote{Hunspell is a spell checker and morphological analyzer. See \url{http://hunspell.sourceforge.net} for details.} as incorrectly spelled. This function applies to comments in the code or the entire code in case that the syntax highlight function has been disabled. User can choose from any of Hunspell or Myspell dictionaries installed on his or her system. This feature can also be turned off. It makes sense that this function is completely dependent on the Hunspell program, if it is not installed, spell checking won't work here.
		\subsection{Auto-completion}
			\begin{wrapfigure}{r}{180pt}
				\centering{}
				\includegraphics[width=170pt]{img/038.png}
				\caption{Syntax highlight, syntax validation and the pop-up based auto-completion all in action}
			\end{wrapfigure}
			Pop-up based auto-completion is function which should make it easier to use long names for labels, macros, variables, functions, constants, etc. This function is interconnected with syntax editor's analyzer used for syntax highlight and validation and for the table of symbols in the right panel. So it maintains an overview of all symbols defined in your source code file and then when you write just a few characters which a symbol starts with, this function will pop-up window offering you all defined symbols beginning with that letters. Note that this feature can be disabled in editor configuration dialog and note also that besides symbols it offers also list of assembly language instruction mnemonics and assembler directives.
		\subsection{Editor command line}
			Editor is featured with a command line, which can be invoked by pressing F10 key by default, and dismissed by pressing Esc. The command line appears below the editor above its status bar. From the command line you can perform variety of operations like conversions between various numerical bases, run simulator, insert current date and many more. In the command line it is sufficient to write just a few characters which the requested command starts with and which are sufficient to uniquely identify the command and press enter. You can see help for each command by running command \texttt{help list}. Command line is featured with its own color highlight, history and auto-completion.
			{
			\mysmallfont{}
			\begin{longtable}{l|ll}
				\textbf{Command} & \textbf{Arguments} & \textbf{Description} \\\hline
				\endhead
				\texttt{d2h}		& <decimal number>	& Convert decimal number into hexadecimal		\\
				\texttt{d2o}		& <decimal number>	& Convert decimal number into octal			\\
				\texttt{d2b}		& <decimal number>	& Convert decimal number into binary			\\
				\texttt{h2d}		& <hexadecimal number>	& Convert hexadecimal number into decimal		\\
				\texttt{h2o}		& <hexadecimal number>	& Convert hexadecimal number into octal			\\
				\texttt{h2b}		& <hexadecimal number>	& Convert hexadecimal number into binary		\\
				\texttt{o2h}		& <octal number>	& Convert octal number into hexadecimal			\\
				\texttt{o2d}		& <octal number>	& Convert octal number into decimal			\\
				\texttt{o2b}		& <octal number>	& Convert octal number into binary			\\
				\texttt{b2h}		& <binary number>	& Convert binary number into hexadecimal		\\
				\texttt{b2d}		& <binary number>	& Convert binary number into decimal			\\
				\texttt{b2o}		& <binary number>	& Convert binary number into octal			\\
				\texttt{animate}	&			& Animate simulated program				\\
				\texttt{assemble}	&			& Run assembler						\\
				\texttt{auto-indent}	&			& Automatically indent the edited code			\\
				\texttt{bookmark}	&			& Create or delete bookmark on the current line		\\
				\texttt{breakpoint}	&			& Create or delete breakpoint on the current line	\\
				\texttt{capitalize}	&			& Capitalize selected text				\\
				\texttt{clear}		&			& Clear history						\\
				\texttt{comment}	&			& Comment selection					\\
				\texttt{copy}		&			& Copy selection					\\
				\texttt{custom}		& <command number>	& Run user command					\\
				\texttt{cut}		&			& Cut selection						\\
				\texttt{date}		& <date format>		& Insert current time and/or date			\\
				\texttt{exit}		&			& Leave command line					\\
				\texttt{exit-program}	&			& Exit the IDE						\\
				\texttt{find}		& <string>		& Find a string						\\
				\texttt{goto}		& <line number>		& Go to the specified line				\\
				\texttt{help}		& <command name>	& Display help for the specified command		\\
				\texttt{char}		& <character code>	& Insert a character					\\
				\texttt{indent}		&			& Indent selection					\\
				\texttt{kill-line}	&			& Delete current line					\\
				\texttt{open}		& <file name>		& Open the specified file				\\
				\texttt{paste}		&			& Paste text from clipboard 				\\
				\texttt{redo}		&			& Take back last undo					\\
				\texttt{reload}		&			& Reload current document				\\
				\texttt{replace}	& <string> <replacement>& Replace a string with another string			\\
				\texttt{run}		&			& Run simulator in animation mode			\\
				\texttt{save}		&			& Save the current file					\\
				\texttt{set-icon-border}&			& Show/Hide icon border					\\
				\texttt{set-line-numbers}&			& Show/Hide line numbers				\\
				\texttt{sim}		&			& Engage/Disengage simulator				\\
				\texttt{step}		&			& Step simulated program				\\
				\texttt{tolower}	&			& Convert selected text to lowercase			\\
				\texttt{toupper}	&			& Convert selected text to uppercase			\\
				\texttt{uncomment}	&			& Comment current line					\\
				\texttt{undo}		&			& Undo the last text editing operation			\\
				\texttt{unindent}	&			& Decrease indentation level of the current line	\\
				\texttt{hibernate}	& [<target file>]	& Hibernate simulated program				\\
				\texttt{resume}		& [<source file>]	& Resume hibernated program				\\
				\texttt{switch-mcu}	& <MCU name>		& Switch current MCU simulation mode to another MCU	\\
				\texttt{set-xcode}	& <size of XCODE mem.>	& Set size external data memory for simulated MCU	\\
				\texttt{set-xdata}	& <size of XDATA mem.>	& Set size external program memory for simulated MCU	\\
				% Caption:
				\caption{Available commands}
			\end{longtable}
			}

	\section{Bottom panel}
		\subsection{Main panel of the MCU simulator}
			This panel is the main part of the simulator user interface. It shows all MCU registers along with content of internal data memory. And contains small toolbar with 6 buttons: ``\includegraphics[height=8pt]{img/launch.png}~Start''/``\includegraphics[height=8pt]{img/exit.png}~Shutdown'', ``\includegraphics[height=8pt]{img/rebuild.png}~Reset'', ``\includegraphics[height=8pt]{img/undo.png}~Step~back'', ``\includegraphics[height=8pt]{img/goto.png}~Step'', ``\includegraphics[height=8pt]{img/goto2.png}~Step~over'', ``\includegraphics[height=8pt]{img/1rightarrow.png}~Animate'' and ``\includegraphics[height=8pt]{img/2rightarrow.png}~Run''. All visible registers can be modified from here and most SFR registers are represented by enumeration of bits, where each particular bit can be modified separately, green color means logical one and red means zero. Each bit has its own tooltip help with short description of its purpose and status bar tip with bit address and bit name.
			\begin{figure}[h!]
				\centering{}
				\caption{Main panel of the simulator}
				\includegraphics[width=\textwidth]{img/001.png}
			\end{figure}
			\begin{figure}[h!]
				\begin{minipage}[b]{.3\textwidth}
					\centering{}
					\includegraphics[width=50pt]{img/002.png}
					\caption{Highlighted SFR register}
				\end{minipage}
				\begin{minipage}[b]{.3\textwidth}
					\centering{}
					\includegraphics[width=130pt]{img/003.png}
					\caption{Tool tip help for a special function bit}
				\end{minipage}
				\begin{minipage}[b]{.3\textwidth}
					\centering{}
					\includegraphics[width=50pt]{img/004.png}
					\caption{Representation of a register value in various numeric bases}
				\end{minipage}
			\end{figure}

		\subsection{C variables}
			This panel is a part of simulator user interface that maintains a list of global static variables defined in your C language code. Names of variables are displayed along with their current values in simulated MCU. If you program is not written in C language then this tool has no purpose for you at all. Otherwise the purpose of this panel is to make it easier to simulate a program for 8051 written in C language and see what is ``really'' happening in there. This tool is capable of extracting variable values from multiple registers and the displaying them as one variable, one value. Alteration of variable values is also possible. And search panel in the top right corner of the panel might help you with finding exact variable which you need to see. But note that functionality of this tool is in fact severely limited, it supports only global static variables, integers and floats, but variable value modification is allowed only for integer variables, no floats.

		\subsection{Graph showing voltage levels}
			This panel might help you to see what is happening on simulated GPIO\footnote{General Purpose Input Output} lines. Resolution and grid can be adjusted to better fit your needs. There are three graphs, one for port latches, one for port outputs (without any virtual HW) and one for the most realistic GPIO simulation which this IDE can do.
			\begin{figure}[h!]
				\centering{}
				\includegraphics[width=\textwidth]{img/005.png}
				\caption{GPIO Graph}
			\end{figure}

		\subsection{Messages panel}
			This panel displays output from the build-in assembler, external assemblers, C compiler and other external tools used in this IDE, which prints something important to standard output. Output from assemblers and SDCC (C compiler) is parsed to highlight warnings and errors and convert them to hyperlinks pointing to source code if possible. The panel also implements a tool for searching strings in the displayed text. User can make this tools visible by pressing Ctrl+F.
			\begin{figure}[h!]
				\centering{}
				\includegraphics[width=\textwidth]{img/007.png}
				\caption{Messages panel}
			\end{figure}

		\subsection{Notes}
			This is your personal notes for whatever you want. Originally it was intended for writing down a list of things which you need to finish in your work, so some sort of a to do list. But it is just a simple rich text editor with separate file specific notepad. User can use it as he or she consider appropriate.
			\begin{figure}[h!]
				\centering{}
				\includegraphics[width=\textwidth]{img/006.png}
				\caption{Personal notes}
			\end{figure}

		\subsection{Calculator}
			Calculator is here more or less just for completeness. But you might still find it to a real asset to your efforts. This calculator is capable of performing common arithmetical operations, computing trigonometric functions, logical operations, etc. Supported numeral systems are hexadecimal, decimal, octal and binary in both integer and real numbers. Supported angular measurement units are degrees, radians and gradians. The calculator is also equipped with three memory cells where you can save arbitrary numbers for future computations. On the right side there is a simple calculator dedicated to calculation timers preset values for the specified time, clock frequency, etc. \footnote{Essentially the same but much more advanced function has also the special calculator.}
			\begin{figure}[h!]
				\centering{}
				\includegraphics[width=\textwidth]{img/009.png}
				\caption{Calculator}
			\end{figure}

		\subsection{Find in files}
			With this tool you can search all files in certain directory which names matches specified GLOB\footnote{An instance of pattern matching behavior, for example ``*.c++'' matches all files with ``.c++'' extension.} pattern. The search is made for a plain string or regular expression match. This tool might be very useful when you are dealing with many, possibly large, source code files and you suddenly want to find something specific in them. Each line printed in the list of found entries is a hypertext link which opens the file mentioned in it in the source code editor and navigates the editor to line matching the item. In other words it generally the same as well known Unix command ``grep''\footnote{A command line text search utility originally written for Unix. The name is taken from the first letters in global/regular expression/print. Its official date of creation is given as March 3, 1973.}, but with graphical user interface.

		\subsection{Terminal emulator}
			This is a common color VT102\footnote{A video terminal that was made by Digital Equipment Corporation (DEC). Its detailed attributes became the de facto standard for terminal emulators.} terminal emulator for the X Window System\footnote{Computer software system and network protocol that provides a basis for graphical user interfaces.} as you probably know. More precisely It's embedded \href{http://software.schmorp.de/pkg/rxvt-unicode.html}{rxvt-unicode} terminal emulator by Marc A. Lehmann and others. Background and foreground colors used in the terminal emulator are configurable in ``Terminal~configuration~Dialog''. Note that this feature in not available on Microsoft\textregistered{} Windows\textregistered{} operating system and probably will never be, because terminal emulator would have only a little use there.
			\begin{figure}[h!]
				\centering{}
				\includegraphics[width=\textwidth]{img/031.png}
				\caption{Embedded \href{http://software.schmorp.de/pkg/rxvt-unicode.html}{rxvt-unicode} terminal emulator, with the \href{http://www.midnight-commander.org/}{Midnight Commander} running in it}
			\end{figure}

	\section{Left panel}
		\subsection{List of opened files}
			Shows list of all files opened withing the current project. Each entry has its own pop-up menu. Noteworthy features are search bar, sorting by name, size, etc. and open with an external editor. Each file can be added or removed from the list of project files. There is not much to say about it, it's just a simple list with a few nice features but nothing complex.

		\subsection{List of project files}
			Shows list of all files assigned to the current project. Each entry has its own pop-up menu. Noteworthy features are search bar, sorting by name, size, etc.  and open with an external editor. Each file can be excluded from the list of project files, opened or close withing the project.

		\subsection{SFR watches}
			\begin{wrapfigure}{l}{130pt}
				\centering{}
				\includegraphics[width=110pt]{img/032.png}
				\caption{SFR watches}
			\end{wrapfigure}
			From here you can see all special function registers on your chosen MCU in one compact list. Search panel might help you locating particular SFR in this panel and also in the main simulator panel. Each register has two numerical representations of its value in the simulated MCU, decimal and hexadecimal.

		\subsection{File system browser}
			This panel should help you quickly navigate in your file system in order to open files you want to see as quickly as possible. But many people generally don't like panels like this and will always use only file selection dialog instead.

	\section{Right panel}
		\subsection{List of bookmarks}
			From here you can easily navigate trough all bookmarks made in the current source code file. The panel also highlights item in the list which corresponds to the current line (line with cursor) in the source code editor. You can also remove all bookmarks at once by pressing the ``\includegraphics[height=8pt]{img/editdelete.png}~Clear~all'' button.

		\subsection{List of breakpoints}
			Pretty much the same as list of bookmarks, but this panel shows breakpoints instead of bookmarks, that is the only difference.

		\subsection{Instruction details}
			\begin{wrapfigure}{r}{210pt}
				\centering{}
				\includegraphics[width=200pt]{img/008.png}
				\caption{Instruction details}
			\end{wrapfigure}
			When you are writing a code in the assembly language, this panel might be a great help for you. It shows all valid sets of operands for the instruction on your current cursor position in the source code and highlights the set which you are probably using. The same works also for directives. Each line in list has its own help window which appears when user points at it by the pointer. This help window shows additional details regarding the exact instruction. Note also the ``\includegraphics[height=8pt]{img/help.png}~Show~legend'' button in the upper right corner of the panel.

		\subsection{Data register watches}
			\begin{wrapfigure}{l}{130pt}
				\centering{}
				\includegraphics[width=120pt]{img/033.png}
				\caption{Data register watches}
			\end{wrapfigure}
			This panel might help you to keep track of specific data registers, except for SFR and EEPROM. User can add arbitrary data memory registers which he or she consider to be the most important for his or her current work. You can add a register in the bottom part of the panel. And you can search for specific register, configure the panel and save or load the list of register in the top panel.

			This tool is capable of extraction of used symbols from a code listing file\footnote{File with \fileextension{.lst} file name extension.} generated by an assembler. This feature can enabled or disabled in the panel's configuration menu. The current list of watched registers can be saved into a file and loaded from a file\footnote{These file usually have extension \fileextension{.wtc}}.

			Memory segments are distinguished by format of the addresses. As you can seen in the example, the meaning is this:
			\begin{table}[h!]
				\mysmallfont{}
				\centering{}
				\begin{tabular}{l|l}
					\textbf{Address format}	& \textbf{Memory segment}	\\
					\hline
					1 or 2 digits		& Internal RAM (not SFR)	\\
					3 digits		& Expanded RAM			\\
					4 digits		& External RAM			\\
					dot and 2 digits	& Bit (including SFR area)	\\
				\end{tabular}
				\caption{Data register watches: Register address}
			\end{table}

		\subsection{Subprograms call monitor}
			\begin{wrapfigure}{r}{130pt}
				\centering{}
				\includegraphics[width=120pt]{img/034.png}
				\caption{Subprograms call monitor}
			\end{wrapfigure}
			From here you can monitor all subprogram and interrupt calls in your program. For each entry there is mentioned the type of call, \texttt{acall}, \texttt{lcall} or interrupt, return address and address from which the call was invoked. And you can force each of them to premature return.

		\subsection{List of symbols}
			This tools shows a list of symbols defined in source code of your program, works for both assembly language and C language. The list is managed automatically as the user edit the code and is featured with search panel for easy navigation. Types of symbols can be distinguished by their colors and icons. Colors of particular symbols corresponds to the colors used in the source code editor to highlight them.
			\begin{table}[h]
				\mysmallfont{}
				\centering{}
				\begin{tabular}{ll}
					\includegraphics[height=8pt]{img/symbol1.png} & {\color{highlight_label} Label}		\\
					\includegraphics[height=8pt]{img/symbol3.png} & {\color{highlight_constant} Constant}	\\
					\includegraphics[height=8pt]{img/symbol2.png} & {\color{highlight_macro} Macro}		\\
					\includegraphics[height=8pt]{img/symbol4.png} & {\color{black} C variable}		\\
					\includegraphics[height=8pt]{img/symbol0.png} & {\color{blue} C function}		\\
					\includegraphics[height=8pt]{img/symbol5.png} & {\color{black} Other}			\\
				\end{tabular}
				\caption{Symbol colors and icons in default settings}
			\end{table}


		\subsection{HW plug-ins manager}
			This tool does just one thing, allows user to use plug-ins in MCU~8051~IDE. Primary purpose of these plug-ins should be implementation of inter-operation with certain hardware tools, most probably MCU programmers. if you are interested in writing these plug-ins, please refer to chapter \ref{sec:WritingHardwareToolControlPlugIns}.

	\section{Other tools}
		\subsection{SFR map}
			A tabular overview of all available SFRs on your MCU. This tool has similar graphical form as tables of SFR often used in 8051 manuals, but the most important difference is that this one is connected to the simulator and is capable of representing and modifying current values of SFRs in the MCU simulator.

		\subsection{Map of bit addressable area}
			\begin{wrapfigure}{l}{160pt}
				\centering{}
				\includegraphics[width=130pt]{img/017.png}
				\caption{Map of the bit addressable area}
			\end{wrapfigure}
			This tool is a part of the simulator user interface. It shows all bits in the bit addressable area of the simulated MCU. Each square represents one bit, when simulator is on, you can also change value of each one of them by clicking on it. Labels and color used here should be hopefully clear from the legend at the bottom.

		\subsection{Stack monitor}
			\begin{wrapfigure}{r}{90pt}
				\centering{}
				\includegraphics[width=80pt]{img/022.png}
				\caption{Stack monitor}
			\end{wrapfigure}
			This tool makes it possible to see entire MCU stack in one view. You can also push any value you want onto the stack or pop a value from it at any time. However this particular tool does not allow for changing the values on the tack in any other way than these.

			Each line in the stack monitor represents one octet in the stack, each octet is represented in four numerical bases, hexadecimal, decimal, binary and octal and also as a character according to ACII chart. Newly added values are pushed on the top of the list. And their origins are distinguished by background color of the address. These colors are explained in the legend on bottom.

			Note that button ``Clear'' doe not clear the stack but instead it clear only the monitor! Buttons ``POP'' and ``PUSH'' are intended for manipulation with the stack's content.

		\subsection{Symbol viewer}
			\begin{wrapfigure}{l}{160pt}
				\centering{}
				\includegraphics[width=140pt]{img/019.png}
				\caption{Symbol viewer}
			\end{wrapfigure}
			Symbol viewer shows the table of symbols defined in your program, it works only for assembly language. The table content is taken from code listing generated by assembler. In the top part of the window you can find search bar, and in the bottom part you can specify filter criteria for what you want to see in the table and specify sorting order of the symbols displayed. Symbol in this context are various constants and labels.

		\begin{figure}[h!]
			\begin{minipage}[t]{.5\textwidth}
				\centering{}
				\caption{ASCII chart}
				\includegraphics[width=.9\textwidth]{img/039.png}
			\end{minipage}
			\begin{minipage}[t]{.5\textwidth}
				\centering{}
				\caption{8051 Instruction Table}
				\includegraphics[width=.9\textwidth]{img/040.png}
			\end{minipage}
		\end{figure}

		\clearpage
		\subsection{ASCII chart}
			Colorful interactive ASCII chart, it may prove handy especially when you are dealing with serial communication and this sort of things.

		\subsection{8051 Instruction Table}
			Colorful interactive 8051 instruction table, very much alike the ASCII chart. But instead of ASCII code you can find there the complete table of 8051 instruction mnemonics, OP codes and related things.

		\subsection{8-segment editor}
			\begin{wrapfigure}{r}{140pt}
				\centering{}
				\includegraphics[width=120pt]{img/020.png}
				\caption{8-segment editor}
			\end{wrapfigure}
			With this tool you can easily determine what value you have to set on a port to display a digit on a numerical LED display. In the left part of the dialog window, you can find numerical values corresponding to the digit displayed in the middle part. These values are represented for both common cathode and anode and in three numerical bases, hexadecimal, decimal and octal. Buttons on left side from entry boxes copies value from adjacent entry box into clipboard. In the right part of the window you can set what port pin is connected to what LED segment.

		\subsection{Stopwatch}
			Stopwatch is a tool which can measure certain things in the simulated processor, such as number of instructions processed so far, number of microseconds which would it take for a real processor to execute, number of breakpoints met so far etc. User can also set it to stop the simulation when certain limit in the measurement has been met or exceeded.

		\subsection{Scribble notepad}
			This is something like a small whiteboard, where you can draw of write your notes. It is a little bit more free than conventional text editor. You can also insert images, supported image formats are PNG and a few others. But don't rely on the scribble notepad to much, this tool has no save or load functions, anything you draw or write there is just temporary and it will not recover upon next start of the IDE.

		\subsection{Base converter}
			\begin{wrapfigure}{l}{120pt}
				\centering{}
				\includegraphics[width=110pt]{img/021.png}
				\caption{Base convertor}
			\end{wrapfigure}
			When you are programming micro-controllers, you might want to convert numbers between various numeric bases. One could say that everyone dealing with such things as micro-controllers would be able to do these conversion without use of any tool. But this doesn't mean that such a tool can never be useful. Values written in the entry boxes of the base converter are saved when user leaved the IDE and are recovered upon next start along with all opened base converter tool windows.

		\subsection{RS-232 debugger}
			\begin{wrapfigure}{r}{190pt}
				\centering{}
				\includegraphics[width=180pt]{img/035.png}
				\caption{UART/RS-232 debugger}
			\end{wrapfigure}
			This tool is capable of transmitting and receiving data to/from RS-232 port in your computer, today personal computers usually do not have this type of port, but you can always use something like a USB to RS-232 bridge.

			I assume here that the reader is familiar with the RS-232 communication protocol and related terms. This tool acts as a \texttt{DTE}\footnote{Data Terminal Equipment, the other side is \texttt{DCE} (Data Circuit-terminating Equipment).}.

			On the diagram in the upper left corner you can see current logical level on each of RS-232 wires except for \texttt{RxD} and \texttt{TxD}. You can also set value for wires \texttt{DTR}\footnote{Data Terminal Ready} and \texttt{RTS}\footnote{Ready To Send} and trigger the break by button \texttt{BREAK}.

			Right upper corner contains configuration controls, their functions should be mostly obvious. Check-box ``Enable~reception'' enables or disables writing to hexadecimal editor ``Received~data''. Button ``Close'' closes the opened physical port. And button ``\includegraphics[height=8pt]{img/reload.png}'' refreshes the list of available physical ports.

			In the bottom part you can see two hexadecimal editors: ``Data~to~send'' and ``Received~data''. These are representations of data which we are dealing with. By button ``Receive~here'' you can set address in the hexadecimal editor where the received data will be written. And by button ``Send~selected'' you can trigger transmission over the opened physical port, selected chunk of the data will be send then. Button ``Clear~selected'' are intended for removing data from the hexadecimal editors editors.

		\subsection{Hexadecimal editors}
			\begin{wrapfigure}{l}{200pt}
				\centering{}
				\includegraphics[width=190pt]{img/023.png}
				\caption{MCU code memory editor}
			\end{wrapfigure}
			In this IDE there are several hexadecimal editors used for various purposes. Each of these editors is equipped with a string search tool and address bars of the left and top side. And in some cases with file saving and loading capability, numerical base switch, ASCII view and a navigation bar at the bottom. Editing is allowed only in overwrite mode, copy and paste works as usual, search dialog can be invoked by pressing Ctrl+F and user can switch between view (left and right) by pressing Tab key. Non printable characters in ASCII view are displayed in red color.

			\paragraph{MCU code memory editor} allows user to see and modify contents of the CODE memory of the simulated micro-controller. Special feature of this particular editor is that instruction OP code currently pointed by program counter (PC) is highlighted with dark orange background along with the instruction's operands. And the same applies also for the previously executed instruction but highlight color is light orange in this case.

			\paragraph{MCU data/xdata/eeprom memory editor} allows user to see and modify contents of the IDATA/XDATA/EEPROM memory of the simulated micro-controller. Special features of this editors are that recently changed octets are highlighted with light orange foreground color and octets currently being written into the memory are highlighted with gray background color.

			\paragraph{MCU eeprom write buffer editor} allows to see and modify EEPROM write buffer. Current EEPROM write offset is displayed as well.

			\paragraph{Independent hexadecimal editor} is universal hexadecimal editor with maximum capacity of 64kB and support for Intel\textregistered 8 HEX file format. This tool is completely independent from your project in the IDE. This too might be particularly useful when you want to and possibly modify content of a Intel\textregistered 8 hex file, but do not alter the simulated MCU.

		\subsection{Hibernation of simulated program}
			The IDE is capable of saving execution state of the simulated program into a file and resuming the program from it anytime later. The file, usually with extension \fileextension{.m5ihib}, contains values of all data registers including SFR in the simulated MCU along with other values determining MCU state as for example list of active interrupts. The file is in XML format, human readable and usually occupies a few tens of kilobytes.The file does not contain content of the CODE memory, so it has to be available somewhere else in a separate file.

		\subsection{Interrupt monitor}
			Interrupts monitor is a specialized tool intended for viewing and manipulating with interrupts in simulated MCU. With interrupt monitor you can invoke any interrupt you want at any time, force any interrupt at any time to return,  change interrupt priorities or disable or enable particular interrupts. You can also see all interrupts synoptically in one window and alter values of their configuration flags.
			\begin{figure}[h!]
				\centering{}
				\includegraphics[width=300pt]{img/018.png}
				\caption{Interrupt monitor}
			\end{figure}

		\subsection{Conversions between *.hex, *.bin and *.adf files}
			Sometimes it might prove helpful to have some tool to convert a binary file to Intel\textregistered 8 Hex and vice versa. For this purpose MCU~8051~IDE is equipped with a simple tool set for this purpose. In the ``\menuitem{Main Menu}'' $\rightarrow$ ``\menuitem{Utilities}'' you can find these tools:
			\begin{itemize}
				\setlength{\itemsep}{-3pt}
				\item \includegraphics[height=8pt]{img/hb.png} \textbf{HEX $\rightarrow$ BIN} \\
					Convert Intel\textregistered 8 Hex file to raw binary file
				\item \includegraphics[height=8pt]{img/bh.png} \textbf{BIN $\rightarrow$ HEX} \\
					Convert raw binary file to Intel\textregistered 8 Hex
				\item \includegraphics[height=8pt]{img/sh.png} \textbf{SIM $\rightarrow$ HEX} \\
					Convert simulator assembler debug file (\fileextension{.adf}) to Intel\textregistered 8 Hex file
				\item \includegraphics[height=8pt]{img/sb.png} \textbf{SIM $\rightarrow$ BIN} \\
					Convert simulator assembler debug file (\fileextension{.adf}) to raw binary file
				\item \includegraphics[height=8pt]{img/hh.png} \textbf{Normalize Hex} \\
					Read and rewrite the given Intel\textregistered 8 Hex file, so that all records satisfies specified maximum length (can be set in the assembler configuration dialog), all records are in incremental order and no records overlaps with others.
			\end{itemize}

		\subsection{Normalization of source code indentation}
			Uniformly intended code is always more aesthetically pleasing and more readable. When you don't have the luxury of having such a code from the first hand, perhaps you will find this feature helpful. This function is available for assembly language and C language if program indent is installed on your system. User can access this function from the ``\menuitem{Main Menu}'' $\rightarrow$ ``\menuitem{Tools}'' $\rightarrow$ ``\menuitem{Auto indent}''.

			\noindent
			\begin{center}
				\small{A small example of the auto indent function in action}
			\end{center}
			\begin{minipage}{\textwidth}
				\twocolumn
				\begin{minipage}[t]{.5\textwidth}
					\mysmallfont{}
					\textbf{Original code:}\\
					\verb'               '{\color{highlight_constant}\verb'abc'}\verb'   '{\color{highlight_directive}\verb'DATA'}\verb'    '{\color{highlight_hex}\verb'7Fh'}\\
					\verb'         '{\color{highlight_comment}\verb'; Start at address 0x00'}\\
					\verb'     '{\color{highlight_directive}\verb'ORG'}\verb'             '{\color{highlight_hex}\verb'0h'}\\
					\verb'        '{\color{highlight_label}\verb'label0:'}{\color{highlight_instruction}\verb'inc'}\verb'             '{\color{highlight_sfr}\verb'R0'}\\
					\verb'             '{\color{highlight_instruction}\verb'inc'}\verb'    '{\color{highlight_indirect}\verb'@R0'}\\
					\verb'    '{\color{highlight_instruction}\verb'cjne'}\verb'   '{\color{highlight_sfr}\verb'R0'}\verb'   '{\color{highlight_oper_sep}\verb','}\verb'  '{\color{highlight_imm_constant}\verb'#abc'}\verb'   '{\color{highlight_oper_sep}\verb','}{\color{highlight_constant}\verb'label0'}\\
					\verb' '{\color{highlight_instruction}\verb'mov'}\verb' '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb'                '{\color{highlight_imm_hex}\verb'#0h'}\\
					\verb'          '{\color{highlight_instruction}\verb'sjmp'}\verb'       '{\color{highlight_constant}\verb'label0'}\\
					\verb'   '{\color{highlight_comment}\verb'; End of assembly'}\\
					\verb'                             '{\color{highlight_directive}\verb'END'}\\
				\end{minipage}\begin{minipage}[t]{.5\textwidth}
					\mysmallfont{}
					\textbf{Automatically intended code:}\\
					{\color{highlight_constant}\verb'abc'}\verb'     '{\color{highlight_directive}\verb'DATA'}\verb'    '{\color{highlight_hex}\verb'7Fh'}\\
					\verb'        '{\color{highlight_comment}\verb'; Start at address 0x00'}\\
					\verb'        '{\color{highlight_directive}\verb'ORG'}\verb'     '{\color{highlight_hex}\verb'0h'}\\
					{\color{highlight_label}\verb'label0:'}\verb' '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_sfr}\verb'R0'}\\
					\verb'        '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_indirect}\verb'@R0'}\\
					\verb'        '{\color{highlight_instruction}\verb'cjne'}\verb'    '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_constant}\verb'#abc'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'label0'}\\
					\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0h'}\\
					\verb'        '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'label0'}\\
					\verb'        '{\color{highlight_comment}\verb'; End of assembly'}\\
					\verb'        '{\color{highlight_directive}\verb'END'}\\
				\end{minipage}
				\onecolumn
			\end{minipage}

		\subsection{Change letter case}
			\begin{wrapfigure}{r}{150pt}
				\centering{}
				\includegraphics[width=140pt]{img/042.png}
				\caption{Change letter case dialog}
			\end{wrapfigure}
			This tool can change letter casing to upper or lower case of certain types tokens which your source consists of of. For example you can easily convert all instruction mnemonics in the code to uppercase. It is intended for users who strictly prefers one or another convention of letter casing in assembly language. You can invoke the tool from ``\menuitem{Main Menu}'' $\rightarrow$ ``\menuitem{Tools}'' $\rightarrow$ ``\menuitem{Change letter case}''.
			\begin{itemize}
				\setlength{\itemsep}{-3pt}
				\item \includegraphics[height=8pt]{img/up0.png} Convert to uppercase
				\item \includegraphics[height=8pt]{img/down0.png} Convert to lowercase
				\item \includegraphics[height=8pt]{img/button_cancel.png} Keep current case

			\end{itemize}

		\subsection{User defined commands}
			\paragraph{Introduction}
				This feature was added in order to enable for use of any auxiliary tools which might useful while working in this IDE. For instance, some hardware tools or some sort of a source code management system like Git or SVN. These custom commands are basically mere Bash scripts with some kind of pseudo-variables available in it. These pseudo-variables are formed as strings beginning with ``\texttt{\%}''. Before each script execution they are expanded to values corresponding to their meaning. For instance ``\texttt{\%filename}'' expands to the name of the current file. Note that ``\texttt{\%\%}'' is expanded as single ``\texttt{\%}''.\\
				\begin{table}[htp]
					\centering{}
					\mysmallfont{}
					\begin{tabular}{|l|l|}
						\hline
						\textbf{Pseudo-variable} & \textbf{Meaning}			\\
						\hline
						\%URL		& The full URL of the current file		\\
						\%URLS		& List of the URLs of all open documents	\\
						\%directory	& Project directory				\\
						\%filename	& The file name of the current document		\\
						\%basename	& Same as \%filename, but without extension	\\
						\%mainfile	& Name of project main file			\\
						\%line		& Number of the current line			\\
						\%column	& Number of the current column			\\
						\%selection	& The selected text in the current file		\\
						\%text		& The full text of the current file		\\
						\hline
					\end{tabular}
					\caption{List of pseudo-variables}
				\end{table}

			\paragraph{Configuration}
				There is specialized configuration dialog for these custom commands.
				\begin{wrapfigure}{r}{150pt}
					\centering{}
					\includegraphics[width=140pt]{img/010.png}
					\caption{Custom commands configuration dialog}
				\end{wrapfigure}

			\paragraph{Execution}
				After the script is executed successfully or not, dialog showing the results will appear upon completion of the script. This dialog contains all textual output from the script caught on standard output and standard error output. If the script outputs anything to the standard error output it is considered unsuccessful.

		\subsection{Clean-up project folder}
			This tool can proof useful particularly when your project directory gets ``polluted'' with lots of unnecessary files, and you want to get rid of them easily and first of all safely. It removes files with certain file name extensions from the project folder. The list of removed files is then written in results dialog. Available from ``\menuitem{Main Menu}'' $\rightarrow$ ``\menuitem{Tools}'' $\rightarrow$ ``\menuitem{Clean up project folder}''.

		\subsection{File statistic}
			Display certain statistical information about the current source code file. ``\menuitem{Main Menu}'' $\rightarrow$ ``\menuitem{File}'' $\rightarrow$ ``\menuitem{File statistic}''.

	\section{Configuration dialogues}
		Configuration dialogues are graphical tools for customization of this integrated development environment. And they comprises of these components:

		\paragraph{Editor configuration}
			\begin{wrapfigure}{l}{100pt}
				\centering{}
				\includegraphics[width=90pt]{img/027.png}
				\caption{Editor configuration dialog}
			\end{wrapfigure}
			In editor configuration dialog user can change preferred editor from default built-in editor to for example Vim or Emacs and modify configuration the built-in editor. Configurable are colors used for syntax highlight, colors for text area background and so on, font used by editor, indentation mode, auto-save interval and others.

		\paragraph{Compiler configuration}
			Compiler configuration dialog allows user to configure behavior of the built-in assembler, chose another assembler instead of this one. Configure the preferred assembler and configure the C compiler (SDCC). Compiler configuration is stored in the project file (the file with \fileextension{.mcu8051ide} extension). So these setting are specific to the one specific MCU~8051~IDE project.

			Currently supported external assemblers are these:
			\begin{itemize}
				\setlength{\itemsep}{-3pt}
				\item ASEM-51 \footnote{A really useful assembler written by W.W. Heinz. You can find it at \url{http://plit.de/asem-51/home.htm}}
				\item ASL \footnote{Available at http://linux.maruhn.com/sec/asl.html}
				\item AS51 \footnote{Available at http://www.pjrc.com/tech/8051}
			\end{itemize}

			How to link multiple files when using C language:\footnote{This feature is not yet supported on MS Windows.}
			\begin{enumerate}
				\item Write makefile,
				\item set the IDE to use your makefile instead of calling the C compiler directly (Configuration -> Compiler~configuration -> GNU~make~utility),
				\item start compilation as usual.
			\end{enumerate}

		\paragraph{Simulator configuration}
			Simulator configuration dialog configures these:
			\begin{enumerate}
				\item How to treat indeterminable values in simulator engine
				\item How many steps will be remembered during the simulation for later backward steps.
				\item What warning conditions will be ignored during the simulation
			\end{enumerate}

		\paragraph{Right panel configuration}
			Configures colors used in tools ``Instruction details'' and ``Register watches'' in the right panel.

		\paragraph{Main toolbar configuration}
			Configures contents of main application tool bar.
			\begin{figure}[h!]
				\centering{}
				\includegraphics[width=\textwidth]{img/041.png}
				\caption{Main toolbar}
			\end{figure}

		\paragraph{Custom commands configuration}
			Configures user defined commands, which are essentially Bash scripts. This feature is currently not available on MS\textregistered Windows\textregistered OS.

		\paragraph{Shortcuts configuration}
			Configures key shortcuts used in the IDE.

		\paragraph{Terminal emulator configuration}
			Configures terminal emulator at the bottom panel. This terminal emulator is embedded \href{http://software.schmorp.de/pkg/rxvt-unicode.html}{rxvt-unicode}. User can set foreground color and background color of the terminal emulator window and the font. This feature is currently not available on MS\textregistered Windows\textregistered OS.

		\paragraph{Global MCU~8051~IDE configuration}
			\begin{wrapfigure}{r}{100pt}
				\centering{}
				\includegraphics[width=90pt]{img/028.png}
				\caption{Global configuration dialog}
			\end{wrapfigure}
			Changes settings like GUI language, size of fonts used in the GUI, GUI widget style, whether splash screen should be displayed each time when the IDE is started and so on.

\chapter{Build-in macro-assembler}
	In this chapter we will be concerned with MCU~8051~IDE build-in assembler. \footnote{This assembler manual is inspired by ASEM-51 manual, a great work done by W.W. Heinz} With syntax of its statements, directives and 8051 assembler instructions. I assume that the reader is familiar with general concepts of assembly language programming and 8051 architecture. So I will not explain these here.

	\section{Statements}
		Source code files for this assembler must be text files where lines are formed like these:\\\bigskip
		{
			\mysmallfont{}
			\texttt{}
			\begin{tabular}[h!]{llll}
				\verb'[' { \color{highlight_label} label: } \verb']' &
				\verb'[' { \color{highlight_instruction} instruction } &
				\verb'[' { \color{highlight_symbol} operand } \verb'[' , { \color{highlight_symbol} operand } \verb'[' , { \color{highlight_symbol} operand } \verb']' \verb']' \verb']' &
				\verb'[' { \color{highlight_comment} ;comment } \verb']' \\

				\verb'[' { \color{highlight_label} label: } \verb']' &
				{ \color{highlight_directive} directive } &
				\verb'[' { \color{highlight_symbol} argument } \verb']' &
				\verb'[' { \color{highlight_comment} ;comment } \verb']' \\

				{ \color{highlight_constant} symbol } &
				{ \color{highlight_directive} directive } &
				{ \color{highlight_symbol} argument } &
				\verb'[' { \color{highlight_comment} ;comment } \verb']' \\
			\end{tabular}
		}
		\bigskip

		Everything in square brackets is optional. Compilation does not go beyond line containing ``\texttt{end}'' directive, so after that directive the code do not have to be syntactically valid. Empty lines are allowed as well as line containing only comment or label. Statements can be separated by spaces, NBSP characters\footnote{No Breaking Space (0xC2)} and tabs. Statements are case insensitive and their length is not limited, overall line length is also not limited.

		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_label}\verb'start:'}\verb'  '{\color{highlight_comment}\verb'; Start timer 0 in mode 2'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R5'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0h'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'IE'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0FFh'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'TL0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#255d'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'TMOD'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#03h'}\\
			\verb'        '{\color{highlight_instruction}\verb'setb'}\verb'    '{\color{highlight_sfr}\verb'TR0'}\\
			\verb'        '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'main'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; Main loop'}\\
			{\color{highlight_label}\verb'main:'}\verb'   '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'$'}\verb'       '{\color{highlight_comment}\verb'; Inifinite loop'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; Program end'}\\
			\verb'        '{\color{highlight_directive}\verb'end'}\\

			% Caption
			\caption{An example of well formed assembly language code}
		\end{code}

	\section{Symbols}
		Symbol names for numbers, macros or addresses defined by user in the code using appropriate directive. Like with ``\texttt{equ}'' directive you can define a new symbol and assign a value to it right away. Symbols may consist of upper and lower case letter, digits and underscore character (``\_''), their length is not limited, they are case insensitive and they can be the same as language keywords. Be aware of that there cannot coexists two or more symbols in the same memory segment which differs only by letter casing, in other words symbols ``\texttt{abc}'' and ``\texttt{ABC}'' are completely the same thing.

	\section{Constants}
		There are two types of constants numeric constants and character constants. Numeric constants consist of a sequence of digits allowed for the numeric base used and followed by the radix specifier. If the number begins with a letter, there must be the zero digit placed before the number. For example ``abh'' is not valid numeric constant, but ``0abh'' is. Character constants consist of sequence of one or more characters enclosed by quote character (\verb"'"). C escape sequences can be used in character constants. If you want to place quote character (\verb"'") into the constant, you can either place two quotes instead of one (``\verb"''''"'') or escape the quote, that means place backslash ``\\\\'' before it. There is significant difference between single character constant and multiple character one. Single character constant is regarded by assembler as 8 bin integer number and multiple character constant is a string, a sequence of characters. Since version 1.4.1 it is possible to use prefix ``0x'' (and
``0X'') as radix specifier for hexadecimal numbers, so ``0xaf'' is the same as ``0afh'', etc.

		\begin{table}[h!]
			\mysmallfont{}
			\centering{}
			\begin{tabular}{|l|l|l|}
				\hline
				Constant type	& Allowed digits	& Radix specifier	\\
				\hline
				Binary		& 0 .. 1		& B		\\
				Octal		& 0 .. 7		& O or Q	\\
				Decimal		& 0 .. 9		& D or none	\\
				Hexadecimal	& 0 .. 9, A .. F	& H		\\
				\hline
			\end{tabular}
			\caption{Radix specifiers}
		\end{table}

		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_comment}\verb'; These are the same number'}\\
			{\color{highlight_constant}\verb'a'}\verb' '{\color{highlight_directive}\verb'set'}\verb' '{\color{highlight_bin}\verb'100111b'}\verb'   '{\color{highlight_comment}\verb'; Binary'}\\
			{\color{highlight_constant}\verb'a'}\verb' '{\color{highlight_directive}\verb'set'}\verb' '{\color{highlight_oct}\verb'47q'}\verb'       '{\color{highlight_comment}\verb'; Octal'}\\
			{\color{highlight_constant}\verb'a'}\verb' '{\color{highlight_directive}\verb'set'}\verb' '{\color{highlight_dec}\verb'39d'}\verb'       '{\color{highlight_comment}\verb'; Decimal'}\\
			{\color{highlight_constant}\verb'a'}\verb' '{\color{highlight_directive}\verb'set'}\verb' '{\color{highlight_hex}\verb'27h'}\verb'       '{\color{highlight_comment}\verb'; Hexadecimal'}\\
			{\color{highlight_constant}\verb'a'}\verb' '{\color{highlight_directive}\verb'set'}\verb' '{\color{highlight_string}\verb''\verb"'"\verb''\verb"'"\verb''\verb"'"\verb''\verb"'"\verb''}\verb'      '{\color{highlight_comment}\verb'; Character'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; This is an example of string'}\\
			{\color{highlight_directive}\verb'db'}\verb' '{\color{highlight_string}\verb''\verb"'"\verb'string'\verb"'"\verb''}\verb'     '{\color{highlight_comment}\verb'; String'}\\

			% Caption
			\caption{An example of constants}
		\end{code}

	\section{Expressions}
		Arithmetical expressions are evaluated at compilation time and replaced by assembler with constant corresponding the their resulting value. Expressions comprises of arithmetical operators, constants, symbols and another expressions. An example of such expression might be \texttt{(~X~XOR~0FF00H~)}

		\begin{table}[h!]
			\mysmallfont{}
			\centering{}
			\begin{tabular}{|l|l|l|}
				\hline
				Operator	& Description			& Example		\\\hline
				\multicolumn{3}{|l|}{\textbf{Unary Operators}} \\\hline
				NOT		& one's complement		& NOT 0a55ah		\\\hline
				HIGH		& high order byte		& HIGH 0a55ah		\\\hline
				LOW		& low order byte		& LOW 0a55ah		\\\hline
				\multicolumn{3}{|l|}{\textbf{Binary Operators}} \\\hline
				+		& unsigned addition		& 11 + 12		\\\hline
				-		& unsigned subtraction		& 13 + 11		\\\hline
				*		& unsigned multiplication	& 3 * 5			\\\hline
				/		& unsigned division		& 20 / 4		\\\hline
				MOD		& unsigned remainder		& 21 MOD 4		\\\hline
				SHL		& logical shift left		& 32 SHL 2		\\\hline
				SHR		& logical shift right		& 32 SHR 2		\\\hline
				AND		& logical and			& 48 AND 16		\\\hline
				OR		& logical or			& 370q OR 7		\\\hline
				XOR		& exclusive or			& 00fh XOR 005h		\\\hline
				.		& bit operator			& P1.4			\\\hline
				EQ, = 		& equal to			& 11 EQ 11		\\\hline
				NE, <>		& not equal to			& 11 NE 11		\\\hline
				LT, < 		& less than			& 11 LT 12		\\\hline
				LE, <=		& less or equal than		& 11 LT 11		\\\hline
				GT, > 		& greater than			& 12 GT 11		\\\hline
				GE, >=		& greater or equal than		& 12 GT 11		\\\hline
			\end{tabular}
			\caption{Expression operators}
		\end{table}

		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_constant}\verb'abc'}\verb'     '{\color{highlight_directive}\verb'EQU'}\verb'     '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_unknown_base}\verb'2000'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'3'}\verb' '{\color{highlight_symbol}\verb'/'}\verb' '{\color{highlight_unknown_base}\verb'100'}\verb' '{\color{highlight_symbol}\verb')'}\\
			{\color{highlight_constant}\verb'xyz'}\verb'     '{\color{highlight_directive}\verb'SET'}\verb'     '{\color{highlight_symbol}\verb'( LOW'}\verb' '{\color{highlight_constant}\verb'abc'}\verb' '{\color{highlight_symbol}\verb')'}\\
			{\color{highlight_directive}\verb'IF'}\verb' '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_constant}\verb'abc'}\verb' '{\color{highlight_symbol}\verb'>'}\verb' '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_unknown_base}\verb'5'}{\color{highlight_symbol}\verb' MOD'}\verb' '{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb')'}\verb' '{\color{highlight_symbol}\verb')'}\\
			\verb'        '{\color{highlight_instruction}\verb'MOV'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_symbol}\verb'#'}\verb' '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_hex}\verb'15h'}{\color{highlight_symbol}\verb' XOR'}\verb' '{\color{highlight_unknown_base}\verb'12'}\verb' '{\color{highlight_symbol}\verb') OR'}\verb' '{\color{highlight_constant}\verb'xyz'}\verb' '{\color{highlight_symbol}\verb')'}\\
			{\color{highlight_directive}\verb'ELSE'}\\
			\verb'        '{\color{highlight_instruction}\verb'ADDC'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_symbol}\verb'#'}\verb' '{\color{highlight_symbol}\verb'( HIGH'}\verb' '{\color{highlight_hex}\verb'1234h'}\verb' '{\color{highlight_symbol}\verb')'}\\
			{\color{highlight_directive}\verb'ENDIF'}

			% Caption
			\caption{An example of expressions}
		\end{code}

	\section{The instruction set processing}
		This assembler is capable of translating all 8051 instructions with all possible sets of operands. And extends this set with 2 pseudo-instructions: ``CALL'' and ``JMP'' which do not stand for any operation code, but are translated according to the used operand. ``CALL'' can be translated as ``ACALL'' or ``LCALL'', ``JMP addr'' can be translated as ``SJMP'', ``AJMP'' or ``LJMP''.

	\twocolumn
	\section{Assembler directives}
		\begin{description}
			\mysmallfont{}
			\item[ifn] IF Not, conditional assembly\\
				Syntax:\\
				\verb'  '{\color{highlight_directive}\verb'IFN'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[ifdef] IF DEFined\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'IFDEF'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'symbol'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IFDEF'}\verb' '{\color{highlight_constant}\verb'CND'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[ifndef] IF Not DEFined\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'IFNDEF'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'symbol'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IFNDEF'}\verb' '{\color{highlight_constant}\verb'CND'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[rept] REPeaT Macro\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'REPT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'REPT'}\verb' '{\color{highlight_unknown_base}\verb'5'}\\
				\verb'    '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDM'}\\
			\item[times] REPeaT Macro\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'TIMES'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'TIMES'}\verb' '{\color{highlight_unknown_base}\verb'5'}\\
				\verb'    '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDM'}\\
			\item[if] Conditional assembly\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'IF'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[else] Conditional assembly\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ELSE'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[elseif] Conditional assembly\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIF'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIF'}\verb' '{\color{highlight_constant}\verb'SOMETHING_ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[elseifn] Conditional assembly\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIF'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIF'}\verb' '{\color{highlight_constant}\verb'SOMETHING_ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[elseifdef] Conditional assembly\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIF'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIFDEF'}\verb' '{\color{highlight_constant}\verb'SOMETHING_ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[elseifndef] Conditional assembly\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIF'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSEIFNDEF'}\verb' '{\color{highlight_constant}\verb'SOMETHING_ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[endif] Conditional assembly\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'IF'}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'-'}\verb' '{\color{highlight_constant}\verb'CND'}{\color{highlight_symbol}\verb')'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#20h'}\\
				\verb'  '{\color{highlight_directive}\verb'ELSE'}\\
				\verb'    '{\color{highlight_instruction}\verb'MOV'}\verb'  '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#40h'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDIF'}\\
			\item[endm] END of Macro definition\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ENDM'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_macro}\verb'ABC'}\verb' '{\color{highlight_directive}\verb'MACRO'}\\
				\verb'      '{\color{highlight_instruction}\verb'MOV'}\verb' '{\color{highlight_sfr}\verb'B'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#12d'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDM'}\\
			\item[end] END of the program\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'END'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'END'}\\
			\item[list] enable code LISTing\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'LIST'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_directive}\verb'NOLIST'}\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_directive}\verb'LIST'}\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
			\item[nolist] disabled code listing\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'NOLIST'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_directive}\verb'NOLIST'}\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
				\verb'  '{\color{highlight_directive}\verb'LIST'}\\
				\verb'  '{\color{highlight_instruction}\verb'NOP'}\\
			\item[dseg] switch to DATA segment [at address]\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'DSEG'}\verb' '{\color{highlight_constant}\verb'[AT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}{\color{highlight_constant}\verb']'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'DSEG'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_dec}\verb'20d'}\\
			\item[iseg] switch to IDATA segment [at address]\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ISEG'}\verb' '{\color{highlight_constant}\verb'[AT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}{\color{highlight_constant}\verb']'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'ISEG'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_dec}\verb'10d'}\\
			\item[bseg] switch to BIT segment [at address]\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'BSEG'}\verb' '{\color{highlight_constant}\verb'[AT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}{\color{highlight_constant}\verb']'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'BSEG'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_dec}\verb'5d'}\\
			\item[xseg] switch to XDATA segment [at address]\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'XSEG'}\verb' '{\color{highlight_constant}\verb'[AT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}{\color{highlight_constant}\verb']'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'XSEG'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_dec}\verb'30d'}\\
			\item[cseg] switch to CODE segment [at address]\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'CSEG'}\verb' '{\color{highlight_constant}\verb'[AT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}{\color{highlight_constant}\verb']'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'CSEG'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_dec}\verb'40d'}\\
			\item[flag] define a FLAG bit\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'FLAG'}\verb'  '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'F4'}\verb'  '{\color{highlight_directive}\verb'FLAG'}\verb'  '{\color{highlight_hex}\verb'16h'}\\
				\verb''\\
				{\color{highlight_label}\verb'Note:'}\\
				\verb'  '{\color{highlight_macro}\verb'Deprecated'}\verb' '{\color{highlight_constant}\verb'directive. Consider directive BIT instead.}'}\\
			\item[skip] SKIP bytes in the code memory\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'SKIP'}\verb'  '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'SKIP'}\verb' '{\color{highlight_unknown_base}\verb'5'}\\
			\item[equ] EQUivalent\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'EQU'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'ABC'}\verb'  '{\color{highlight_directive}\verb'EQU'}\verb'  '{\color{highlight_sfr}\verb'R0'}\\
				\verb'  '{\color{highlight_constant}\verb'XYZ'}\verb'  '{\color{highlight_directive}\verb'EQU'}\verb'  '{\color{highlight_hex}\verb'4Eh'}{\color{highlight_symbol}\verb'+'}{\color{highlight_unknown_base}\verb'12'}\\
			\item[bit] define BIT address\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'BIT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'ABC'}\verb'  '{\color{highlight_directive}\verb'BIT'}\verb'  '{\color{highlight_sfr}\verb'P4'}{\color{highlight_symbol}\verb'.'}{\color{highlight_unknown_base}\verb'5'}\\
			\item[set] SET numeric variable or variable register\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'SET'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'SET'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'register'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'ALPHA'}\verb'  '{\color{highlight_directive}\verb'SET'}\verb'  '{\color{highlight_sfr}\verb'R0'}\\
				\verb'  '{\color{highlight_constant}\verb'ALPHA'}\verb'  '{\color{highlight_directive}\verb'SET'}\verb'  '{\color{highlight_unknown_base}\verb'42'}{\color{highlight_symbol}\verb'*'}{\color{highlight_constant}\verb'BETA'}\\
			\item[code] define address in the CODE memory\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'CODE'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				\verb''\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'TBL'}\verb'  '{\color{highlight_directive}\verb'CODE'}\verb'  '{\color{highlight_hex}\verb'600h'}\\
			\item[data] define address in the DATA memory\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'DATA'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'UIV'}\verb'  '{\color{highlight_directive}\verb'DATA'}\verb'  '{\color{highlight_hex}\verb'20h'}\\
			\item[idata] define address in the Internal DATA memory\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'IDATA'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'UIV'}\verb'  '{\color{highlight_directive}\verb'IDATA'}\verb'  '{\color{highlight_hex}\verb'20h'}\\
			\item[xdata] define address in the External DATA memory\\
				Syntax:\\\\
				\verb'  '{\color{highlight_constant}\verb'<symbol>'}\verb' '{\color{highlight_directive}\verb'XDATA'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_constant}\verb'UIV'}\verb'  '{\color{highlight_directive}\verb'XDATA'}\verb'  '{\color{highlight_hex}\verb'400h'}\\
			\item[macro] MACRO definition\\
				Syntax:\\\\
				\verb'  '{\color{highlight_macro}\verb'<macro>'}\verb' '{\color{highlight_directive}\verb'MACRO'}\verb' '{\color{highlight_constant}\verb'[<arg0> ['}{\color{highlight_oper_sep}\verb','}{\color{highlight_constant}\verb'<arg1> ... ]'}\\
				Example:\\
				\verb'  '{\color{highlight_macro}\verb'ABC'}\verb' '{\color{highlight_directive}\verb'MACRO'}\verb' '{\color{highlight_constant}\verb'X'}\\
				\verb'      '{\color{highlight_instruction}\verb'MOV'}\verb' '{\color{highlight_constant}\verb'X'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#12d'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDM'}\\
			\item[local] define a LOCAL label inside a macro\\
				Syntax:\\
				\verb'  '{\color{highlight_directive}\verb'LOCAL'}\verb'   '{\color{highlight_label}\verb'<label>'}\\\\
				Example:\\
				\verb'  '{\color{highlight_macro}\verb'ABC'}\verb' '{\color{highlight_directive}\verb'MACRO'}\verb' '{\color{highlight_constant}\verb'X'}\\
				\verb'      '{\color{highlight_directive}\verb'LOCAL'}\verb'  '{\color{highlight_label}\verb'xyz'}\\
				\verb'      '{\color{highlight_label}\verb'xyz:'}\verb'  '{\color{highlight_instruction}\verb'MOV'}\verb' '{\color{highlight_constant}\verb'X'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#12d'}\\
				\verb'  '{\color{highlight_directive}\verb'ENDM'}\\
			\item[ds] Define Space\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'DS'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'DS'}\verb' '{\color{highlight_unknown_base}\verb'2'}{\color{highlight_symbol}\verb'+'}{\color{highlight_unknown_base}\verb'4'}\\
			\item[dw] Define Words\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'DW'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr1'}{\color{highlight_symbol}\verb'>'}\verb' '{\color{highlight_constant}\verb'[,'}{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr2'}{\color{highlight_symbol}\verb'>'}\verb' '{\color{highlight_constant}\verb'...'}\verb' '{\color{highlight_constant}\verb']'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'DW'}\verb' '{\color{highlight_unknown_base}\verb'0,02009H,2009,4171'}\\
			\item[db] Define Bytes\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'DB'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr1'}{\color{highlight_symbol}\verb'>'}\verb' '{\color{highlight_constant}\verb'['}{\color{highlight_oper_sep}\verb','}{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr2'}{\color{highlight_symbol}\verb'>'}\verb' '{\color{highlight_constant}\verb'...'}\verb' '{\color{highlight_constant}\verb']'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'DB'}\verb' '{\color{highlight_unknown_base}\verb'24'}{\color{highlight_oper_sep}\verb','}{\color{highlight_string}\verb''\verb"'"\verb'August'\verb"'"\verb''}{\color{highlight_oper_sep}\verb','}{\color{highlight_unknown_base}\verb'09'}{\color{highlight_oper_sep}\verb','}{\color{highlight_symbol}\verb'('}{\color{highlight_unknown_base}\verb'2'}{\color{highlight_symbol}\verb'*'}{\color{highlight_unknown_base}\verb'8'}{\color{highlight_symbol}\verb'+'}{\color{highlight_unknown_base}\verb'24'}{\color{highlight_symbol}\verb')/'}{\color{highlight_unknown_base}\verb'8'}\\
			\item[dbit] Define BITs\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'DBIT'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'DBIT'}\verb' '{\color{highlight_unknown_base}\verb'4'}{\color{highlight_symbol}\verb'+'}{\color{highlight_unknown_base}\verb'2'}\\
			\item[include] INCLUDE an external source code\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'INCLUDE'}\verb' '{\color{highlight_string}\verb'<filename>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'INCLUDE'}\verb' '{\color{highlight_string}\verb''\verb"'"\verb'my file.asm'\verb"'"\verb''}\\
			\item[org] ORiGin of segment location\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'ORG'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'ORG'}\verb' '{\color{highlight_hex}\verb'0Bh'}\\
			\item[using] USING register banks\\
				Syntax:\\\\
				\verb'  '{\color{highlight_directive}\verb'USING'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  '{\color{highlight_directive}\verb'USING'}\verb' '{\color{highlight_unknown_base}\verb'2'}\\
			\item[byte] define BYTE address in the data memory\\
				Syntax:\\\\
				\verb'  <symbol> '{\color{highlight_directive}\verb'BYTE'}\verb' '{\color{highlight_symbol}\verb'<'}{\color{highlight_constant}\verb'expr'}{\color{highlight_symbol}\verb'>'}\\
				Example:\\
				\verb'  UIV  '{\color{highlight_directive}\verb'BYTE'}\verb'  '{\color{highlight_hex}\verb'20h'}\\
				{\color{highlight_label}\verb'Note:'}\\
				\verb'  '{\color{highlight_macro}\verb'Deprecated'}\verb' '{\color{highlight_constant}\verb'directive. Consider directive DATA instead.'}\\
		\end{description}
		\onecolumn

	\twocolumn
	\section{Assembler Controls}
		\begin{description}
			\mysmallfont{}
			\item[\$date] Inserts date string into page header\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$DATE'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$DATE'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'1965-12-31'}{\color{highlight_symbol}\verb')'}\\
			\item[\$da] Inserts date string into page header\\
				Syntax:\\
				\verb'  '				{\color{highlight_control}\verb'$DA'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '				{\color{highlight_control}\verb'$DA'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'1965-12-31'}{\color{highlight_symbol}\verb')'}\\
			\item[\$eject] Start a new page in list file\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$EJECT'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$EJECT'}\\
			\item[\$ej] Start a new page in list file\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$EJ'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$EJ'}\\
			\item[\$include] Include a source file\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$INCLUDE'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$INCLUDE'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'somefile.asm'}{\color{highlight_symbol}\verb')'}\\
			\item[\$inc] Include a source file\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$INC'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$INC'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'somefile.asm'}{\color{highlight_symbol}\verb')'}\\
			\item[\$list] List subsequent source lines\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$LIST'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$LIST'}\\
			\item[\$li] List subsequent source lines\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$LI'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$LI'}\\
			\item[\$noli] Don't list subsequent source lines\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOLI'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOLI'}\\
			\item[\$nolist] Don't list subsequent source lines\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOLIST'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOLIST'}\\
			\item[\$nomod] Disable predefined SFR symbols\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOMOD'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOMOD'}\\
			\item[\$nomo] Disable predefined SFR symbols\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOMO'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOMO'}\\
			\item[\$nomod51] Disable predefined SFR symbols\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOMOD51'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOMOD51'}\\
			\item[\$paging] Enable listing page formatting\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$PAGING'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$PAGING'}\\
			\item[\$pi] Enable listing page formatting\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$PI'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$PI'}\\
			\item[\$nopi] Disable listing page formatting\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOPI'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOPI'}\\
			\item[\$nopaging] Disable listing page formatting\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOPAGING'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOPAGING'}\\
			\item[\$pagelength] Set lines per page for listing\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$PAGELENGTH'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'int'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$PAGELENGTH'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'64'}{\color{highlight_symbol}\verb')'}\\
			\item[\$pl] Set lines per page for listing\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$PL'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'int'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$PL'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'64'}{\color{highlight_symbol}\verb')'}\\
			\item[\$pagewidth] Set columns per line for listing\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$PAGEWIDTH'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'int'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$PAGEWIDTH'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'132'}{\color{highlight_symbol}\verb')'}\\
			\item[\$pw] Set columns per line for listing\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$PW'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'int'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$PW'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'132'}{\color{highlight_symbol}\verb')'}\\
			\item[\$symbols] Create symbol table\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$SYMBOLS'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$SYMBOLS'}\\
			\item[\$sb] Create symbol table\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$SB'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$SB'}\\
			\item[\$nosymbols] Don't create symbol table\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOSYMBOLS'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOSYMBOLS'}\\
			\item[\$nosb] Don't create symbol table\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOSB'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOSB'}\\
			\item[\$title] Inserts title string into page header\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$TITLE'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$TITLE'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'My firts code'}{\color{highlight_symbol}\verb')'}\\
			\item[\$tt] Inserts title string into page header\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$TT'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$TT'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'My firts code'}{\color{highlight_symbol}\verb')'}\\
			\item[\$noobject] Do not create Intel HEX file\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOOBJECT'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOOBJECT'}\\
			\item[\$object] Specify file name for Intel HEX\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$OBJECT'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$OBJECT'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'my_hex.hex'}{\color{highlight_symbol}\verb')'}\\
			\item[\$print] Specify file name for list file\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$PRINT'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'string'}{\color{highlight_symbol}\verb')'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$PRINT'}{\color{highlight_symbol}\verb'('}{\color{highlight_string}\verb'my_list.lst'}{\color{highlight_symbol}\verb')'}\\
			\item[\$noprint] Do not create list file at all\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOPRINT'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOPRINT'}\\
			\item[\$nomacrosfirst] Define and expand macro instructions after! conditional assembly and definitions of constants\\
				Syntax:\\
				\verb'  '{\color{highlight_control}\verb'$NOMACROSFIRST'}\\
				Example:\\
				\verb'  '{\color{highlight_control}\verb'$NOMACROSFIRST'}\\
		\end{description}
		\onecolumn

	\section{Predefined Symbols}
		There are symbols which are defined by default by assembler. The aim is to make it a little easier to write code in assembly language for 8051, because user don not have to define all these symbols in his or her code. This feature can be turned of by ``\texttt{\$NOMOD}'' control sequence.

		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Code addresses}
			\begin{tabular}{|ll|ll|ll|ll|}
				\hline
				\textbf{Symbol}	& \textbf{Value}
					& \textbf{Symbol} & \textbf{Value}
					& \textbf{Symbol} & \textbf{Value}
					& \textbf{Symbol} & \textbf{Value} \\
				\hline
				RESET	& 000h	& EXTI0	& 003h	& TIMER0& 00Bh	& EXTI1	& 013h \\
				TIMER1	& 01Bh	& SINT	& 023h	& TIMER2& 02Bh	& CFINT	& 033h \\
				\hline
			\end{tabular}
		\end{table}

		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Plain numbers, these symbols are always defined!}
			\begin{tabular}{|ll|}
				\hline
				\textbf{Symbol}	& \textbf{Value} \\
				\hline
				??MCU\_8051\_IDE	& 8051h \\
				??VERSION		& 0139h \footnote{0139h stands for version 1.3.9} \\
				\hline
			\end{tabular}
		\end{table}

		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Predefined SFR bit addresses}
			\begin{tabular}{|ll|ll|ll|ll|}
				\hline
				\textbf{Symbol}	& \textbf{Value}
					& \textbf{Symbol} & \textbf{Value}
					& \textbf{Symbol} & \textbf{Value}
					& \textbf{Symbol} & \textbf{Value} \\
				\hline
				IT0	& 088h	& IE0	& 089h	& IT1	& 08Ah	& IE1	& 08Bh \\
				TR0	& 08Ch	& TF0	& 08Dh	& TR1	& 08Eh	& TF1	& 08Fh \\
				RI	& 098h	& TI	& 099h	& RB8	& 09Ah	& TB8	& 09Bh \\
				REN	& 09Ch	& SM2	& 09Dh	& SM1	& 09Eh	& SM0	& 09Fh \\
				FE	& 09Fh	& 	& 	& 	& 	& 	&  \\
				EX0	& 0A8h	& ET0	& 0A9h	& EX1	& 0AAh	& ET1	& 0ABh \\
				ES	& 0ACh	& ET2	& 0ADh	& EC	& 0AEh	& EA	& 0AFh \\
				RXD	& 0B0h	& TXD	& 0B1h	& INT0	& 0B2h	& INT1	& 0B3h \\
				T0	& 0B4h	& T1	& 0B5h	& WR	& 0B6h	& RD	& 0B7h \\
				PX0	& 0B8h	& PT0	& 0B9h	& PX1	& 0BAh	& PT1	& 0BBh \\
				PS	& 0BCh	& PT2	& 0BDh	& PC	& 0BEh	& 	&  \\
				PPCL	& 0BEh	& PT2L	& 0BDh	& PSL	& 0BCh	& 	&  \\
				PT1L	& 0BBh	& PX1L	& 0BAh	& PT0L	& 0B9h	& PX0L	& 0B8h \\
				TF2	& 0CFh	& EXF2	& 0CEh	& RCLK	& 0CDh	& TCLK	& 0CCh \\
				EXEN2	& 0CBh	& TR2	& 0CAh	& CT2	& 0C9h	& CPRL2	& 0C8h \\
				P	& 0D0h	& OV	& 0D2h	& RS0	& 0D3h	& 	&  \\
				RS1	& 0D4h	& F0	& 0D5h	& AC	& 0D6h	& CY	& 0D7h \\
				CR	& 0DEh	& CCF4	& 0DCh	& 	& 	& 	&  \\
				CCF3	& 0DBh	& CCF2	& 0DAh	& CCF1	& 0D9h	& CCF0	& 0D8h \\
				\hline
			\end{tabular}
		\end{table}

		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Predefined SFR addresses}
			\begin{tabular}{|ll|ll|ll|ll|}
				\hline
				\textbf{Symbol}	& \textbf{Value}
					& \textbf{Symbol} & \textbf{Value}
					& \textbf{Symbol} & \textbf{Value}
					& \textbf{Symbol} & \textbf{Value} \\
				\hline
				P0	& 080h	& SP	& 081h	& DPL	& 082h	& DPH	& 083h \\
				PCON	& 087h	& TCON	& 088h	& TMOD	& 089h	& TL0	& 08Ah \\
				TL1	& 08Bh	& TH0	& 08Ch	& TH1	& 08Dh	& P1	& 090h \\
				SCON	& 098h	& SBUF	& 099h	& P2	& 0A0h	& IE	& 0A8h \\
				P3	& 0B0h	& IP	& 0B8h	& PSW	& 0D0h	& ACC	& 0E0h \\
				B	& 0F0h	& P4	& 0C0h	& WDTCON& 0A7h	& EECON	& 096h \\
				DP0H	& 083h	& DP0L	& 082h	& DP1H	& 085h	& DP1L	& 084h \\
				T2CON	& 0C8h	& T2MOD	& 0C9h	& RCAP2L& 0CAh	& RCAP2H& 0CBh \\
				TL2	& 0CCh	& TH2	& 0CDh	& AUXR1	& 0A2h	& WDTRST& 0A6h \\
				CLKREG	& 08Fh	& ACSR	& 097h	& IPH	& 0B7h	& SADDR	& 0A9h \\
				SADEN	& 0B9h	& SPCR	& 0D5h	& SPSR	& 0AAh	& SPDR	& 086h \\
				AUXR	& 08Eh	& CKCON	& 08Fh	& WDTPRG& 0A7h	&	& \\
				\hline
				CH	& 0F9h	& CCAP0H& 0FAh	& CCAP1H& 0FBh	& CCAP2H& 0FCh \\
				CCAP3H	& 0FDh	& CCAP4H& 0FEh	&CCAPL2H& 0FCh	&CCAPL3H& 0FDh \\
				CCAPL4H	& 0FEh	& ADCLK	& 0F2h	& ADCON	& 0F3h	& ADDL	& 0F4h \\
				ADDH	& 0F5h	& ADCF	& 0F6h	& P5	& 0E8h	& CL	& 0E9h \\
				CCAP0L	& 0EAh	& CCAP1L& 0EBh	&CCAPL2L& 0ECh	&CCAPL3L& 0EDh \\
				CCAPL4L	& 0EEh	& CCON	& 0D8h	& CMOD	& 0D9h	& CCAPM0& 0DAh \\
				CCAPM1	& 0DBh	& CCAPM2& 0DCh	& CCAPM3& 0DDh	& CCAPM4& 0DEh \\
				P1M2	& 0E2h	& P3M2	& 0E3h	& P4M2	& 0E4h	& P1M1	& 0D4h \\
				P3M1	& 0D5h	& P4M1	& 0D6h	& SPCON	& 0C3h	& SPSTA	& 0C4h \\
				SPDAT	& 0C5h	& IPL0	& 0B8h	& IPL1	& 0B2h	& IPH1	& 0B3h \\
				IPH0	& 0B7h	& BRL	& 09Ah	& BDRCON& 09Bh	&BDRCON\_1& 09Ch \\
				KBLS	& 09Ch	& KBE	& 09Dh	& KBF	& 09Eh	&SADEN\_0& 0B9h \\
				SADEN\_1& 0BAh	&SADDR\_0& 0A9h	&SADDR\_1& 0AAh	& CKSEL	& 085h \\
				OSCCON	& 086h	& CKRL	& 097h	& CKCON0& 08Fh	&	& \\
				\hline
			\end{tabular}
		\end{table}

	\clearpage
	\section{Segment type}
		Segment type specifies the address space to which a symbol is assigned. For example if you define symbol ABC using ``XDATA'' directive, then ABS is assigned to XDATA segment. Purpose of this is to semantically distinguish between different types of symbols. For example if we use a symbol as address to program memory it has different meaning that if we used it as address to bit addressable area.
		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\begin{tabular}{|ll|}
				\hline
				DATA	& Internal data memory and SFR \\
				IDATA	& Internal data memory only \\
				XDATA	& External data memory only \\
				BIT	& Bit addressable area only \\
				CODE	& Program memory only \\
				NUMBER	& Arbitrary value \\
				\hline
			\end{tabular}
			\caption{Segment types}
		\end{table}

		Symbols might be assigned to these segment types by these directives:
		\begin{itemize}
			\setlength{\itemsep}{-3pt}
			\item DATA (segment DATA)
			\item IDATA (segment IDATA)
			\item XDATA (segment XDATA)
			\item BIT (segment BIT)
			\item CODE (segment CODE)
			\item EQU, SET (segment NUMBER)
		\end{itemize}
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_constant}\verb'MY_A'}\verb'    '{\color{highlight_directive}\verb'DATA'}\verb'    '{\color{highlight_char}\verb''\verb"'"\verb'\n'\verb"'"\verb''}\verb'    '{\color{highlight_comment}\verb'; DATA segment (internal data memory and SFR)'}\\
			{\color{highlight_constant}\verb'MY_B'}\verb'    '{\color{highlight_directive}\verb'IDATA'}\verb'   '{\color{highlight_hex}\verb'0AAH'}\verb'    '{\color{highlight_comment}\verb'; IDATA segment (internal data memory only)'}\\
			{\color{highlight_constant}\verb'MY_C'}\verb'    '{\color{highlight_directive}\verb'XDATA'}\verb'   '{\color{highlight_oct}\verb'14Q'}\verb'     '{\color{highlight_comment}\verb'; XDATA segment (external data memory only)'}\\
			{\color{highlight_constant}\verb'MY_D'}\verb'    '{\color{highlight_directive}\verb'BIT'}\verb'     '{\color{highlight_sfr}\verb'P1'}{\color{highlight_symbol}\verb'.'}{\color{highlight_unknown_base}\verb'2'}\verb'    '{\color{highlight_comment}\verb'; BIT segment (bit addressable area only)'}\\
			{\color{highlight_constant}\verb'MY_E'}\verb'    '{\color{highlight_directive}\verb'CODE'}\verb'    '{\color{highlight_dec}\verb'62348D'}\verb'  '{\color{highlight_comment}\verb'; CODE segment (program memory only)'}\\
			{\color{highlight_constant}\verb'MY_F'}\verb'    '{\color{highlight_directive}\verb'EQU'}\verb'     '{\color{highlight_oct}\verb'242Q'}\verb'    '{\color{highlight_comment}\verb'; Segment NUMBER (arbitrary value)'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; Segment NUMBER (arbitrary value)'}\\
			{\color{highlight_constant}\verb'MY_G'}\verb'    '{\color{highlight_directive}\verb'SET'}\verb'     '{\color{highlight_constant}\verb'MY_A'}\verb' '{\color{highlight_symbol}\verb'+'}\verb' '{\color{highlight_constant}\verb'MY_B'}\verb' '{\color{highlight_symbol}\verb'+'}\verb' '{\color{highlight_constant}\verb'MY_C'}\verb' '{\color{highlight_symbol}\verb'+'}\verb' '{\color{highlight_constant}\verb'MY_D'}\verb' '{\color{highlight_symbol}\verb'+'}\verb' '{\color{highlight_constant}\verb'MY_E'}\verb' '{\color{highlight_symbol}\verb'+'}\verb' '{\color{highlight_constant}\verb'MY_F'}\\
			\caption{Example of symbol definitions}
		\end{code}

		\clearpage
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_comment}\verb'; CODE segment'}\\
			\verb'        '{\color{highlight_directive}\verb'cseg'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_hex}\verb'40h'}\verb'     '{\color{highlight_comment}\verb'; Start this segment at address 40 hexadecimal (64d)'}\\
			{\color{highlight_constant}\verb'my_c'}\verb'    '{\color{highlight_directive}\verb'CODE'}\verb'    '{\color{highlight_hex}\verb'00abch'}\verb'  '{\color{highlight_comment}\verb'; Define an address in code memory'}\\
			{\color{highlight_label}\verb'word:'}\verb'   '{\color{highlight_directive}\verb'DW'}\verb'      '{\color{highlight_hex}\verb'01234h'}\verb'  '{\color{highlight_comment}\verb'; Define a word in code memory, will be written to code memory'}\\
			{\color{highlight_label}\verb'my_cs:'}\verb'  '{\color{highlight_directive}\verb'DB'}\verb'      '{\color{highlight_string}\verb''\verb"'"\verb'abcdef'\verb"'"\verb''}{\color{highlight_comment}\verb'; Define a string in code memory, will be written to code memory'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; DATA segment'}{\color{highlight_macro}\\
			}\verb'        '{\color{highlight_directive}\verb'dseg'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_oct}\verb'10q'}\verb'     '{\color{highlight_comment}\verb'; Start this segment at address 10 octal (8d)'}\\
			{\color{highlight_constant}\verb'my_d'}\verb'    '{\color{highlight_directive}\verb'DATA'}\verb'    '{\color{highlight_char}\verb''\verb"'"\verb'd'\verb"'"\verb''}\verb'     '{\color{highlight_comment}\verb'; Define address in internal data memory or SFR area'}\\
			{\color{highlight_label}\verb'my_ds:'}\verb'  '{\color{highlight_directive}\verb'DS'}\verb'      '{\color{highlight_unknown_base}\verb'4'}\verb'       '{\color{highlight_comment}\verb'; Reserve 4 bytes here and set ``my_ds'\verb"'"\verb''\verb"'"\verb' to point there'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; IDATA segment'}{\color{highlight_constant}\\
			}\verb'        '{\color{highlight_directive}\verb'iseg'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_dec}\verb'10d'}\verb'     '{\color{highlight_comment}\verb'; Start this segment at address 10 decimal'}\\
			{\color{highlight_constant}\verb'my_i'}\verb'    '{\color{highlight_directive}\verb'IDATA'}\verb'   '{\color{highlight_char}\verb''\verb"'"\verb'i'\verb"'"\verb''}\verb'     '{\color{highlight_comment}\verb'; Define address in internal data memory'}\\
			{\color{highlight_label}\verb'my_is:'}\verb'  '{\color{highlight_directive}\verb'DS'}\verb'      '{\color{highlight_unknown_base}\verb'4'}\verb'       '{\color{highlight_comment}\verb'; Reserve 4 bytes here and set ``my_is'\verb"'"\verb''\verb"'"\verb' to point there'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; BIT segment'}\\
			\verb'        '{\color{highlight_directive}\verb'bseg'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_bin}\verb'10b'}\verb'     '{\color{highlight_comment}\verb'; Start this segment at address 10 binary (2d)'}\\
			{\color{highlight_constant}\verb'my_bit'}\verb'  '{\color{highlight_directive}\verb'BIT'}\verb'     '{\color{highlight_char}\verb''\verb"'"\verb'b'\verb"'"\verb''}\verb'     '{\color{highlight_comment}\verb'; Define address in bit addressable area'}\\
			{\color{highlight_label}\verb'my_bs:'}\verb'  '{\color{highlight_directive}\verb'dbit'}\verb'    '{\color{highlight_unknown_base}\verb'4'}\verb'       '{\color{highlight_comment}\verb'; Reserve 4 bits here and set ``my_bs'\verb"'"\verb''\verb"'"\verb' to point there'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; XDATA segment'}{\color{highlight_constant}\\
			}\verb'        '{\color{highlight_directive}\verb'xseg'}\verb' '{\color{highlight_constant}\verb'at'}\verb' '{\color{highlight_unknown_base}\verb'10'}\verb'      '{\color{highlight_comment}\verb'; Start this segment at address 10 decimal'}\\
			{\color{highlight_constant}\verb'my_x'}\verb'    '{\color{highlight_directive}\verb'XDATA'}\verb'   '{\color{highlight_char}\verb''\verb"'"\verb'x'\verb"'"\verb''}\verb'     '{\color{highlight_comment}\verb'; Define address in external data memory'}\\
			{\color{highlight_label}\verb'my_xs:'}\verb'  '{\color{highlight_directive}\verb'DS'}\verb'      '{\color{highlight_unknown_base}\verb'4'}\verb'       '{\color{highlight_comment}\verb'; Reserve 4 bytes here and set ``my_xs'\verb"'"\verb''\verb"'"\verb' to point there'}\\
			\verb''\\
			\verb''\\
			{\color{highlight_constant}\verb'address'}\verb' '{\color{highlight_directive}\verb'equ'}\verb'     '{\color{highlight_hex}\verb'0h'}\verb'      '{\color{highlight_comment}\verb'; Define symbol ``address'\verb"'"\verb' in the NUMBER segment'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'org'}\verb'     '{\color{highlight_constant}\verb'address'}\verb' '{\color{highlight_comment}\verb'; Start writing program code at address defined by symbol ``address'\verb"'"\verb''\verb"'"\verb''}\\
			\verb''\\
			\verb'        '{\color{highlight_comment}\verb'; Clear 1st bit in BIT array ``my_bs'\verb"'"\verb''\verb"'"\verb''}\\
			\verb'        '{\color{highlight_instruction}\verb'clr'}\verb'     '{\color{highlight_constant}\verb'my_bs'}{\color{highlight_symbol}\verb'+'}{\color{highlight_unknown_base}\verb'1'}\\
			\verb''\\
			\verb'        '{\color{highlight_comment}\verb'; Move 10d to 2nd byte in DATA array ``my_ds'\verb"'"\verb''\verb"'"\verb''}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_constant}\verb'my_ds'}{\color{highlight_symbol}\verb'+'}{\color{highlight_unknown_base}\verb'2'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#10d'}\\
			\verb''\\
			\verb'        '{\color{highlight_comment}\verb'; Move 88d to 3rd byte in IDATA array ``my_is'\verb"'"\verb''\verb"'"\verb''}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_constant}\verb'my_is'}{\color{highlight_symbol}\verb'+'}{\color{highlight_unknown_base}\verb'3'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#88d'}\\
			\verb''\\
			\verb'        '{\color{highlight_comment}\verb'; Move 55h to 0th byte in XDATA array ``my_xs'\verb"'"\verb''\verb"'"\verb''}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#55h'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'DPTR'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_symbol}\verb'#('}\verb' '{\color{highlight_constant}\verb'my_xs'}\verb' '{\color{highlight_symbol}\verb'+'}\verb' '{\color{highlight_unknown_base}\verb'0'}\verb' '{\color{highlight_symbol}\verb')'}\\
			\verb'        '{\color{highlight_instruction}\verb'movx'}\verb'    '{\color{highlight_indirect}\verb'@DPTR'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'A'}\\
			\verb''\\
			\verb'        '{\color{highlight_comment}\verb'; Read 1st byte from CODE array ``my_cs'\verb"'"\verb''\verb"'"\verb''}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'DPTR'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_constant}\verb'#my_cs'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_unknown}\verb'#1'}\\
			\verb'        '{\color{highlight_instruction}\verb'movc'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@A+DPTR'}\\
			\verb''\\
			\verb'        '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'$'}\verb'       '{\color{highlight_comment}\verb'; Infinite loop (``$'\verb"'"\verb''\verb"'"\verb' stands for address of current instruction)'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'end'}\verb'             '{\color{highlight_comment}\verb'; End of assembly, everything after this directive is ignored'}\\
			\caption{Example of address space reservation}
		\end{code}

	\section{Conditional Assembly}
		The aim of conditional assembly to to assemble certain parts of the code if and only if certain arithmetically expressed condition is met. This feature can prove useful particularly when the user want to make the code somehow ``configurable''. This assembler provides these instructions to work with conditional assembly:
		\begin{itemize}
			\setlength{\itemsep}{-3pt}
			\item IF <condition>
			\item IFN <condition>
			\item IFDEF <symbol>
			\item IFNDEF <symbol>
			\item ELSE
			\item ELSEIF <condition>
			\item ELSEIFN <condition>
			\item ELSEIFDEF <symbol>
			\item ELSEIFNDEF <symbol>
			\item ENDIF
		\end{itemize}

		This can be best demonstrated on an example:
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_constant}\verb'abc'}\verb'     '{\color{highlight_directive}\verb'equ'}\verb'     '{\color{highlight_unknown_base}\verb'16'}\verb'              '{\color{highlight_comment}\verb'; Assign number 14 to symbol abc'}\\
			{\color{highlight_constant}\verb'xyz'}\verb'     '{\color{highlight_directive}\verb'equ'}\verb'     '{\color{highlight_unknown_base}\verb'10'}\verb'              '{\color{highlight_comment}\verb'; Assign number 10 to symbol abc'}\\
			\verb''\\
			{\color{highlight_directive}\verb'ifdef'}\verb' '{\color{highlight_constant}\verb'abc'}\verb'                       '{\color{highlight_comment}\verb';<--+ Assemble only if symbol abc has been defined'}\\
			\verb'  '{\color{highlight_directive}\verb'if'}\verb' '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_constant}\verb'abc'}\verb' '{\color{highlight_symbol}\verb'='}\verb' '{\color{highlight_unknown_base}\verb'13'}\verb' '{\color{highlight_symbol}\verb')'}\verb'               '{\color{highlight_comment}\verb';   | <--+ Assemble if 13 has been assigned to symbol abc'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_bin}\verb'#01010101b'}\verb'   '{\color{highlight_comment}\verb';   |    |'}\\
			\verb'  '{\color{highlight_directive}\verb'elseif'}\verb' '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_constant}\verb'abc'}\verb' '{\color{highlight_symbol}\verb'='}\verb' '{\color{highlight_unknown_base}\verb'14'}\verb' '{\color{highlight_symbol}\verb')'}\verb'           '{\color{highlight_comment}\verb';   | <--+ Assemble if 14 has been assigned to symbol abc'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0aah'}\verb'        '{\color{highlight_comment}\verb';   |    |'}\\
			\verb'  '{\color{highlight_directive}\verb'elseifn'}\verb' '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_constant}\verb'abc'}\verb' '{\color{highlight_symbol}\verb'%'}\verb' '{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb')'}\verb'           '{\color{highlight_comment}\verb';   | <--+ Assemble if the value assigned to symbol abc is even'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_constant}\verb'#abc'}\verb'         '{\color{highlight_comment}\verb';   |    |'}\\
			\verb'  '{\color{highlight_directive}\verb'else'}\verb'                          '{\color{highlight_comment}\verb';   | <--+ Else ..'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_oct}\verb'#377q'}\verb'        '{\color{highlight_comment}\verb';   |    |'}\\
			\verb'  '{\color{highlight_directive}\verb'endif'}\verb'                         '{\color{highlight_comment}\verb';   | <--+'}\\
			{\color{highlight_directive}\verb'elseifndef'}\verb' '{\color{highlight_constant}\verb'xyz'}\verb'                  '{\color{highlight_comment}\verb';<--+ Assemble if symbol xyz has NOT been defined'}\\
			\verb'        '{\color{highlight_instruction}\verb'clr'}\verb'     '{\color{highlight_sfr}\verb'A'}\verb'               '{\color{highlight_comment}\verb';   |'}\\
			{\color{highlight_directive}\verb'else'}\verb'                            '{\color{highlight_comment}\verb';<--+ Else ...'}\\
			\verb'  '{\color{highlight_directive}\verb'ifn'}\verb' '{\color{highlight_symbol}\verb'('}{\color{highlight_constant}\verb'xyz'}{\color{highlight_symbol}\verb' mod'}\verb' '{\color{highlight_unknown_base}\verb'2'}{\color{highlight_symbol}\verb')'}\verb'               '{\color{highlight_comment}\verb';   | <--+ Assemble if ( yxz modulo 2 ) is 0'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#128d'}\verb'        '{\color{highlight_comment}\verb';   |    |'}\\
			\verb'  '{\color{highlight_directive}\verb'endif'}\verb'                         '{\color{highlight_comment}\verb';   | <--+'}\\
			{\color{highlight_directive}\verb'endif'}\verb'                           '{\color{highlight_comment}\verb';<--+'}\\
			\verb''\\
			{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'$'}\verb'                       '{\color{highlight_comment}\verb'; Infinite loop'}\\
			{\color{highlight_directive}\verb'end'}\verb'                             '{\color{highlight_comment}\verb'; End of assembly'}\\
			\caption{An example of conditional assembly usage}
		\end{code}

	\clearpage
	\section{Macro Processing}
		Macro is a sequence of instructions which can be expanded anywhere in the code and for any number of times. That may reduce necessity of repeating code fragments as well as source code size and make the solved task easier to comprehend and solve. Unlike subprograms macros do not add extra run-time overhead and repeating usage of macros may significantly increase size of the resulting machine code. Macros supported by this assembler are divided to named and unnamed ones.

		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\begin{tabular}{|ll|}
				\hline
				MACRO	& Define a new named macro \\
				REPT	& Define a new unnamed macro and expand it right away for the specified number of times \\
				TIMES	& Exactly the same as ``REPT'' \\
				ENDM	& End of macro definition \\
				\hline
			\end{tabular}
			\caption{Directives directly related to macros}
		\end{table}

		This can be well demonstrated on examples:
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_directive}\verb'rept'}\verb'    '{\color{highlight_unknown_base}\verb'3'}\verb'       '{\color{highlight_comment}\verb'; Repeat the code 3 times'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			{\color{highlight_directive}\verb'endm'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; This is the same as if you wrote this:'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			\caption{An exaple of REPT directive}
		\end{code}
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_macro}\verb'abc'}\verb'     '{\color{highlight_directive}\verb'macro'}\verb'   '{\color{highlight_comment}\verb'; Define named macro ``abc'\verb"'"\verb''\verb"'"\verb''}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			{\color{highlight_directive}\verb'endm'}\\
			\verb''\\
			{\color{highlight_macro}\verb'abc'}\verb'     '{\color{highlight_comment}\verb'; Expand macro ``abc'\verb"'"\verb''\verb"'"\verb' here'}\\
			{\color{highlight_macro}\verb'abc'}\verb'     '{\color{highlight_comment}\verb'; Expand macro ``abc'\verb"'"\verb''\verb"'"\verb' here'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; This is the same as if you wrote this:'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			\caption{An exaple of simple named macro}
		\end{code}
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_comment}\verb'; Define macro named as ``xyz'\verb"'"\verb''\verb"'"\verb' with 2 mandatory parameters'}\\
			{\color{highlight_macro}\verb'xyz'}\verb'     '{\color{highlight_directive}\verb'macro'}\verb'   '{\color{highlight_constant}\verb'foo'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'bar'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_constant}\verb'foo'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#10h'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_constant}\verb'bar'}\\
			{\color{highlight_directive}\verb'endm'}\\
			\verb''\\
			{\color{highlight_macro}\verb'xyz'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'c'}\verb'            '{\color{highlight_comment}\verb'; Expand macro ``xyz'\verb"'"\verb''\verb"'"\verb' here'}\\
			{\color{highlight_macro}\verb'xyz'}\verb'     '{\color{highlight_sfr}\verb'p0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p1'}{\color{highlight_symbol}\verb'.'}{\color{highlight_unknown_base}\verb'0'}\verb'        '{\color{highlight_comment}\verb'; Expand macro ``xyz'\verb"'"\verb''\verb"'"\verb' here'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; This is the same as if you wrote this:'\\
			}\verb'        '{\color{highlight_comment}\verb'; xyz   a, c'\\
			}\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#10h'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'c'}\\
			\verb'        '{\color{highlight_comment}\verb'; xyz   p0, p1.0'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#10h'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_symbol}\verb'.'}{\color{highlight_unknown_base}\verb'0'}\\
			\caption{An exaple of named macro with two parameters}
		\end{code}
		\begin{code}[h!]
			\mysmallfont{}{\color{highlight_macro}\verb'ijk'}\verb'     '{\color{highlight_directive}\verb'macro'}\verb'   '{\color{highlight_constant}\verb'foo'}\\
			\verb'        '{\color{highlight_instruction}\verb'add'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@R0'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'if'}\verb' '{\color{highlight_constant}\verb'foo'}\verb' '{\color{highlight_symbol}\verb'='}\verb' '{\color{highlight_dec}\verb'4d'}\\
			\verb'                '{\color{highlight_instruction}\verb'nop'}\\
			\verb'        '{\color{highlight_directive}\verb'endif'}\\
			\verb''\\
			\verb'        '{\color{highlight_instruction}\verb'subb'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_constant}\verb'#foo'}\\
			{\color{highlight_directive}\verb'endm'}\\
			\verb''\\
			{\color{highlight_macro}\verb'ijk'}\verb'     '{\color{highlight_unknown_base}\verb'5'}\\
			{\color{highlight_macro}\verb'ijk'}\verb'     '{\color{highlight_unknown_base}\verb'4'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; This is the same as if you wrote this:'}\\
			\verb'        '{\color{highlight_comment}\verb'; ijk   5'}\\
			\verb'        '{\color{highlight_instruction}\verb'add'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_directive}\verb'if'}\verb' '{\color{highlight_unknown_base}\verb'5'}\verb' '{\color{highlight_symbol}\verb'='}\verb' '{\color{highlight_dec}\verb'4d'}\\
			\verb'        '{\color{highlight_instruction}\verb'nop'}\\
			\verb'        '{\color{highlight_directive}\verb'endif'}\\
			\verb'        '{\color{highlight_instruction}\verb'subb'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_unknown}\verb'#5'}\\
			\verb'        '{\color{highlight_comment}\verb'; ijk   4'}\\
			\verb'        '{\color{highlight_instruction}\verb'add'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_directive}\verb'if'}\verb' '{\color{highlight_unknown_base}\verb'4'}\verb' '{\color{highlight_symbol}\verb'='}\verb' '{\color{highlight_dec}\verb'4d'}\\
			\verb'        '{\color{highlight_instruction}\verb'nop'}\\
			\verb'        '{\color{highlight_directive}\verb'endif'}\\
			\verb'        '{\color{highlight_instruction}\verb'subb'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_unknown}\verb'#4'}\\
			\caption{An exaple of named macro used with if statement}
		\end{code}
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_comment}\verb'; Suppose we have these macros:'}\\
			{\color{highlight_macro}\verb'abc'}\verb'     '{\color{highlight_directive}\verb'macro'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			{\color{highlight_directive}\verb'endm'}\\
			{\color{highlight_macro}\verb'ijk'}\verb'     '{\color{highlight_directive}\verb'macro'}\verb'   '{\color{highlight_constant}\verb'foo'}\\
			\verb'        '{\color{highlight_instruction}\verb'add'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@R0'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'if'}\verb' '{\color{highlight_constant}\verb'foo'}\verb' '{\color{highlight_symbol}\verb'='}\verb' '{\color{highlight_dec}\verb'4d'}\\
			\verb'                '{\color{highlight_instruction}\verb'nop'}\\
			\verb'        '{\color{highlight_directive}\verb'endif'}\\
			\verb''\\
			\verb'        '{\color{highlight_instruction}\verb'subb'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_constant}\verb'#foo'}\\
			{\color{highlight_directive}\verb'endm'}\\
			{\color{highlight_macro}\verb'xyz'}\verb'     '{\color{highlight_directive}\verb'macro'}\verb'   '{\color{highlight_constant}\verb'foo'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'bar'}\\
			\verb'        '{\color{highlight_macro}\verb'ijk'}\verb'     '{\color{highlight_constant}\verb'foo'}\\
			\verb'        '{\color{highlight_macro}\verb'ijk'}\verb'     '{\color{highlight_constant}\verb'bar'}\\
			\verb''\\
			\verb'        '{\color{highlight_macro}\verb'abc'}\\
			{\color{highlight_directive}\verb'endm'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; And we expand ``xyz'\verb"'"\verb''\verb"'"\verb' like this:'}\\
			{\color{highlight_macro}\verb'xyz'}\verb'     '{\color{highlight_unknown_base}\verb'4'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_unknown_base}\verb'5'}\\
			\verb''\\
			{\color{highlight_comment}\verb'; Then we get this result:'}\\
			\verb'        '{\color{highlight_comment}\verb'; ijk     4'}\\
			\verb'        '{\color{highlight_instruction}\verb'add'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'nop'}\verb'     '{\color{highlight_comment}\verb'; <-- Note this'}\\
			\verb'        '{\color{highlight_instruction}\verb'subb'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_unknown}\verb'#4'}\\
			\verb'        '{\color{highlight_comment}\verb'; ijk     5'}\\
			\verb'        '{\color{highlight_instruction}\verb'add'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'subb'}\verb'    '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_unknown}\verb'#5'}\\
			\verb'        '{\color{highlight_comment}\verb'; abc'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			\caption{An exaple of nested macros}
		\end{code}
		\begin{code}[h!]
			\mysmallfont{}
			{\color{highlight_macro}\verb'abc'}\verb'     '{\color{highlight_directive}\verb'macro'}\\
			{\color{highlight_comment}\verb'  ; Unnamed macro cannot be contained inside a named one'}\\
			\verb'  '{\color{highlight_directive}\verb'times'}\verb' '{\color{highlight_unknown_base}\verb'2'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p1'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			\verb'  '{\color{highlight_directive}\verb'endm'}\\
			{\color{highlight_directive}\verb'endm'}\\
			\caption{An exaple of nested macros, which will not work}
		\end{code}

	\clearpage
	\section{Reserved keywords}
		\flushbottom
		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Special instruction operands}
			\begin{tabular}{|ll|}
				\hline
				\$	& Location counter \\
				A	& Accumulator \\
				AB	& A/B register pair \\
				C	& Carry flag (in PSW register) \\
				DPTR	& Data pointer \\
				PC	& Program counter \\
				R0..R7	& Registers \\
				\hline
			\end{tabular}
		\end{table}
		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Instruction mnemonics}
			\begin{tabular}{|lllllllll|}
				\hline
				ACALL	& ADD	& ADDC	& AJMP	& ANL	& CJNE	& CLR	& CPL	& DA	\\
				DEC	& DIV	& DJNZ	& INC	& JB	& JBC	& JC	& JMP	& JNB	\\
				JNZ	& SJMP	& JNC	& CALL	& JZ	& LCALL	& LJMP	& MOV	& MOVC	\\
				MOVX	& MUL	& NOP	& ORL	& POP	& PUSH	& RET	& RETI	& RL	\\
				RLC	& RR	& RRC	& SETB	& SUBB	& SWAP	& XCH	& XCHD	& XRL	\\
				\hline
			\end{tabular}
		\end{table}
		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Directives}
			\begin{tabular}{|lllll|}
				\hline
				BIT		& BSEG		& BYTE		& CODE		& CSEG		\\
				DATA		& DB		& DBIT		& DS		& DSEG		\\
				DW		& ELSE		& ELSEIF	& ELSEIFDEF	& ELSEIFN	\\
				ELSEIFNDEF	& END		& ENDIF		& ENDM		& EQU		\\
				FLAG		& IDATA		& IF		& IFDEF		& IFN		\\
				IFNDEF		& INCLUDE	& ISEG		& LIST		& MACRO		\\
				NAME		& NOLIST	& ORG		& REPT		& SET		\\
				SKIP		& TIMES		& USING		& XDATA		& XSEG		\\
				\hline
			\end{tabular}
		\end{table}
		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Expression operators}
			\begin{tabular}{|lllll|}
				\hline
				AND	& EQ	& GE	& GT	& HIGH	\\
				LE	& LOW	& LT	& MOD	& NE	\\
				NOT	& OR	& SHL	& SHR	& XOR	\\
				\hline
			\end{tabular}
		\end{table}
		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Assembler controls}
			\begin{tabular}{|llll|}
				\hline
				DA		& DATE		& EJ		& EJECT		\\
				LI		& LIST		& NOLI		& NOLIST	\\
				NOMACROSFIRST	& NOMO		& NOMOD		& NOMOD51	\\
				NOOBJECT	& NOPAGING	& NOPI		& NOPRINT	\\
				NOSB		& NOSYMBOLS	& OBJECT	& PAGELENGTH	\\
				PAGEWIDTH	& PAGING	& PI		& PL		\\
				PRINT		& PW		& SB		& SYMBOLS	\\
				TITLE		& TT		&		&		\\
				\hline
			\end{tabular}
		\end{table}

	\clearpage
	\section{Compatibility with ASEM-51}
		Not yet specified.

	\clearpage
	\section{List File Format}
		Code listing serves as an additional information about the assembled code and the progress of the assembly process. It contains information about all symbols defined in the code. Where and how were they were defined, what are their values and whether they were used in the code. Also detailed information about all macros defined in the code and/or expanded in the code. Conditional compilation configuration, instruction OP codes, address space reservations, inclusion of code from another files. And all warnings, errors and notes generated during the assembly by the assembler. There are assembler control sequences which alters formatting of the code listing file. These control sequences will be discussed here. Format of code listing generated by this assembler is very similar to the one generated Metalink\textregistered ASM51.
		\begin{code}[h]
			\mysmallfont{}
			\verb'demo0                                                                                                                   '{\color{highlight_macro}\verb'PAGE'}\verb' '{\color{highlight_unknown_base}\verb'1'}\\
			{\color{highlight_lst_line}\verb'                         1'}\verb'     '{\color{highlight_comment}\verb'; MCU 8051 IDE - Demostration code'}\\
			{\color{highlight_lst_line}\verb'                         2'}\verb'     '{\color{highlight_comment}\verb'; Very simple code'}\\
			{\color{highlight_lst_line}\verb'                         3'}\\
			{\color{highlight_lst_line}\verb'                         4'}\verb'     '{\color{highlight_comment}\verb'; Press F2 and F6 to run the program (start simulator and animate)'}\\
			{\color{highlight_lst_line}\verb'                         5'}\\
			{\color{highlight_lst_line}\verb'                         6'}\verb'             '{\color{highlight_directive}\verb'org'}\verb'     '{\color{highlight_hex}\verb'0h'}\\
			{\color{highlight_lst_line}\verb'                         7'}\\
			{\color{highlight_lst_address}\verb'0000'}{\color{highlight_lst_code}\verb' 08'}{\color{highlight_lst_line}\verb'                  8'}\verb'     '{\color{highlight_label}\verb'main:'}\verb'   '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_sfr}\verb'R0'}\\
			{\color{highlight_lst_address}\verb'0001'}{\color{highlight_lst_code}\verb' 06'}{\color{highlight_lst_line}\verb'                  9'}\verb'             '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_indirect}\verb'@R0'}\\
			{\color{highlight_lst_address}\verb'0002'}{\color{highlight_lst_code}\verb' B87FFB'}{\color{highlight_lst_line}\verb'             10'}\verb'             '{\color{highlight_instruction}\verb'cjne'}\verb'    '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#07Fh'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'main'}\\
			{\color{highlight_lst_address}\verb'0005'}{\color{highlight_lst_code}\verb' 7800'}{\color{highlight_lst_line}\verb'               11'}\verb'             '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#0d'}\\
			{\color{highlight_lst_address}\verb'0007'}{\color{highlight_lst_code}\verb' 80F7'}{\color{highlight_lst_line}\verb'               12'}\verb'             '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'main'}\\
			{\color{highlight_lst_line}\verb'                        13'}\\
			{\color{highlight_lst_line}\verb'                        14'}\verb'             '{\color{highlight_directive}\verb'end'}\\
			{\color{highlight_lst_msg}\verb'ASSEMBLY COMPLETE,'}\verb' NO ERRORS FOUND, NO WARNINGS'\\
			\caption{A simple code listing}
		\end{code}
		Code listing contains entire source code which was assembled but with each line prefixed with line number and some additional information which will be explained later. Besides the original code there is also table of symbols defined during the assembly unless it was turned off. Code listing is divided into pages separated by form feed character, this behavior may be altered by certain assembler control sequences as well as page height and width.

		Each line of code listing which contains original source code line may contain beside line number also some additional information regarding the compilation of the given line of code. Such a additional information might look like this and is composed of these parts:

		\begin{code}[h]
			\verb'  '\texttt{\colorbox{Lavender}{0055}}\verb'                   '\texttt{\colorbox{Goldenrod}{18}}\verb'      '\texttt{\colorbox{Gray}{X      data     55h}} \\
			\texttt{\colorbox{Apricot}{0014}}\verb' '\texttt{\colorbox{GreenYellow}{1122}}\verb'       '\texttt{\colorbox{LimeGreen}{=1}}\verb'     '\texttt{\colorbox{Goldenrod}{33}}\verb'      '\texttt{\colorbox{Gray}{l:     inc      A}} \\
			\verb'                          '\texttt{\colorbox{Goldenrod}{35}}\verb' '\texttt{\colorbox{ProcessBlue}{+1}}\verb'  '\texttt{\colorbox{Gray}{abc     ; Expand macro ``abc'' here}} \\
			\texttt{\colorbox{Apricot}{001E}}\verb' '\texttt{\colorbox{GreenYellow}{E580}}\verb'               '\texttt{\colorbox{Goldenrod}{36}}\verb' '\texttt{\colorbox{ProcessBlue}{+1}}\verb'  '\texttt{\colorbox{Gray}{                mov     a, p0}} \\
			\texttt{\colorbox{Apricot}{0020}}\verb' '\texttt{\colorbox{GreenYellow}{F4}}\verb'                 '\texttt{\colorbox{Goldenrod}{37}}\verb' '\texttt{\colorbox{ProcessBlue}{+1}}\verb'  '\texttt{\colorbox{Gray}{                cpl     a}} \\
			\texttt{\colorbox{Apricot}{0021}}\verb' '\texttt{\colorbox{GreenYellow}{F590}}\verb'               '\texttt{\colorbox{Goldenrod}{38}}\verb' '\texttt{\colorbox{ProcessBlue}{+1}}\verb'  '\texttt{\colorbox{Gray}{                mov     p1, a}} \\\\
			\colorbox{Goldenrod}{\color{Goldenrod}X} Line number \\
			\colorbox{LimeGreen}{\color{LimeGreen}X} Level of file inclusion \\
			\colorbox{ProcessBlue}{\color{ProcessBlue}X} Level of macro expansion \\
			\colorbox{Apricot}{\color{Apricot}X} Address in code memory \\
			\colorbox{GreenYellow}{\color{GreenYellow}X} Machine code or another value to be stored in the code memory \\
			\colorbox{Lavender}{\color{Lavender}X} Value of a symbol \\
			\colorbox{Gray}{\color{Gray}X} Original line \\

			\caption{Explanation code listing format}
		\end{code}

		\begin{code}[h]
			\mysmallfont{}
			\verb'complicated_lst                                                                                                         '{\color{highlight_macro}\verb'PAGE'}\verb' '{\color{highlight_unknown_base}\verb'1'}\\
			{\color{highlight_lst_number}\verb'  001C'}{\color{highlight_lst_line}\verb'                   1'}\verb'     '{\color{highlight_constant}\verb'abc'}\verb'     '{\color{highlight_directive}\verb'equ'}\verb'     '{\color{highlight_symbol}\verb'('}\verb' '{\color{highlight_unknown_base}\verb'14'}\verb' '{\color{highlight_symbol}\verb'*'}\verb' '{\color{highlight_unknown_base}\verb'2'}\verb' '{\color{highlight_symbol}\verb')'}\verb'      '{\color{highlight_comment}\verb'; Define symbol abc'}\\
			{\color{highlight_lst_line}\verb'                         2'}\verb'             '{\color{highlight_directive}\verb'org'}\verb'     '{\color{highlight_unknown_base}\verb'0'}\verb'               '{\color{highlight_comment}\verb'; Start writing code at address 0'}\\
			{\color{highlight_lst_line}\verb'                         3'}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'      4'}\verb'             '{\color{highlight_directive}\verb'include'}\verb' '{\color{highlight_string}\verb''\verb"'"\verb'my_macros.asm'\verb"'"\verb' '{\color{highlight_comment}\verb'; Include file my_macros.asm'}}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'      5'}\verb'     '{\color{highlight_comment}\verb'; This is the beginning of file my_macros.asm'}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'      6'}\verb'     '{\color{highlight_macro}\verb'my_cpl'}\verb'  '{\color{highlight_directive}\verb'macro'}\verb'   '{\color{highlight_constant}\verb'foo'}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'      7'}\verb'             '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'foo'}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'      8'}\verb'             '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'A'}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'      9'}\verb'             '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_constant}\verb'foo'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'A'}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'     10'}\verb'     '{\color{highlight_directive}\verb'endm'}\\
			{\color{highlight_lst_include}\verb'                 =1'}{\color{highlight_lst_line}\verb'     11'}\verb'     '{\color{highlight_comment}\verb'; This is the end of file my_macros.asm'}\\
			{\color{highlight_lst_line}\verb'                        12'}\\
			{\color{highlight_lst_line}\verb'                        13'}{\color{highlight_lst_macro}\verb' +1'}\verb'  '{\color{highlight_label}\verb'main:'}\verb'   '{\color{highlight_macro}\verb'my_cpl'}\verb'  '{\color{highlight_sfr}\verb'P0'}\verb'              '{\color{highlight_comment}\verb'; Expand macro my_cpl here'}\\
			{\color{highlight_lst_address}\verb'0000'}{\color{highlight_lst_code}\verb' E580'}{\color{highlight_lst_line}\verb'               14'}{\color{highlight_lst_macro}\verb' +1'}\verb'                  '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'a'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'p0'}\\
			{\color{highlight_lst_address}\verb'0002'}{\color{highlight_lst_code}\verb' F4'}{\color{highlight_lst_line}\verb'                 15'}{\color{highlight_lst_macro}\verb' +1'}\verb'                  '{\color{highlight_instruction}\verb'cpl'}\verb'     '{\color{highlight_sfr}\verb'a'}\\
			{\color{highlight_lst_address}\verb'0003'}{\color{highlight_lst_code}\verb' F580'}{\color{highlight_lst_line}\verb'               16'}{\color{highlight_lst_macro}\verb' +1'}\verb'                  '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'p0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'a'}\\
			{\color{highlight_lst_address}\verb'0005'}{\color{highlight_lst_code}\verb' 80F9'}{\color{highlight_lst_line}\verb'               17'}\verb'             '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'main'}\verb'            '{\color{highlight_comment}\verb'; Jump back to label main'}\\
			{\color{highlight_lst_line}\verb'                        18'}\verb'             '{\color{highlight_directive}\verb'end'}\verb'                     '{\color{highlight_comment}\verb'; End of assembly'}\\
			{\color{highlight_lst_msg}\verb'ASSEMBLY COMPLETE,'}\verb' NO ERRORS FOUND, NO WARNINGS'\\
			\caption{A more complicated example of code listing}
		\end{code}

		Control sequences affecting format of the generated code listing.
		\begin{table}[h!]
			\centering{}
			\mysmallfont{}
			\caption{Control sequences affecting code listing}
			\begin{tabular}{|llll|}
				\hline
				\$eject		& \$ej		& \$nolist	& \$noli	\\
				\$list		& \$li		& \$paging	& \$pi		\\
				\$nopaging	& \$nopi	& \$pagewidth	& \$pw		\\
				\$pagelength	& \$pl		& \$title	& \$tt		\\
				\$date		& \$da		& \$nosb	& \$nosymbols	\\
				\$noprint	& \$symbols	& \$sb		& \$print	\\
				\hline
			\end{tabular}
		\end{table}

	\clearpage
	\section{Specification of Intel\textregistered 8 HEX Format}
		Intel\textregistered 8 HEX is a popular object file format capable of containing up to 64kB of data. Hex files have usually extension \fileextension{.hex} or \fileextension{.ihx}. These files are text files consisting of a sequence of records, each line line can contain at most one record. Records starts with ``:'' (colon) character at the beginning of the line and ends by end of the line. Everything else besides records should be ignored. Records consist of a sequence of 8-bit hexadecimal numbers (e.g. ``a2'' or ``8c''). These numbers are divided into ``fields'' with different meaning, see the example below.

 		\begin{code}[h]
 			\caption{An example of an Intel\textregistered 8 hex code}
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{0F}\colorbox{ProcessBlue}{0000}\colorbox{Apricot}{00}\colorbox{GreenYellow}{E580F4F590E580F4F590E580F4F590}\colorbox{Lavender}{57}}\\
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{0F}\colorbox{ProcessBlue}{000F}\colorbox{Apricot}{00}\colorbox{GreenYellow}{E580F4F590E580F4F590E580F4F590}\colorbox{Lavender}{48}}\\
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{0F}\colorbox{ProcessBlue}{001E}\colorbox{Apricot}{00}\colorbox{GreenYellow}{E580F4F590E580F4F590E580F4F590}\colorbox{Lavender}{39}}\\
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{10}\colorbox{ProcessBlue}{002D}\colorbox{Apricot}{00}\colorbox{GreenYellow}{E580F4F5907410B3758010B2907410B3}\colorbox{Lavender}{30}}\\
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{10}\colorbox{ProcessBlue}{003D}\colorbox{Apricot}{00}\colorbox{GreenYellow}{758010B2902694052600940426940526}\colorbox{Lavender}{0A}}\\
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{10}\colorbox{ProcessBlue}{004D}\colorbox{Apricot}{00}\colorbox{GreenYellow}{00940426009404269405E580F4F59026}\colorbox{Lavender}{8A}}\\
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{0B}\colorbox{ProcessBlue}{005D}\colorbox{Apricot}{00}\colorbox{GreenYellow}{009404269405E580F4F590}\colorbox{Lavender}{63}}\\
			\texttt{\colorbox{Goldenrod}{:}\colorbox{LimeGreen}{00}\colorbox{ProcessBlue}{0000}\colorbox{Apricot}{01}\colorbox{Lavender}{FF}}\\\\
			\colorbox{Goldenrod}{\color{Goldenrod}X} Start code\\
			\colorbox{LimeGreen}{\color{LimeGreen}X} Byte count\\
			\colorbox{ProcessBlue}{\color{ProcessBlue}X} Address\\
			\colorbox{Apricot}{\color{Apricot}X} Record type\\
			\colorbox{GreenYellow}{\color{GreenYellow}X} Data\\
			\colorbox{Lavender}{\color{Lavender}X} Checksum (two's complement of 8-bit sum of entire record, except for the start code and the checksum itself)
		\end{code}

		Record types available in Intel\textregistered 8 HEX
		\begin{description}
			\item[00] Data record
			\item[01] End of file record
 		\end{description}

\chapter{Disassembler}
	Disassembler is a tool intended to generate assembly language code from an object file. In other words it has certain level of capability of reversing the assembly process and regaining the original source code from any object code. But there are some restriction to that capability and the whole thing is not so simple after all. So let's discuss disassembly process deeper. In MCU~8051~IDE you can invoke disassembler from the main menu  ``\menuitem{Main Menu}'' $\rightarrow$  ``\menuitem{Tools}'' $\rightarrow$  ``\menuitem{Disassemble}''.

	\bigskip
	\noindent
	\begin{center}
		\small{A simple example of a code generated by disassembler}
	\end{center}
	\begin{minipage}{\textwidth}
		\twocolumn
		\begin{minipage}[t]{.6\textwidth}
			\mysmallfont{}
			\textbf{Original code:}\\
			\verb'        '{\color{highlight_directive}\verb'org'}\verb'     '{\color{highlight_hex}\verb'0h'}\verb'      '{\color{highlight_comment}\verb'; Start at address 0x00'}\\
			\verb''\\
			{\color{highlight_label}\verb'main:'}\verb'   '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_sfr}\verb'R0'}\verb'      '{\color{highlight_comment}\verb'; Increment R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cjne'}\verb'    '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#07Fh'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'main'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#0d'}\verb' '{\color{highlight_comment}\verb';'}\\
			\verb'        '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'main'}\verb'    '{\color{highlight_comment}\verb'; Jump back to label main'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'end'}\verb'             '{\color{highlight_comment}\verb'; End of assembly'}\\
		\end{minipage}\begin{minipage}[t]{.4\textwidth}
			\mysmallfont{}
			\textbf{Code generated by disassembler}\\
			\verb'        '{\color{highlight_directive}\verb'ORG'}\verb'     '{\color{highlight_hex}\verb'0h'}\\
			{\color{highlight_label}\verb'label0:'}\verb' '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_sfr}\verb'R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'cjne'}\verb'    '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#7Fh'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'label0'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0h'}\\
			\verb'        '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'label0'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'END'}\\
		\end{minipage}
		\onecolumn
	\end{minipage}

	As you can see from the example above, the code generated by disassembler is the same as the original code. But of course original symbol names have vanished as well as comments, indentation and other tiny details which cannot be determined from the object code. This is caused by the simple fact that the object code contains only the machine code. It contains no information regarding how exactly the original code looked like. Just instructions with their operands and data directly written to the code memory by ``DB'' and ``DW'' directives. And here we are getting to the real problem which emerges every time when you try to disassemble ``not exactly a simple'' code.

	8051 instructions comprises of 1, 2 or 3 bytes, the first byte determinates what instruction are we dealing with and so what is its length in bytes. But if the original code contained directives ``DB'' or ``DW'' then the disassembler ``thinks'' that these values are instructions too. If the disassembler consider a arbitrary value given by ``DB'' or ``DW'' instruction to be an instruction, it determinates its length according to its OP code (the 1st argument to the directive). And so it takes 0, 1 or 2 bytes next and interprets them as operands to that instruction. Then when it encounters a real instruction OP code it might think of it as another operand to something and so misinterpret it. Then you might end up with a code that is completely different from the original code and makes no sense at all to human. But if you reassemble such a ``non sense'' code with disabled peep hole optimization you must get the original object code back, and its functionality must not be changed. Even if the code seems to be
absolutely non sense. In that case I strongly recommend to use another disassembler than is the built-in one. Consider for example D52 \url{http://www.8052.com/users/disasm/}. The built-in diassembler is provided just for ``completeness'', but its suitability for a real reverse engineering is highly questionable.

	\bigskip
	\noindent
	\begin{center}
		\small{A simple example of a BADLY generated code by disassembler}
	\end{center}
	\begin{minipage}{\textwidth}
		\twocolumn
		\begin{minipage}[t]{.6\textwidth}
			\mysmallfont{}
			\textbf{Original code:}\\
			\verb'        '{\color{highlight_directive}\verb'org'}\verb'     '{\color{highlight_hex}\verb'0h'}\verb'      '{\color{highlight_comment}\verb'; Start at address 0x00'}\\
			\verb''\\
			{\color{highlight_label}\verb'main:'}\verb'   '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_sfr}\verb'R0'}\verb'      '{\color{highlight_comment}\verb'; Increment R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'jmp'}\verb'     '{\color{highlight_constant}\verb'cont'}\\
			\verb'        '{\color{highlight_directive}\verb'db'}\verb'      '{\color{highlight_string}\verb''\verb"'"\verb'some stringx'\verb"'"\verb''}\\
			{\color{highlight_label}\verb'cont:'}\verb'   '{\color{highlight_instruction}\verb'cjne'}\verb'    '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#07Fh'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_constant}\verb'main'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_dec}\verb'#0d'}\verb' '{\color{highlight_comment}\verb';'}\\
			\verb'        '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'main'}\verb'    '{\color{highlight_comment}\verb'; Jump back to label main'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'end'}\verb'             '{\color{highlight_comment}\verb'; End of assembly'}\\
		\end{minipage}\begin{minipage}[t]{.4\textwidth}
			\mysmallfont{}
			\textbf{Code generated by disassembler}\\
			{\color{highlight_constant}\verb'label0'}\verb'  '{\color{highlight_directive}\verb'CODE'}\verb'    '{\color{highlight_hex}\verb'11h'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'ORG'}\verb'     '{\color{highlight_hex}\verb'0h'}\\
			{\color{highlight_label}\verb'label1:'}\verb' '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_sfr}\verb'R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'inc'}\verb'     '{\color{highlight_indirect}\verb'@R0'}\\
			\verb'        '{\color{highlight_instruction}\verb'ljmp'}\verb'    '{\color{highlight_constant}\verb'label0'}\\
			\verb'        '{\color{highlight_instruction}\verb'jmp'}\verb'     '{\color{highlight_indirect}\verb'@A+DPTR'}\\
			\verb'        '{\color{highlight_instruction}\verb'xrl'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'R7'}\\
			\verb'        '{\color{highlight_instruction}\verb'xrl'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'R5'}\\
			\verb'        '{\color{highlight_instruction}\verb'xrl'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_hex}\verb'20h'}\\
			\verb'        '{\color{highlight_instruction}\verb'jmp'}\verb'     '{\color{highlight_indirect}\verb'@A+DPTR'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#72h'}\\
			\verb'        '{\color{highlight_instruction}\verb'xrl'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'R1'}\\
			\verb'        '{\color{highlight_instruction}\verb'xrl'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_sfr}\verb'R6'}\\
			\verb'        '{\color{highlight_instruction}\verb'xrl'}\verb'     '{\color{highlight_sfr}\verb'A'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_indirect}\verb'@R1'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0B8h'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R7'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0ECh'}\\
			\verb'        '{\color{highlight_instruction}\verb'mov'}\verb'     '{\color{highlight_sfr}\verb'R0'}{\color{highlight_oper_sep}\verb','}\verb' '{\color{highlight_imm_hex}\verb'#0h'}\\
			\verb'        '{\color{highlight_instruction}\verb'sjmp'}\verb'    '{\color{highlight_constant}\verb'label1'}\\
			\verb''\\
			\verb'        '{\color{highlight_directive}\verb'END'}\\
		\end{minipage}
		\onecolumn
	\end{minipage}

\chapter{MCU simulator}
	\section{Short introduction}
		The MCU simulator is a tool designed to mimics behavior of a real MCU as much as possible. But it can have certain limitations, the most expectable  limitation is of course the speed of simulation. This simulator is very slow, but offers some extra features.

	\section{Modes of simulation}
		There are 4 modes of simulation:
		\begin{description}
			\item[Step]
				Execute exactly one intruction, no matter how many machine cycles it will take. This does not apply for macro-instruction, in that case each instruction of the macro is executed separately.
			\item[Step over]
				Execute as many instructions as possible until simulator cursor changes its location from one line of source code to another.
			\item[Animate]
				Do the same as ``step'' but in a loop, one after another until stopped by a waring condition or user request.
			\item[Run]
				This is generally the same as ``animate'', but much faster, because GUI is not updated so offten as in the ``animate'' mode.
			\item[(Step Back)]
				Take back the last performed step. There is limited number of step which can be taken back.
		\end{description}

		Virual HW can be enabled or disabled, it significantly affects speed of the simulation. Of course simulation is slower when virtual HW is on.

	\section{Waring conditions}
		\begin{itemize}
			\setlength{\itemsep}{-3pt}
			\item Stack overflow
			\item Stack underflow
			\item Invalid instructions
			\item Watchdog overflow
			\item Invalid return from interrupt
			\item Reading from write only register
			\item Invalid access to IDATA/SFR
			\item Invalid access to EDATA
			\item Invalid access to XDATA
			\item Invalid access to bit
			\item Invalid access to CODE
			\item EEPROM write failure
			\item EEPROM write abort
			\item UART frame discard
			\item Illegal UART mode change
			\item Illegal Timer/Counter mode change
		\end{itemize}

	\section{Limitations}
		\begin{enumerate}
			\setlength{\itemsep}{-3pt}
			\item UART simualation is limited in current version
			\item SPI simulation is not implemented
			\item Simulation of reduced power consumption modes is not supported
			\item Simulated MCU is many times slower the real one would be on ``normal'' conditions
		\end{enumerate}

	\clearpage
	\section{Virtual hardware}
		MCU~8051~IDE simulator is also equipped with a few simulated simple hardware devices, which can be connected to the simulated MCU. These virtual hardware components are intended primarily to offer a better insight into programs interacting with things like LEDs or keys.

		All wires connected to specific GPIO lines are colored according to the voltage level present on them, colors are the same as for graph in the bottom panel ({\color{Green}\small{GREEN}} == log. 0; {\color{Red}\small{RED}} == log. 1; {\color{Gray}\small{GRAY}} == not connected, etc.) Each of these virtual HW components has its own configuration menu and help text available trough that menu. Configuration can be saved to a file with extension \fileextension{.vhc}, and can be loaded from that file later. The configuration menu is accessible trough the button with this icon:  ``\includegraphics[height=8pt]{img/configure.png}''. The \small{``\texttt{\colorbox{Green}{ON}}''/``\texttt{\colorbox{Red}{OFF}}''} button enables or disables entire subsystem of virtual hardware simulation including the graph of GPIO wires on the bottom panel.

		\subsection{DS1620 temperature sensor}
			\begin{wrapfigure}{r}{150pt}
				\centering{}
				\includegraphics[width=110pt]{img/049.png}
				\includegraphics[width=110pt]{img/050.png}
				\caption{DS1620 simulator and its log window}
			\end{wrapfigure}
			Simulates DALLAS\textregistered DS1620 thermometer along with its 3-wire communication interface. Temperature which this simulated device should measure can be set by used on the scale in DS1620 simulator window. All internal registers of the device are displayed to the user and are modifiable by the user, current configuration of the device simulator including DS1620 non-volatile registers can be save into a file for further use. All communications with the simulated MCU and internal operation of the simulated thermometer are displayed in simulator log, log can be accessed via the DS1620 simulator configuration menu (``\includegraphics[height=8pt]{img/configure.png}'').

% 		\subsection{Virtual UART terminal}
% 			This tool simulated UART device connected to the main MCU simulator, it's purpose is to make it easier to properly simulate programs using the 8051 UART interface. User can set where the TxD and RxD wire are connected to the MCU, baud rate, number of stop bits, etc. and send arbitrary data and see received data.

		\subsection{File interface}
			\begin{wrapfigure}{l}{185pt}
				\centering{}
				\includegraphics[width=110pt]{img/048.png}
				\caption{PALE I/O interface}
			\end{wrapfigure}
			This tool can automatically switch states of GPIO lines of the simulated according to certain definition file and it can also record all changes occurring on arbitrary GPIO line to a specified output file. This function can be particularly useful when you are dealing with a 8051 program which extensively works with I/O ports.

		\subsection{LED Panel}
			\begin{wrapfigure}{r}{180pt}
				\centering{}
				\includegraphics[width=110pt]{img/015.png}
				\caption{LED Panel}
			\end{wrapfigure}
			This is the simplest example of such a virtual hardware component. A simple panel consisting of 8 independent LEDs with common anode. Each LED can be connected to separate port and pin and react immediately to any change in voltage level on that line. Connections with the \uC are made with combo boxes on the bottom side of the panel.

		\subsection{Single LED Display}
			\begin{wrapfigure}{l}{180pt}
				\centering{}
				\includegraphics[width=70pt]{img/012.png}
				\caption{LED Display}
			\end{wrapfigure}
			Single 8 segment LED display with one decimal point. Common electrode for the LEDs can be configured as well as the LED color. Each LED can be independently connected to any port and pin and reacts immediately to any change in voltage level on that pin. Common electrode is statically connected to either common ground or Vcc.

		\subsection{Multiplexed LED Display}
			\begin{wrapfigure}{r}{155pt}
				\centering{}
				\includegraphics[width=130pt]{img/011.png}
				\caption{M LED Display}
			\end{wrapfigure}
			4 digits LED displays indented for run in multiplexed mode, LEDs are fading with configurable delay. Each digit has its own common electrode which polarity is configurable, this common electrode is connected to output from an inverter or transistor. There are four color shades for each LED segment, one for inactive, one for active, one for fast blinking and one for segment which was recently dimmed, that makes it possible to see an image which would probably appear on a real display when viewed just by the eye. Unit for the fading interval is one instruction cycle.
		\clearpage
		\subsection{LED Matrix}
			\begin{wrapfigure}{l}{150pt}
				\centering{}
				\includegraphics[width=80pt]{img/014.png}
				\caption{LED Matrix}
			\end{wrapfigure}
			Simple one color 8 x 8 LED matrix indented for run in multiplexed mode, LEDs are fading with configurable delay. Everything here is the same as for the Multiplexed LED Display, except for one thing, mapping. Mapping can be set to row, column or random, which is default. Row mapping means that row which has been activated right now immediately forgets which LEDs were shinning last time and which were not. Column mapping is the same but for columns and random mapping means that each LED will dim after specified interval and not when its row or column is activated. So in random mapping you have to wait until all LEDs are gray before you can draw a new image without being affected by the last one.

		\subsection{Matrix Keypad}
			\begin{wrapfigure}{r}{200pt}
				\centering{}
				\includegraphics[width=80pt]{img/013.png}
				\caption{Matrix Keypad}
			\end{wrapfigure}
			4 x 4 Matrix keypad, each row and column can be connected to any GPIO line. Connections with the \uC are made with the combo boxes. Keys can be configured to behave as radio button\footnote{Radio buttons that means that one one key can be pressed at the time and when you press another key, the originally pressed key will return back to non pressed state}. Note that this tool can be also used to interconnect some port pins together statically, like wires in a bread board. Any key press takes effect immediately in all other virtual hardware components connected to the same line.

		\clearpage
		\subsection{Simple Keypad}
			\begin{wrapfigure}{l}{180pt}
				\centering{}
				\includegraphics[width=110pt]{img/016.png}
				\caption{Simple Keypad}
			\end{wrapfigure}
			Array of 8 independent keys, each one of them can connect any GPIO line to the ground. Any key press takes effect immediately in all other virtual hardware components connected to the same line. Keys can also be configured to behave as radio buttons.

		\enlargethispage{6\baselineskip}
		\subsection{LCD display controlled by HD44780}
			This tool simulates a HD44780 character LCD of any size up to 2 rows and 40 columns. There are 11 I/O lines serving as interface for the MCU, ``E'', ``RS'', ``R/W'' and ``D0''..``D7''. User can view and modify content of the display data RAM (DDRAM), the character generator RAM (CGRAM) and certain HD44780 registers: instruction register (IR), data register (DR), address counter (AC) and display shift, these registers are shown in hexadecimal representation.
			User can also view content of character generator ROM (CGROM) and set font to use. All of the driver commands are fully supported and all important events occurring in the simulated driver (HD44780) are recorded in the simulator log. User can also see and modify certain HD44780 configuration flags like ``B'', ``S'', ``D'' and so on. And the window is collapsible.
			\begin{figure}[h!]
				\begin{minipage}[b]{.5\textwidth}
					\begin{minipage}[b]{\textwidth}
						\centering{}
						\includegraphics[width=1\textwidth]{img/043.png}
						\caption{Simulated LCD display}
					\end{minipage}

					\begin{minipage}[b]{\textwidth}
						\centering{}
						\includegraphics[width=1\textwidth]{img/044.png}
						\caption{HD44780 Log}
					\end{minipage}

					\begin{minipage}[b]{\textwidth}
						\begin{minipage}[b]{.45\textwidth}
							\centering{}
							\includegraphics[width=.9\textwidth]{img/045.png}
							\caption{CGRAM}
						\end{minipage}
						\begin{minipage}[b]{.45\textwidth}
							\centering{}
							\includegraphics[width=.9\textwidth]{img/046.png}
							\caption{DDRAM}
						\end{minipage}
					\end{minipage}
				\end{minipage}
				\begin{minipage}[b]{.5\textwidth}
					\centering{}
					\includegraphics[width=\textwidth]{img/047.png}
					\caption{View on CGROM}
				\end{minipage}
			\end{figure}

\chapter{Writing hardware tool control plug-ins}
	\label{sec:WritingHardwareToolControlPlugIns}
	\section{Foreword}
		\begin{wrapfigure}{r}{120pt}
			\centering{}
			\includegraphics[width=110pt]{img/ssp89s_sceenshot.png}
			\caption{An example of HW control plug-in}
		\end{wrapfigure}
		It is not surprising that IDE for micro-controllers should be capable of inter-operation with certain hardware tools. MCU~8051~IDE has tool named HW plug-ins manager which is responsible for loading and managing plug-ins written in order to to ``integrate'' exiting hardware tools into this IDE. With this feature every author of a 8051 programmer, ICD, ICE etc. who knows Tcl/Tk language has the opportunity to make his or her own tool working in direct cooperation with the IDE. These plug-ins have to be written at least partially in the TCL language and use the Tk library along with API of MCU~8051~IDE. But that doesn't mean that they should be written entirely in Tcl/Tk. On the contrary I would encourage usage of another languages for example SSP89S, also a part of MCU~8051~IDE project, is written almost completely in C++/Qt4, but only a ``small'' piece of the software is written in Tcl/Tk. Tcl/Tk can easily inter-operate with C and C++, also it is possible to run arbitrary separate process from inside of
Tcl/Tk program and control it vie for example TCP sockets or its stdin/stdout or something else.

	\section{How to write your own plug-in}
		At first take these steps:
		\begin{enumerate}
 			\item \textbf{Create the plug-in directory}\label{plug-in directory} \\
				On POSIX system the plug-in directory have to be placed in\\
				``/usr/share/mcu8051ide/hwplugins'', on Microsoft\textregistered Windows\textregistered the directory is ``<YourInstallationDirectory>\verb'\'hwplugins''. The plug-in directory must carry the name of your plug-in, where spaces are replaced with ``\_'' (underscore) characters. For example suppose you want to create a plug-in named as ``My~First~Plug-in~v1.0'', then your plug-in directory directory is ``My\_First\_Plug-in\_v1.0''.
			\item \textbf{Create the plug-in initialization file} \\
				Plug-in initialization file tells the IDE that there is some plug-in at all. The file contains basic initialization of the plug-in environment and must follow certain rules. The file name must also follow name of the plug-in in the same way as the plug-in directory. But the initialization file have to be placed in directory hwplugins. And must have extension \fileextension{.tcl}! For example consider again our ``My~First~Plug-in~v1.0'' plug-in, as we mentioned before. The plug-in directory is: ``/usr/share/mcu8051ide/\underline{hwplugins}/My\_First\_Plug-in\_v1.0'' then the initialization file is:\\
				``/usr/share/mcu8051ide/\underline{hwplugins}/My\_First\_Plug-in\_v1.0\underline{.tcl}''.
			\item \textbf{Define mandatory variables} \\
				{
					\mysmallfont{}
					\begin{verbatim}
						set AUTHOR      "<your name>"                ;# e.g. "Homer Simpson"
						set EMAIL       "<your_email@example.com>"   ;# e.g. "superman.spiderman@supehero.ru"
						set P_VERSION   "<version_of_your_plug-in>"  ;# e.g. "1.2.3" or "0.9"
						set MIN_IDE_VER "1.1"                        ;# Mimimal required version of MCU 8051 IDE
					\end{verbatim}
				}
			\item \textbf{Define mandatory functions} \\
				{
					\mysmallfont{}
					\begin{verbatim}
						# Free resources occupied by this plugin
						proc dispose {} { ... }

						# Initialize the plug-in
						proc init {main_frame current_namespace directory} { ... }

						# Restore previous session
						proc restore_session {session_data} { ... }

						# Save plug-in session
						proc save_session {} { ...; return <String> }

						# Is plugin busy ?
						proc is_busy {} { ...; return <BooleanValue> }
					\end{verbatim}
				}

				``...'' means any code you want there. See ``/usr/share/mcu8051ide/\underline{hwplugins}/plug-in\_template.txt'' or ``<YourInstallationDirectory>\verb'\'hwplugins\verb'\'plug-in\_template.txt'' for more details and for a template for such file.
		\end{enumerate}

		When you have these steps completed you have prepared basic environment for the plug-in. Then the ``HW plug-ins manager'' in the right panel in IDE's GUI should now recognize your plug-in and be able to attempt to load it. If it is not so, then there is definitely something wrong. Any other files which your plug-in consist of and just whatever you want there should be placed in your plug-in directory (\ref{plug-in directory}). And the initialization file should do nothing else than source some real plug-in's file(s) and call appropriate functions inside them. One more important thing, the plug-in runs it \textbf{dynamically assigned namespace}. Take it into account, otherwise your plug-in wont work! Function ``init'' takes the name of this namespace in parameter ``current\_namespace''. So as you can see, it's quite easy you have just to define 4 variables and 5 functions and you can interface with the IDE.

	\section{Using MCU~8051~IDE API}
		You can used any part the API you want, but the entire IDE's API is wast and may change in future without notice. So there is special API dedicated to use in hardware control plug-ins, it is located in ``\texttt{::HwManager}'' namespace and consists of merely 10 simple functions. This API is available since version 1.4. Here is the list of its functions:

		{
			\mysmallfont{}
			\begin{verbatim}
				## Check whether there is some project opened in the IDE
				 # @return Bool - 1 == Yes, there is; 0 == No there is not
				proc is_project_opened {}

				## Check whether MCU simulator is engaged
				 # @return Bool - 0 == 1 == Yes, it is; No it is not (or no project is opened)
				proc is_simulator_engaged {}

				## Get full name of file which is currently displayed in the source code editor
				 # @return String - Full file name including path or empty string in case there is no project opened
				proc get_current_file {}

				## Get full name of file which has been chosen as the project main file
				 # @return String - Full file name or empty string
				proc get_project_main_file {}

				## Get path the directory of currently active project
				 # @return String - Directory path or empty string in case there is no project opened
				proc get_project_dir {}

				## Get name of the current project
				 # @return String - Name of the current project or empty string in case there is no project opened
				proc get_project_name {}

				## Initiate compilation if at least one of the source files was modified
				 # @parm String success_callback - Any command to execute after successful compilation
				 # @parm String failure_callback - Any command to execute after unsuccessful compilation
				 # @return Bool - 1 == Process successfully started; 0 == Unable to comply (no project is opened)
				proc compile_if_nessesary_and_callback {success_callback failure_callback}

				## Open the specified Intel® 8 hex file in hexadecimal editor
				 # @parm String filename - Name of file to open (including path)
				 # @return Bool - 1 == Success; 0 == Failure
				proc open_in_hexeditor {filename}

				## Start MCU simulator if possible
				 # @return Bool - 1 == Success; 0 == Unable to comply
				proc start_simulator {}

				## Shutdown MCU simulator if possible
				 # @return Bool - 1 == Success; 0 == Unable to comply
				proc shutdown_simulator {}
			\end{verbatim}
		}

	\section{A basic example}
		Lets write just a simple plug-in which merely demonstrates usage of some of the above mentioned functions.
		\begin{figure}[h!]
			\centering{}
			\includegraphics[width=120pt]{img/029.png}
			\caption{A basic example of a plug-in}
		\end{figure}

		{
			\fontsize{7pt}{9pt} \selectfont{}
			\begin{verbatim}
				set AUTHOR      "Homer Simpson"
				set EMAIL       "superman.spiderman@supehero.ru"
				set P_VERSION   "1.0"
				set MIN_IDE_VER "1.3.11"

				proc dispose {} {
				    tk_messageBox \
				        -title "My First Plug-in" \
				        -message "Called: dispose {}"
				}

				proc init {main_frame project_object current_namespace directory} {
				    pack [label $main_frame.l0 -text $current_namespace] -anchor w
				    pack [label $main_frame.l1 -text $directory] -anchor w

				    set f [labelframe $main_frame.f -text "My First Plug-in"]
				    pack [label $f.l0 -text "is_project_opened : [::HwManager::is_project_opened]"] -anchor w
				    pack [label $f.l1 -text "is_simulator_engaged : [::HwManager::is_simulator_engaged]"] -anchor w
				    pack [label $f.l2 -text "get_current_file : [::HwManager::get_current_file]"] -anchor w
				    pack [label $f.l3 -text "get_project_main_file : [::HwManager::get_project_main_file]"] -anchor w
				    pack [label $f.l4 -text "get_project_dir : [::HwManager::get_project_dir]" ] -anchor w
				    pack [label $f.l5 -text "l : [::HwManager::get_project_name]"] -anchor w

				    pack [ttk::button $f.b0 -text "update" -command "
				        $f.l0 configure -text \"is_project_opened : \[::HwManager::is_project_opened\]\"
				        $f.l1 configure -text \"is_simulator_engaged : \[::HwManager::is_simulator_engaged\]\"
				        $f.l2 configure -text \"get_current_file : \[::HwManager::get_current_file\]\"
				        $f.l3 configure -text \"get_project_main_file : \[::HwManager::get_project_main_file\]\"
				        $f.l4 configure -text \"get_project_dir : \[::HwManager::get_project_dir\]\"
				        $f.l5 configure -text \"get_project_name : \[::HwManager::get_project_name\]\"
				    "] -anchor w
				    pack $f -fill both -expand 1

				    pack [ttk::button $main_frame.b1 \
				        -text "start_simulator" \
				        -command {::HwManager::start_simulator} \
				    ] -side left
				    pack [ttk::button $main_frame.b2 \
				        -text "shutdown_simulator" \
				        -command {::HwManager::shutdown_simulator} \
				    ] -side left
				}

				proc restore_session {session_data} {
				    tk_messageBox \
				        -title "My First Plug-in" \
				        -message "Called: restore_session {$session_data}"
				}

				proc save_session {} {
				    tk_messageBox \
				        -title "My First Plug-in" \
				        -message "Called: save_session {}"
				    return "my data, time: [clock format [clock seconds] -format {%T}]"
				}

				proc is_busy {} {
				    return [expr {
				        [tk_messageBox \
				            -title "My First Plug-in" \
				            -message "Called: is_busy {}" \
				            -type {yesno}
				            ]
				        == {yes}}]
				}
			\end{verbatim}
		}

	\section{Random remarks}
		\begin{itemize}
			\item Don't forget that your plug-in runs the main thread as well as the GUI of the entire IDE. So if your plug-in does some time expensive operations and it is probable that it does. Then these operations have to be performed in either separate thread or have to run in separate process. It is also possible to regularly ``update'' the application by reentering the event loop using Tcl's \textbf{update} command.
			\item Plug-in files must use encoding UTF-8 and should use LF (Line Feed) character as line end delimiter. In other words Unix line termination sequence.
			\item Although it is possible to name the plug-in directory in any way what your OS accept. It is generally a good idea to follow the mentioned recommendation. At least the name of the initialization file have to follow the mentioned recommendation.
			\item Plug-ins have unrestricted access to the entire application. So they should be written carefully, because plug-ins can theoretically crash down the entire IDE.
			\item Program errors which occurs during loading or unloading of a plug-in are reported via a special dialog. In this dialog plug-in author and his or her email address are mentioned.
			\item The above mentioned API provided by ``\texttt{::HwManager}'' is just a facade\footnote{A design pattern as described in the GOF book}. Before version 1.4 plug-ins must have had to be written to access directly the functionality currently hidden behind ``\texttt{::HwManager}'', so it was much more complicated.
			\item Each instance of a hardware plug-ins manager is bond to its project. But actual plug-ins don't have to be. That's the reason why there is function ``::HwManager::is\_project\_opened {}''. All functions inside the above mentioned API (\texttt{::HwManager::*}) works with the current project, not necessaryly with the project which is the HW manager bond with.
		\end{itemize}

\chapter{Command Line Interface}
	MCU~8051~IDE's CLI makes it possible to use entire IDE just as an assembler, disassembler or converter between \fileextension{.hex} files and binary files. MCU~8051~IDE supports these switches:\\
	{
	\mysmallfont{}
	\begin{longtable}{ll}
		\textbf{\normalsize{Switch}}	& \textbf{\normalsize{Meaning}}					\\\hline
		\endhead
			\\\multicolumn{2}{l}{\textbf{General}}							\\\hline
		\texttt{--help, -h}		& Show help for CLI						\\
		\texttt{--quiet, -q}		& Do not who initialization progress on start-up 		\\
		\texttt{--nosplash}		& Do not show the splash screen					\\
		\texttt{--nocolor, -n}		& Do not show colorful output in console			\\
		\texttt{--version, -V}		& Show program version and exit					\\
		\texttt{--defaults}		& Ru program in empty session					\\
		\texttt{--minimalized}		& Run in minimalized window					\\
		\texttt{--config-file filename}	& Specify path to an alternative configuration file 		\\
		\texttt{--check-libraries}	& Verify whether all required libraries are available		\\
		\texttt{--ignore-last-session}	& Start with an empty session					\\
		\texttt{--open-project project}	& Open just this project					\\
		\texttt{--reset-user-settings}	& Reset all user setting to defaults				\\
			\\\multicolumn{2}{l}{\textbf{Data conversions}}						\\\hline
		\texttt{--auto-indent input}	& Reformat indentation the specified file			\\
		\texttt{--hex2bin input output}	& Convert Intel 8 Hex into a binary file			\\
		\texttt{--bin2hex input output}	& Convert a binary file in Intel 8 HEX				\\
		\texttt{--sim2hex input output}	& Convert MCU~8051~IDE simulator file to Intel 8 Hex file	\\
		\texttt{--sim2bin input output}	& Convert MCU~8051~IDE simulator file to binary file		\\
		\texttt{--normalize-hex input}	& Normalize Intel 8 HEX (force incremental addressing order)	\\
			\\\multicolumn{2}{l}{\textbf{Assembler/Disassembler}}					\\\hline
		\texttt{--disassemble hex\_file}& Disassemble Intel 8 HEX file to hex\_file.asm			\\
		\texttt{--assemble asm\_file}	& Assemble the specified file					\\
		\texttt{--compile asm\_file}	& The same as ``--assemble''					\\
		\texttt{--iram-size size}	& Set size of internal data memory for assembler		\\
		\texttt{--code-size size}	& Set size of program data memory for assembler			\\
		\texttt{--xram-size size}	& Set size of external data memory for assembler		\\
		\texttt{--no-opt}		& Disable peephole optimization					\\
		\texttt{--comp-quiet}		& Suppress text output from the assembler			\\
		\texttt{--no-sim}		& Disable generation of .adf file				\\
		\texttt{--no-bin}		& Disable generation of .bin file				\\
		\texttt{--no-lst}		& Disable generation of .lst file				\\
		\texttt{--no-hex}		& Disable generation of .hex file				\\
		\texttt{--warning-level} 0-3	& Set warning level to the specified level			\\
	\end{longtable}
	}

	\noindent
	Interesting examples:
	{
		\mysmallfont{}
		\begin{verbatim}
			# Reset all IDE settings to defaults
			mcu8051ide --reset-user-settings

			# Use MCU 8051 IDE as assembler (without GUI)
			mcu8051ide --compile /some_directory/my_file.asm

			# Use MCU 8051 IDE as disssembler (without GUI)
			mcu8051ide --disassemble /some_directory/my_file.hex

			# Use MCU 8051 IDE as convertor from binary files to Intel 8 HEX (without GUI)
			mcu8051ide --bin2hex /some_directory/my_file /some_directory/my_file.hex
		\end{verbatim}
	}

\chapter{Translating the IDE into different languages}
	The IDE can be translated to almost any language. The translation can be accomplished by creating of a translation definition file. Such a file must follow certain strict rules in order to work properly. Translation files are normally located in directory ``/usr/share/mcu8051ide/translations'', on Microsoft\textregistered Windows\textregistered the directory is ``<YourInstallationDirectory>\verb'\'translations''. There you can find file ``template.txt'' which is template of MCU 8051 IDE translation file. Along with it there is also file ``languages.txt'' which defines names of languages to which the IDE was already translated. These names are written in these languages. Translation files look like this ``ru.msg'' (Russian translation) or ``cs.msg'' (Czech translation), these files need to be regularly updated. Note also that these files are quite big, each about 0.5MB and each contains about 4500 translated sentences. Further details regarding the translation are mentioned directly in the files related to
translation, particularly in file ``template.txt''. Refer to them if you are interested in making your own translation of the IDE. This is an open-source project so any help is appreciated.

	\bigskip
	\noindent
	{
		The first several lines in file ``template.txt'':\\
		\mysmallfont{}
		\begin{verbatim}
			# This is a template of MCU 8051 IDE translation file
			#
			# This file allows to localize the the user environment of the IDE to almost any
			# language.
			#
			# HOW TO MAKE IT WORK:
			#   1) Copy this file (template.txt) to <lang_code>.msg in the same directory.
			#      Where ``<lang_code>'' is supposed to be replaced with language code of
			#      the translation. For example ``ru'' means Russian, or ``cs'' means Czech.
			#      The language code must be lowercase.
			#   2) Translate all sentences enclosed by ``§'' (paragraph) character. And be
			#      sure to remove the ``§'' character.
			#   3) Modify file ``languages.tcl'' and add name of language which you are
			#      making the translation for. Name should be specified in that language.
			#
			# IMPORTANT RULES FOR TRANSLATION:
			#   1) Be aware of that this file is very sensitive.
			#   2) Everything besides actual sentences for translation must not be modified
			#      in any way! Otherwise the file might cause serious program instability.
			#   3) Escape sequences and all special characters must be preserved.
			#   4) Sentences enclosed with ``"'' (double quote) character, can be translated
			#      into sentences with different length. But the same does not apply for
			#      sentences enclosed with ``{'' and ``}'' (curly brackets) characters,
			#      their lengths must stay preserved.
			#   5) Do not translate ``$'' dollar symbol, it has a special meaning here, not
			#      related to currency.
			#   6) Keep UTF-8 encoding and if possible, please keep also Unix line ends.
			#
			# NOTES:
			#   1) `` ;# <-- NOT TRANSLATED YET'' is just a comment and can be removed at
			#      any time
			#   2) Nothing is perfect ... if you find anything strange or not functional
			#      here, please report it as a regular bug.
			#   3) Recommended syntax highlight pattern for this file is "Tcl/Tk"
			#   4) Please don't hesitate to ask any questions.
			#
			# Thank you for your cooperation, which helps us make the software better!
			#
		\end{verbatim}
	}

	\bigskip
	\noindent
	{
		A random piece of the translation definition file template\\
		\mysmallfont{}
		\begin{verbatim}
			mcset $l "Replace all" \
			         "§Replace all§" ;# <-- NOT TRANSLATED YET
			mcset $l "Find next" \
			         "§Find next§" ;# <-- NOT TRANSLATED YET
			mcset $l "Close" \
			         "§Close§" ;# <-- NOT TRANSLATED YET
			mcset $l "Replace confirmation - %s" \
			         "§Replace confirmation - %s§" ;# <-- NOT TRANSLATED YET
			mcset $l "Go to line" \
			         "§Go to line§" ;# <-- NOT TRANSLATED YET
			mcset $l "Ok" \
			         "§Ok§" ;# <-- NOT TRANSLATED YET
			mcset $l "Cancel" \
			         "§Cancel§" ;# <-- NOT TRANSLATED YET
			mcset $l "Go to line - MCU 8051 IDE" \
			         "§Go to line - MCU 8051 IDE§" ;# <-- NOT TRANSLATED YET
			mcset $l "Choose directory - MCU 8051 IDE" \
			         "§Choose directory - MCU 8051 IDE§" ;# <-- NOT TRANSLATED YET
		\end{verbatim}
	}

\appendix
\twocolumn
\chapter{License}
	MCU~8051~IDE and all its components is distributed under terms of GNU GPLv2.
	{
	\fontsize{5pt}{6pt}\selectfont{}
	\enlargethispage{10\baselineskip}
	\begin{verbatim}
				GNU GENERAL PUBLIC LICENSE
				Version 2, June 1991

		Copyright (C) 1989, 1991 Free Software Foundation, Inc.
					675 Mass Ave, Cambridge, MA 02139, USA
		Everyone is permitted to copy and distribute verbatim copies
		of this license document, but changing it is not allowed.

					Preamble

		The licenses for most software are designed to take away your
		freedom to share and change it.  By contrast, the GNU General Public
		License is intended to guarantee your freedom to share and change free
		software--to make sure the software is free for all its users.  This
		General Public License applies to most of the Free Software
		Foundations software and to any other program whose authors commit to
		using it.  (Some other Free Software Foundation software is covered by
		the GNU Library General Public License instead.)  You can apply it to
		your programs, too.

		When we speak of free software, we are referring to freedom, not
		price.  Our General Public Licenses are designed to make sure that you
		have the freedom to distribute copies of free software (and charge for
		this service if you wish), that you receive source code or can get it
		if you want it, that you can change the software or use pieces of it
		in new free programs; and that you know you can do these things.

		To protect your rights, we need to make restrictions that forbid
		anyone to deny you these rights or to ask you to surrender the rights.
		These restrictions translate to certain responsibilities for you if you
		distribute copies of the software, or if you modify it.

		For example, if you distribute copies of such a program, whether
		gratis or for a fee, you must give the recipients all the rights that
		you have.  You must make sure that they, too, receive or can get the
		source code.  And you must show them these terms so they know their
		rights.

		We protect your rights with two steps: (1) copyright the software, and
		(2) offer you this license which gives you legal permission to copy,
		distribute and/or modify the software.

		Also, for each authors protection and ours, we want to make certain
		that everyone understands that there is no warranty for this free
		software.  If the software is modified by someone else and passed on, we
		want its recipients to know that what they have is not the original, so
		that any problems introduced by others will not reflect on the original
		authors reputations.

		Finally, any free program is threatened constantly by software
		patents.  We wish to avoid the danger that redistributors of a free
		program will individually obtain patent licenses, in effect making the
		program proprietary.  To prevent this, we have made it clear that any
		patent must be licensed for everyones free use or not licensed at all.

		The precise terms and conditions for copying, distribution and
		modification follow.

				GNU GENERAL PUBLIC LICENSE
		TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

		0. This License applies to any program or other work which contains
		a notice placed by the copyright holder saying it may be distributed
		under the terms of this General Public License.  The "Program", below,
		refers to any such program or work, and a "work based on the Program"
		means either the Program or any derivative work under copyright law:
		that is to say, a work containing the Program or a portion of it,
		either verbatim or with modifications and/or translated into another
		language.  (Hereinafter, translation is included without limitation in
		the term "modification".)  Each licensee is addressed as "you".

		Activities other than copying, distribution and modification are not
		covered by this License; they are outside its scope.  The act of
		running the Program is not restricted, and the output from the Program
		is covered only if its contents constitute a work based on the
		Program (independent of having been made by running the Program).
		Whether that is true depends on what the Program does.

		1. You may copy and distribute verbatim copies of the Programs
		source code as you receive it, in any medium, provided that you
		conspicuously and appropriately publish on each copy an appropriate
		copyright notice and disclaimer of warranty; keep intact all the
		notices that refer to this License and to the absence of any warranty;
		and give any other recipients of the Program a copy of this License
		along with the Program.

		You may charge a fee for the physical act of transferring a copy, and
		you may at your option offer warranty protection in exchange for a fee.

		2. You may modify your copy or copies of the Program or any portion
		of it, thus forming a work based on the Program, and copy and
		distribute such modifications or work under the terms of Section 1
		above, provided that you also meet all of these conditions:

		a) You must cause the modified files to carry prominent notices
		stating that you changed the files and the date of any change.

		b) You must cause any work that you distribute or publish, that in
		whole or in part contains or is derived from the Program or any
		part thereof, to be licensed as a whole at no charge to all third
		parties under the terms of this License.

		c) If the modified program normally reads commands interactively
		when run, you must cause it, when started running for such
		interactive use in the most ordinary way, to print or display an
		announcement including an appropriate copyright notice and a
		notice that there is no warranty (or else, saying that you provide
		a warranty) and that users may redistribute the program under
		these conditions, and telling the user how to view a copy of this
		License.  (Exception: if the Program itself is interactive but
		does not normally print such an announcement, your work based on
		the Program is not required to print an announcement.)

		These requirements apply to the modified work as a whole.  If
		identifiable sections of that work are not derived from the Program,
		and can be reasonably considered independent and separate works in
		themselves, then this License, and its terms, do not apply to those
		sections when you distribute them as separate works.  But when you
		distribute the same sections as part of a whole which is a work based
		on the Program, the distribution of the whole must be on the terms of
		this License, whose permissions for other licensees extend to the
		entire whole, and thus to each and every part regardless of who wrote it.

		Thus, it is not the intent of this section to claim rights or contest
		your rights to work written entirely by you; rather, the intent is to
		exercise the right to control the distribution of derivative or
		collective works based on the Program.

		In addition, mere aggregation of another work not based on the Program
		with the Program (or with a work based on the Program) on a volume of
		a storage or distribution medium does not bring the other work under
		the scope of this License.

		3. You may copy and distribute the Program (or a work based on it,
		under Section 2) in object code or executable form under the terms of
		Sections 1 and 2 above provided that you also do one of the following:

		a) Accompany it with the complete corresponding machine-readable
		source code, which must be distributed under the terms of Sections
		1 and 2 above on a medium customarily used for software interchange; or,

		b) Accompany it with a written offer, valid for at least three
		years, to give any third party, for a charge no more than your
		cost of physically performing source distribution, a complete
		machine-readable copy of the corresponding source code, to be
		distributed under the terms of Sections 1 and 2 above on a medium
		customarily used for software interchange; or,

		c) Accompany it with the information you received as to the offer
		to distribute corresponding source code.  (This alternative is
		allowed only for noncommercial distribution and only if you
		received the program in object code or executable form with such
		an offer, in accord with Subsection b above.)

		The source code for a work means the preferred form of the work for
		making modifications to it.  For an executable work, complete source
		code means all the source code for all modules it contains, plus any
		associated interface definition files, plus the scripts used to
		control compilation and installation of the executable.  However, as a
		special exception, the source code distributed need not include
		anything that is normally distributed (in either source or binary
		form) with the major components (compiler, kernel, and so on) of the
		operating system on which the executable runs, unless that component
		itself accompanies the executable.

		If distribution of executable or object code is made by offering
		access to copy from a designated place, then offering equivalent
		access to copy the source code from the same place counts as
		distribution of the source code, even though third parties are not
		compelled to copy the source along with the object code.

		4. You may not copy, modify, sublicense, or distribute the Program
		except as expressly provided under this License.  Any attempt
		otherwise to copy, modify, sublicense or distribute the Program is
		void, and will automatically terminate your rights under this License.
		However, parties who have received copies, or rights, from you under
		this License will not have their licenses terminated so long as such
		parties remain in full compliance.

		5. You are not required to accept this License, since you have not
		signed it.  However, nothing else grants you permission to modify or
		distribute the Program or its derivative works.  These actions are
		prohibited by law if you do not accept this License.  Therefore, by
		modifying or distributing the Program (or any work based on the
		Program), you indicate your acceptance of this License to do so, and
		all its terms and conditions for copying, distributing or modifying
		the Program or works based on it.

		6. Each time you redistribute the Program (or any work based on the
		Program), the recipient automatically receives a license from the
		original licensor to copy, distribute or modify the Program subject to
		these terms and conditions.  You may not impose any further
		restrictions on the recipients exercise of the rights granted herein.
		You are not responsible for enforcing compliance by third parties to
		this License.

		7. If, as a consequence of a court judgment or allegation of patent
		infringement or for any other reason (not limited to patent issues),
		conditions are imposed on you (whether by court order, agreement or
		otherwise) that contradict the conditions of this License, they do not
		excuse you from the conditions of this License.  If you cannot
		distribute so as to satisfy simultaneously your obligations under this
		License and any other pertinent obligations, then as a consequence you
		may not distribute the Program at all.  For example, if a patent
		license would not permit royalty-free redistribution of the Program by
		all those who receive copies directly or indirectly through you, then
		the only way you could satisfy both it and this License would be to
		refrain entirely from distribution of the Program.

		If any portion of this section is held invalid or unenforceable under
		any particular circumstance, the balance of the section is intended to
		apply and the section as a whole is intended to apply in other
		circumstances.

		It is not the purpose of this section to induce you to infringe any
		patents or other property right claims or to contest validity of any
		such claims; this section has the sole purpose of protecting the
		integrity of the free software distribution system, which is
		implemented by public license practices.  Many people have made
		generous contributions to the wide range of software distributed
		through that system in reliance on consistent application of that
		system; it is up to the author/donor to decide if he or she is willing
		to distribute software through any other system and a licensee cannot
		impose that choice.

		This section is intended to make thoroughly clear what is believed to
		be a consequence of the rest of this License.

		8. If the distribution and/or use of the Program is restricted in
		certain countries either by patents or by copyrighted interfaces, the
		original copyright holder who places the Program under this License
		may add an explicit geographical distribution limitation excluding
		those countries, so that distribution is permitted only in or among
		countries not thus excluded.  In such case, this License incorporates
		the limitation as if written in the body of this License.

		9. The Free Software Foundation may publish revised and/or new versions
		of the General Public License from time to time.  Such new versions will
		be similar in spirit to the present version, but may differ in detail to
		address new problems or concerns.

		Each version is given a distinguishing version number.  If the Program
		specifies a version number of this License which applies to it and "any
		later version", you have the option of following the terms and conditions
		either of that version or of any later version published by the Free
		Software Foundation.  If the Program does not specify a version number of
		this License, you may choose any version ever published by the Free Software
		Foundation.

		10. If you wish to incorporate parts of the Program into other free
		programs whose distribution conditions are different, write to the author
		to ask for permission.  For software which is copyrighted by the Free
		Software Foundation, write to the Free Software Foundation; we sometimes
		make exceptions for this.  Our decision will be guided by the two goals
		of preserving the free status of all derivatives of our free software and
		of promoting the sharing and reuse of software generally.

					NO WARRANTY

		11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
		FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
		OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
		PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
		OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
		MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
		TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
		PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
		REPAIR OR CORRECTION.

		12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
		WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
		REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
		INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
		OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
		TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
		YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
		PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
		POSSIBILITY OF SUCH DAMAGES.

				END OF TERMS AND CONDITIONS

			Appendix: How to Apply These Terms to Your New Programs

		If you develop a new program, and you want it to be of the greatest
		possible use to the public, the best way to achieve this is to make it
		free software which everyone can redistribute and change under these terms.

		To do so, attach the following notices to the program.  It is safest
		to attach them to the start of each source file to most effectively
		convey the exclusion of warranty; and each file should have at least
		the "copyright" line and a pointer to where the full notice is found.

		<one line to give the programs name and a brief idea of what it does.>
		Copyright (C) 19yy  <name of author>

		This program is free software; you can redistribute it and/or modify
		it under the terms of the GNU General Public License as published by
		the Free Software Foundation; either version 2 of the License, or
		(at your option) any later version.

		This program is distributed in the hope that it will be useful,
		but WITHOUT ANY WARRANTY; without even the implied warranty of
		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
		GNU General Public License for more details.

		You should have received a copy of the GNU General Public License
		along with this program; if not, write to the Free Software
		Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

		Also add information on how to contact you by electronic and paper mail.

		If the program is interactive, make it output a short notice like this
		when it starts in an interactive mode:

		Gnomovision version 69, Copyright (C) 19yy name of author
		Gnomovision 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.

		The hypothetical commands `show w and `show c should show the appropriate
		parts of the General Public License.  Of course, the commands you use may
		be called something other than `show w and `show c; they could even be
		mouse-clicks or menu items--whatever suits your program.

		You should also get your employer (if you work as a programmer) or your
		school, if any, to sign a "copyright disclaimer" for the program, if
		necessary.  Here is a sample; alter the names:

		Yoyodyne, Inc., hereby disclaims all copyright interest in the program
		`Gnomovision (which makes passes at compilers) written by James Hacker.

		<signature of Ty Coon>, 1 April 1989
		Ty Coon, President of Vice

		This General Public License does not permit incorporating your program into
		proprietary programs.  If your program is a subroutine library, you may
		consider it more useful to permit linking proprietary applications with the
		library.  If this is what you want to do, use the GNU Library General
		Public License instead of this License.
	\end{verbatim}
	}
\onecolumn

\chapter{Regression testing}
	\begin{wrapfigure}{r}{180pt}
		\centering{}
		\includegraphics[width=170pt]{img/030.png}
		\caption{Assembler regression test run in terminal emulator}
	\end{wrapfigure}

	\section{Foreword}
		The IDE is featured with a regression testing environment, the aim of this to make the software as reliable as possible. Currently there is prepared environment for testing the simulator engine and the built-in assembler. This allows to write test cases for specific software features and check whether the results of these tests conform to expected results. Regretfully the test cases are \textbf{NOT PREPARED YET}. Each time when a change is made to the IDE's code, these regression test should be run in order to detect possible bug introductions caused by recent changes. Regression test also serves as a proof of certain software functionality and reliability.

	\section{More about the implementation}
		Additional details can be found in the MCU~8051~IDE development snapshot downloaded from the project's GIT repository in directory ``regression\_tests'' in various ``README'' files. Here we will mention just general overview.

		Each test have its own directory, like 'test\_something' or 'another\_test', let's call this directory the test directory. Each test consist of a set of test cases. Each test case should test one and only one specific function of the tested software. Test cases are represented by files with extension \fileextension{.in} located in directory named 'testcases' inside the test directory.

		Directory ``results'' inside the test directory should be left empty. It is used by the testing environment for storing temporary files generated during the tests. The ``testcases'' directory also contains files intended for comparison with files generated during the test and stored in the ``results'' directory, these files must have extension ``.<x>.exp''. Where ``<x>'' must be substituted with extension of a file which this file is supposed to be compared to. In another words, if I want to check whether for example ``./results/something.abc'' was generated as it should be, I have to create file ``./testcases/something.abc.exp'' and this file will be automatically compared with ``./results/something.abc''.

		And that's it! This is simple, isn't it? It's just about comparing files. But how are the tests run and how the files in the ``results'' directory gets generated? For that we need some Bash script, which is used to run the test, let's call this script the runtest script. The runtest script must be located in the test directory and must include the ``rte.lib.sh'' file, using the ``source'' command (or '.' command). This script should have set permissions to be executable and this script specifies how exactly should be the test performed and also runs the test itself.

		When the script is about to exit, this condition is trapped and the 'rte.lib.sh' reacts by starting the test. So there is no need to explicitly run the test by invoking some function or something like that. It runs the test automatically when there is nothing else left to do.

\chapter{Project web page and other media}
	\section{Official project web page}
		Official web page of the MCU~8051~IDE project provides basic presentation of the project. Contains news about the project development, users comments and forums for users. Also the project's hardware tools are described here and there is some personal information about authors of the project. All components of the IDE can be downloaded from \href{www.sourceforge.net}{sourceforge.net}, which provides hosting for the web pages and entire project. The address is \url{http://mcu8051ide.sf.net}.
		\begin{figure}[h!]
			\centering{}
			\includegraphics[width=\textwidth]{img/026.png}
			\caption{Official web page of the MCU~8051~IDE project}
		\end{figure}

	\section{Other media}
		Project has also its own page on Source Forge, ohloh and Fresh meat. Installation packages are in official Fedora repositories and Ubuntu repositories.  There is currently also one Gentoo overlay providing ebuild for the IDE. Project has its own IRC channel, although it is rarely used. And wiki pages. Not yet in a good shape. Project is also mentioned on Wikipedia. Project official web page is written in PHP5, XHTML-1.1, CSS2 and JavaScript and uses MySQL as database. Volunteers who would like to improve the web page are also welcomed as contributors to the project.

	\section{GIT repository}
		GIT is a distributed revision control system originally developed by Linus Torvalds. MCU~8051~IDE also takes advantage of GIT and uses it as its tool for managing current development version. The project's GIT repository is hosted by Source Forge and is available at address ``{\tiny{}git://mcu8051ide.git.sourceforge.net/gitroot/mcu8051ide/mcu8051ide}''. Access to the repository is for reading only unless you posses the required clearance. In the GIT repository you can always find the newest development version with the newest bug fixes and features. List of latest changes is available on \url{http://mcu8051ide.git.sourceforge.net}. Here is a short description to download and install the latest development version of the IDE:
		\begin{enumerate}
			\setlength{\itemsep}{-3pt}
			\small
			\item Install GIT
			\item Run ``{\footnotesize{}\texttt{git clone git://mcu8051ide.git.sourceforge.net/gitroot/mcu8051ide/mcu8051ide}}''.\\
			      It will create your own copy of the Git repository in the current directory.
			\item Once you have an existing copy of the repository you can just update it each time when you want the fresh version by this command:\\
			      ``\texttt{git fetch origin master}''
			\item Then you can try the downloaded IDE version without installation using the following sequence of commands (for POSIX only)
				\begin{enumerate}
					\setlength{\itemsep}{-3pt}
					\small
					\item \texttt{cd mcu8051ide/lib}
					\item \texttt{./main.tcl}
				\end{enumerate}
			\item Or install it and the use it using the following sequence of commands (for POSIX only)
				\begin{enumerate}
					\setlength{\itemsep}{-3pt}
					\small
					\item \texttt{cd mcu8051ide}
					\item \texttt{./configure \&\& make}
					\item \texttt{sudo su \# or just "su"}
					\item \texttt{make install}
				\end{enumerate}
		\end{enumerate}

\chapter{8051 Instructions in numerical Order}
	{
	\mysmallfont{}
	\begin{longtable}{|c|l|lll|c|llll|c|}
		% Table header:
		\hline
			\textbf{Opcode} &
			\textbf{Mnemonic} &
			\multicolumn{3}{c|}{\textbf{Operands}} &
			\textbf{Bytes} &
			\multicolumn{4}{c|}{\textbf{Flags}} &
			\textbf{Cycles}	\\\hline
		\endhead

		% Table body:
		0x00	& NOP	&	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x01	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x02	& LJMP	& code16&	&	& 3	&	&	&	&	& 2	\\\hline
		0x03	& RR	& A	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x04	& INC	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0x05	& INC	& data	&	&	& 2	&	&	&	&	& 1	\\\hline
		0x06	& INC	& @R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x07	& INC	& @R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x08	& INC	& R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x09	& INC	& R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0A	& INC	& R2	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0B	& INC	& R3	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0C	& INC	& R4	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0D	& INC	& R5	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0E	& INC	& R6	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0F	& INC	& R7	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x10	& JBC	& bit	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0x11	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x12	& LCALL	& code16&	&	& 3	&	&	&	&	& 2	\\\hline
		0x13	& RRC	& A	&	&	& 1	& CY	&	&	& P	& 1	\\\hline
		0x14	& DEC	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0x15	& DEC	& data	&	&	& 2	&	&	&	&	& 1	\\\hline
		0x16	& DEC	& @R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x17	& DEC	& @R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x18	& DEC	& R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x19	& DEC	& R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1A	& DEC	& R2	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1B	& DEC	& R3	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1C	& DEC	& R4	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1D	& DEC	& R5	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1E	& DEC	& R6	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1F	& DEC	& R7	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x20	& JB	& bit	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0x21	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x22	& RET	&	&	&	& 1	&	&	&	&	& 2	\\\hline
		0x23	& RL	& A	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x24	& ADD	& A	& \#imm8&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x25	& ADD	& A	& data	&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x26	& ADD	& A	& @R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x27	& ADD	& A	& @R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x28	& ADD	& A	& R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x29	& ADD	& A	& R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2A	& ADD	& A	& R2	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2B	& ADD	& A	& R3	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2C	& ADD	& A	& R4	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2D	& ADD	& A	& R5	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2E	& ADD	& A	& R6	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2F	& ADD	& A	& R7	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x30	& JNB	& bit	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0x31	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x32	& RETI	&	&	&	& 1	&	&	&	&	& 2	\\\hline
		0x33	& RLC	& A	&	&	& 1	& CY	&	&	& P	& 1	\\\hline
		0x34	& ADDC	& A	& \#imm8&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x35	& ADDC	& A	& data	&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x36	& ADDC	& A	& @R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x37	& ADDC	& A	& @R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x38	& ADDC	& A	& R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x39	& ADDC	& A	& R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3A	& ADDC	& A	& R2	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3B	& ADDC	& A	& R3	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3C	& ADDC	& A	& R4	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3D	& ADDC	& A	& R5	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3E	& ADDC	& A	& R6	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3F	& ADDC	& A	& R7	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x40	& JC	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x41	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x42	& ORL	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0x43	& ORL	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x44	& ORL	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x45	& ORL	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0x46	& ORL	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x47	& ORL	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x48	& ORL	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x49	& ORL	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4A	& ORL	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4B	& ORL	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4C	& ORL	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4D	& ORL	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4E	& ORL	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4F	& ORL	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0x50	& JNC	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x51	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x52	& ANL	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0x53	& ANL	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x54	& ANL	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x55	& ANL	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0x56	& ANL	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x57	& ANL	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x58	& ANL	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x59	& ANL	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5A	& ANL	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5B	& ANL	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5C	& ANL	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5D	& ANL	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5E	& ANL	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5F	& ANL	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0x60	& JZ	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x61	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x62	& XRL	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0x63	& XRL	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x64	& XRL	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x65	& XRL	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0x66	& XRL	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x67	& XRL	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x68	& XRL	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x69	& XRL	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6A	& XRL	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6B	& XRL	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6C	& XRL	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6D	& XRL	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6E	& XRL	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6F	& XRL	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0x70	& JNZ	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x71	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x72	& ORL	& C	& bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0x73	& JMP	&@A+DPTR&	&	& 1	&	&	&	&	& 2	\\\hline
		0x74	& MOV	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x75	& MOV	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x76	& MOV	& @R0	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x77	& MOV	& @R1	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x78	& MOV	& R0	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x79	& MOV	& R1	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7A	& MOV	& R2	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7B	& MOV	& R3	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7C	& MOV	& R4	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7D	& MOV	& R5	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7E	& MOV	& R6	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7F	& MOV	& R7	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x80	& SJMP	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x81	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x82	& ANL	& C	& bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0x83	& MOVC	& A	& @A+PC	&	& 1	&	&	&	& P	& 2	\\\hline
		0x84	& DIV	& AB	&	&	& 1	& CY	&	& OV	& P	& 4	\\\hline
		0x85	& MOV	& data	& data	&	& 3	&	&	&	&	& 2	\\\hline
		0x86	& MOV	& data	& @R0	&	& 2	&	&	&	&	& 2	\\\hline
		0x87	& MOV	& data	& @R1	&	& 2	&	&	&	&	& 2	\\\hline
		0x88	& MOV	& data	& R0	&	& 2	&	&	&	&	& 2	\\\hline
		0x89	& MOV	& data	& R1	&	& 2	&	&	&	&	& 2	\\\hline
		0x8A	& MOV	& data	& R2	&	& 2	&	&	&	&	& 2	\\\hline
		0x8B	& MOV	& data	& R3	&	& 2	&	&	&	&	& 2	\\\hline
		0x8C	& MOV	& data	& R4	&	& 2	&	&	&	&	& 2	\\\hline
		0x8D	& MOV	& data	& R5	&	& 2	&	&	&	&	& 2	\\\hline
		0x8E	& MOV	& data	& R6	&	& 2	&	&	&	&	& 2	\\\hline
		0x8F	& MOV	& data	& R7	&	& 2	&	&	&	&	& 2	\\\hline
		0x90	& MOV	& DPTR	&\#imm16&	& 3	&	&	&	&	& 2	\\\hline
		0x91	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x92	& MOV	& bit	& C	&	& 2	&	&	&	&	& 2	\\\hline
		0x93	& MOVC	& A	&@A+DPTR&	& 1	&	&	&	& P	& 2	\\\hline
		0x94	& SUBB	& A	& \#imm8&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x95	& SUBB	& A	& data	&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x96	& SUBB	& A	& @R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x97	& SUBB	& A	& @R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x98	& SUBB	& A	& R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x99	& SUBB	& A	& R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9A	& SUBB	& A	& R2	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9B	& SUBB	& A	& R3	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9C	& SUBB	& A	& R4	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9D	& SUBB	& A	& R5	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9E	& SUBB	& A	& R6	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9F	& SUBB	& A	& R7	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0xA0	& ORL	& C	& /bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0xA1	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xA2	& MOV	& C	& bit	&	& 2	& CY	&	&	&	& 1	\\\hline
		0xA3	& INC	& DPTR	&	&	& 1	&	&	&	&	& 2	\\\hline
		0xA4	& MUL	& AB	&	&	& 1	& CY	&	& OV	& P	& 4	\\\hline
		0xA5	& \multicolumn{10}{l|}{Invalid opcode}						\\\hline
		0xA6	& MOV	& @R0	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xA7	& MOV	& @R1	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xA8	& MOV	& R0	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xA9	& MOV	& R1	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAA	& MOV	& R2	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAB	& MOV	& R3	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAC	& MOV	& R4	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAD	& MOV	& R5	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAE	& MOV	& R6	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAF	& MOV	& R7	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xB0	& ANL	& C	& /bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0xB1	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xB2	& CPL	& bit	&	&	& 2	&	&	&	&	& 1	\\\hline
		0xB3	& CPL	& C	&	&	& 1	& CY	&	&	&	& 1	\\\hline
		0xB4	& CJNE	& A	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB5	& CJNE	& A	& data	& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB6	& CJNE	& @R0	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB7	& CJNE	& @R1	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB8	& CJNE	& R0	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB9	& CJNE	& R1	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBA	& CJNE	& R2	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBB	& CJNE	& R3	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBC	& CJNE	& R4	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBD	& CJNE	& R5	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBE	& CJNE	& R6	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBF	& CJNE	& R7	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xC0	& PUSH	& data	&	&	& 2	&	&	&	&	& 2	\\\hline
		0xC1	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xC2	& CLR	& bit	&	&	& 2	&	&	&	&	& 1	\\\hline
		0xC3	& CLR	& C	&	&	& 1	& CY	&	&	&	& 1	\\\hline
		0xC4	& SWAP	& A	&	&	& 1	&	&	&	&	& 1	\\\hline
		0xC5	& XCH	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0xC6	& XCH	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xC7	& XCH	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xC8	& XCH	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xC9	& XCH	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCA	& XCH	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCB	& XCH	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCC	& XCH	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCD	& XCH	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCE	& XCH	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCF	& XCH	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0xD0	& POP	& data	&	&	& 2	&	&	&	&	& 2	\\\hline
		0xD1	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xD2	& SETB	& bit	&	&	& 2	&	&	&	&	& 1	\\\hline
		0xD3	& SETB	& C	&	&	& 1	& CY	&	&	&	& 1	\\\hline
		0xD4	& DA	& A	&	&	& 1	& CY	&	&	& P	& 1	\\\hline
		0xD5	& DJNZ	& data	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0xD6	& XCHD	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xD7	& XCHD	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xD8	& DJNZ	& R0	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xD9	& DJNZ	& R1	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDA	& DJNZ	& R2	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDB	& DJNZ	& R3	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDC	& DJNZ	& R4	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDD	& DJNZ	& R5	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDE	& DJNZ	& R6	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDF	& DJNZ	& R7	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xE0	& MOVX	& A	& @DPTR	&	& 1	&	&	&	& P	& 2	\\\hline
		0xE1	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xE2	& MOVX	& A	& @R0	&	& 1	&	&	&	& P	& 2	\\\hline
		0xE3	& MOVX	& A	& @R1	&	& 1	&	&	&	& P	& 2	\\\hline
		0xE4	& CLR	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0xE5	& MOV	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0xE6	& MOV	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xE7	& MOV	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xE8	& MOV	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xE9	& MOV	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEA	& MOV	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEB	& MOV	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEC	& MOV	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0xED	& MOV	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEE	& MOV	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEF	& MOV	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0xF0	& MOVX	& @DPTR	& A	&	& 1	&	&	&	&	& 2	\\\hline
		0xF1	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xF2	& MOVX	& @R0	& A	&	& 1	&	&	&	&	& 2	\\\hline
		0xF3	& MOVX	& @R1	& A	&	& 1	&	&	&	&	& 2	\\\hline
		0xF4	& CPL	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0xF5	& MOV	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0xF6	& MOV	& @R0	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xF7	& MOV	& @R1	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xF8	& MOV	& R0	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xF9	& MOV	& R1	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFA	& MOV	& R2	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFB	& MOV	& R3	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFC	& MOV	& R4	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFD	& MOV	& R5	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFE	& MOV	& R6	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFF	& MOV	& R7	& A	&	& 1	&	&	&	&	& 1	\\\hline

		% Table caption:
		\caption{8051 Instructions in numerical Order}
	\end{longtable}
	}

\chapter{8051 Instructions in alphabetical order}
	{
	\mysmallfont{}
	\begin{longtable}{|c|l|lll|c|llll|c|}
		% Table header:
		\hline
			\textbf{Opcode} &
			\textbf{Mnemonic} &
			\multicolumn{3}{c|}{\textbf{Operands}} &
			\textbf{Bytes} &
			\multicolumn{4}{c|}{\textbf{Flags}} &
			\textbf{Cycles}	\\\hline
		\endhead

		% Table body:
		0x11	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x31	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x51	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x71	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x91	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xB1	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xD1	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xF1	& ACALL	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x24	& ADD	& A	& \#imm8&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x25	& ADD	& A	& data	&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x26	& ADD	& A	& @R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x27	& ADD	& A	& @R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x28	& ADD	& A	& R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x29	& ADD	& A	& R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2A	& ADD	& A	& R2	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2B	& ADD	& A	& R3	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2C	& ADD	& A	& R4	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2D	& ADD	& A	& R5	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2E	& ADD	& A	& R6	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x2F	& ADD	& A	& R7	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x34	& ADDC	& A	& \#imm8&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x35	& ADDC	& A	& data	&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x36	& ADDC	& A	& @R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x37	& ADDC	& A	& @R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x38	& ADDC	& A	& R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x39	& ADDC	& A	& R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3A	& ADDC	& A	& R2	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3B	& ADDC	& A	& R3	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3C	& ADDC	& A	& R4	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3D	& ADDC	& A	& R5	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3E	& ADDC	& A	& R6	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x3F	& ADDC	& A	& R7	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x01	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x21	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x41	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x61	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x81	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xA1	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xC1	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0xE1	& AJMP	& code11&	&	& 2	&	&	&	&	& 2	\\\hline
		0x52	& ANL	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0x53	& ANL	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x54	& ANL	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x55	& ANL	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0x56	& ANL	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x57	& ANL	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x58	& ANL	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x59	& ANL	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5A	& ANL	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5B	& ANL	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5C	& ANL	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5D	& ANL	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5E	& ANL	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0x5F	& ANL	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0x82	& ANL	& C	& bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0xB0	& ANL	& C	& /bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0xB4	& CJNE	& A	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB5	& CJNE	& A	& data	& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB6	& CJNE	& @R0	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB7	& CJNE	& @R1	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB8	& CJNE	& R0	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xB9	& CJNE	& R1	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBA	& CJNE	& R2	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBB	& CJNE	& R3	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBC	& CJNE	& R4	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBD	& CJNE	& R5	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBE	& CJNE	& R6	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xBF	& CJNE	& R7	& \#imm8& code8	& 3	& CY	&	&	&	& 2	\\\hline
		0xC2	& CLR	& bit	&	&	& 2	&	&	&	&	& 1	\\\hline
		0xC3	& CLR	& C	&	&	& 1	& CY	&	&	&	& 1	\\\hline
		0xE4	& CLR	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0xB2	& CPL	& bit	&	&	& 2	&	&	&	&	& 1	\\\hline
		0xB3	& CPL	& C	&	&	& 1	& CY	&	&	&	& 1	\\\hline
		0xF4	& CPL	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0xD4	& DA	& A	&	&	& 1	& CY	&	&	& P	& 1	\\\hline
		0x14	& DEC	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0x15	& DEC	& data	&	&	& 2	&	&	&	&	& 1	\\\hline
		0x16	& DEC	& @R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x17	& DEC	& @R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x18	& DEC	& R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x19	& DEC	& R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1A	& DEC	& R2	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1B	& DEC	& R3	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1C	& DEC	& R4	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1D	& DEC	& R5	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1E	& DEC	& R6	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x1F	& DEC	& R7	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x84	& DIV	& AB	&	&	& 1	& CY	&	& OV	& P	& 4	\\\hline
		0xD5	& DJNZ	& data	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0xD8	& DJNZ	& R0	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xD9	& DJNZ	& R1	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDA	& DJNZ	& R2	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDB	& DJNZ	& R3	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDC	& DJNZ	& R4	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDD	& DJNZ	& R5	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDE	& DJNZ	& R6	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0xDF	& DJNZ	& R7	& code8	&	& 2	&	&	&	&	& 2	\\\hline
		0x04	& INC	& A	&	&	& 1	&	&	&	& P	& 1	\\\hline
		0x05	& INC	& data	&	&	& 2	&	&	&	&	& 1	\\\hline
		0x06	& INC	& @R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x07	& INC	& @R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x08	& INC	& R0	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x09	& INC	& R1	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0A	& INC	& R2	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0B	& INC	& R3	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0C	& INC	& R4	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0D	& INC	& R5	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0E	& INC	& R6	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x0F	& INC	& R7	&	&	& 1	&	&	&	&	& 1	\\\hline
		0xA3	& INC	& DPTR	&	&	& 1	&	&	&	&	& 2	\\\hline
		0x20	& JB	& bit	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0x10	& JBC	& bit	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0x40	& JC	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x73	& JMP	&@A+DPTR&	&	& 1	&	&	&	&	& 2	\\\hline
		0x30	& JNB	& bit	& code8	&	& 3	&	&	&	&	& 2	\\\hline
		0x50	& JNC	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x70	& JNZ	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x60	& JZ	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x12	& LCALL	& code16&	&	& 3	&	&	&	&	& 2	\\\hline
		0x02	& LJMP	& code16&	&	& 3	&	&	&	&	& 2	\\\hline
		0x74	& MOV	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x75	& MOV	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x76	& MOV	& @R0	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x77	& MOV	& @R1	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x78	& MOV	& R0	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x79	& MOV	& R1	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7A	& MOV	& R2	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7B	& MOV	& R3	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7C	& MOV	& R4	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7D	& MOV	& R5	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7E	& MOV	& R6	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x7F	& MOV	& R7	& \#imm8&	& 2	&	&	&	&	& 1	\\\hline
		0x85	& MOV	& data	& data	&	& 3	&	&	&	&	& 2	\\\hline
		0x86	& MOV	& data	& @R0	&	& 2	&	&	&	&	& 2	\\\hline
		0x87	& MOV	& data	& @R1	&	& 2	&	&	&	&	& 2	\\\hline
		0x88	& MOV	& data	& R0	&	& 2	&	&	&	&	& 2	\\\hline
		0x89	& MOV	& data	& R1	&	& 2	&	&	&	&	& 2	\\\hline
		0x8A	& MOV	& data	& R2	&	& 2	&	&	&	&	& 2	\\\hline
		0x8B	& MOV	& data	& R3	&	& 2	&	&	&	&	& 2	\\\hline
		0x8C	& MOV	& data	& R4	&	& 2	&	&	&	&	& 2	\\\hline
		0x8D	& MOV	& data	& R5	&	& 2	&	&	&	&	& 2	\\\hline
		0x8E	& MOV	& data	& R6	&	& 2	&	&	&	&	& 2	\\\hline
		0x8F	& MOV	& data	& R7	&	& 2	&	&	&	&	& 2	\\\hline
		0x90	& MOV	& DPTR	&\#imm16&	& 3	&	&	&	&	& 2	\\\hline
		0x92	& MOV	& bit	& C	&	& 2	&	&	&	&	& 2	\\\hline
		0xA2	& MOV	& C	& bit	&	& 2	& CY	&	&	&	& 1	\\\hline
		0xA6	& MOV	& @R0	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xA7	& MOV	& @R1	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xA8	& MOV	& R0	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xA9	& MOV	& R1	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAA	& MOV	& R2	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAB	& MOV	& R3	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAC	& MOV	& R4	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAD	& MOV	& R5	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAE	& MOV	& R6	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xAF	& MOV	& R7	& data	&	& 2	&	&	&	&	& 2	\\\hline
		0xE5	& MOV	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0xE6	& MOV	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xE7	& MOV	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xE8	& MOV	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xE9	& MOV	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEA	& MOV	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEB	& MOV	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEC	& MOV	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0xED	& MOV	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEE	& MOV	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0xEF	& MOV	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0xF5	& MOV	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0xF6	& MOV	& @R0	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xF7	& MOV	& @R1	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xF8	& MOV	& R0	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xF9	& MOV	& R1	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFA	& MOV	& R2	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFB	& MOV	& R3	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFC	& MOV	& R4	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFD	& MOV	& R5	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFE	& MOV	& R6	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0xFF	& MOV	& R7	& A	&	& 1	&	&	&	&	& 1	\\\hline
		0x83	& MOVC	& A	& @A+PC	&	& 1	&	&	&	& P	& 2	\\\hline
		0x93	& MOVC	& A	&@A+DPTR&	& 1	&	&	&	& P	& 2	\\\hline
		0xE0	& MOVX	& A	& @DPTR	&	& 1	&	&	&	& P	& 2	\\\hline
		0xE2	& MOVX	& A	& @R0	&	& 1	&	&	&	& P	& 2	\\\hline
		0xE3	& MOVX	& A	& @R1	&	& 1	&	&	&	& P	& 2	\\\hline
		0xF0	& MOVX	& @DPTR	& A	&	& 1	&	&	&	&	& 2	\\\hline
		0xF2	& MOVX	& @R0	& A	&	& 1	&	&	&	&	& 2	\\\hline
		0xF3	& MOVX	& @R1	& A	&	& 1	&	&	&	&	& 2	\\\hline
		0xA4	& MUL	& AB	&	&	& 1	& CY	&	& OV	& P	& 4	\\\hline
		0x00	& NOP	&	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x42	& ORL	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0x43	& ORL	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x44	& ORL	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x45	& ORL	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0x46	& ORL	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x47	& ORL	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x48	& ORL	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x49	& ORL	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4A	& ORL	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4B	& ORL	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4C	& ORL	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4D	& ORL	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4E	& ORL	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0x4F	& ORL	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0x72	& ORL	& C	& bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0xA0	& ORL	& C	& /bit	&	& 2	& CY	&	&	&	& 2	\\\hline
		0xD0	& POP	& data	&	&	& 2	&	&	&	&	& 2	\\\hline
		0xC0	& PUSH	& data	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x22	& RET	&	&	&	& 1	&	&	&	&	& 2	\\\hline
		0x32	& RETI	&	&	&	& 1	&	&	&	&	& 2	\\\hline
		0x23	& RL	& A	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x33	& RLC	& A	&	&	& 1	& CY	&	&	& P	& 1	\\\hline
		0x03	& RR	& A	&	&	& 1	&	&	&	&	& 1	\\\hline
		0x13	& RRC	& A	&	&	& 1	& CY	&	&	& P	& 1	\\\hline
		0xD2	& SETB	& bit	&	&	& 2	&	&	&	&	& 1	\\\hline
		0xD3	& SETB	& C	&	&	& 1	& CY	&	&	&	& 1	\\\hline
		0x80	& SJMP	& code8	&	&	& 2	&	&	&	&	& 2	\\\hline
		0x94	& SUBB	& A	& \#imm8&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x95	& SUBB	& A	& data	&	& 2	& CY	& AC	& OV	& P	& 1	\\\hline
		0x96	& SUBB	& A	& @R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x97	& SUBB	& A	& @R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x98	& SUBB	& A	& R0	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x99	& SUBB	& A	& R1	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9A	& SUBB	& A	& R2	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9B	& SUBB	& A	& R3	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9C	& SUBB	& A	& R4	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9D	& SUBB	& A	& R5	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9E	& SUBB	& A	& R6	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0x9F	& SUBB	& A	& R7	&	& 1	& CY	& AC	& OV	& P	& 1	\\\hline
		0xC4	& SWAP	& A	&	&	& 1	&	&	&	&	& 1	\\\hline
		0xC5	& XCH	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0xC6	& XCH	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xC7	& XCH	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xC8	& XCH	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xC9	& XCH	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCA	& XCH	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCB	& XCH	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCC	& XCH	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCD	& XCH	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCE	& XCH	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0xCF	& XCH	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0xD6	& XCHD	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0xD7	& XCHD	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x62	& XRL	& data	& A	&	& 2	&	&	&	&	& 1	\\\hline
		0x63	& XRL	& data	& \#imm8&	& 3	&	&	&	&	& 2	\\\hline
		0x64	& XRL	& A	& \#imm8&	& 2	&	&	&	& P	& 1	\\\hline
		0x65	& XRL	& A	& data	&	& 2	&	&	&	& P	& 1	\\\hline
		0x66	& XRL	& A	& @R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x67	& XRL	& A	& @R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x68	& XRL	& A	& R0	&	& 1	&	&	&	& P	& 1	\\\hline
		0x69	& XRL	& A	& R1	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6A	& XRL	& A	& R2	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6B	& XRL	& A	& R3	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6C	& XRL	& A	& R4	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6D	& XRL	& A	& R5	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6E	& XRL	& A	& R6	&	& 1	&	&	&	& P	& 1	\\\hline
		0x6F	& XRL	& A	& R7	&	& 1	&	&	&	& P	& 1	\\\hline
		0xA5	& \multicolumn{10}{l|}{Invalid opcode}						\\\hline

		% Table caption:
		\caption{8051 Instructions in lexical Order}
	\end{longtable}
	}

\chapter{List of supported micro-controllers}
	\subsection{Intel\textregistered}
		{
		\mysmallfont{}
		\begin{longtable}{ll}
			8051			& \url{http://download.intel.com/design/MCS51/MANUALS/27238302.pdf}		\\
			80C51			& \url{http://download.intel.com/design/MCS51/MANUALS/27238302.pdf}		\\
			8052			& \url{http://download.intel.com/design/MCS51/MANUALS/27238302.pdf}		\\
		\end{longtable}
		}
	\subsection{Atmel\textregistered}
		{
		\mysmallfont{}
		\begin{longtable}{ll}
			\multicolumn{2}{l}{\textbf{\small{}Flash (Reprogramable)}}						\\
			AT89C2051		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc0368.pdf}		\\
			AT89C4051		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc1001.pdf}		\\
			AT89C51			& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc0265.pdf}		\\
			AT89C51RC		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc1920.pdf}		\\
			AT89C52			& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc0313.pdf}		\\
			AT89C55WD		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc1921.pdf}		\\
			AT89LV51		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc0303.pdf}		\\
			AT89LV52		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc0375.pdf}		\\
			AT89LV55		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc0811.pdf}		\\\\

			\multicolumn{2}{l}{\textbf{\small{}Flash ISP (Programable via ISP)}}					\\
			AT89S52			& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc1919.pdf}		\\
			AT89LS51		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc3053.pdf}		\\
			AT89LS52		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc2601.pdf}		\\
			AT89S8253		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc3286.pdf}		\\
			AT89S2051		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc3390.pdf}		\\
			AT89S4051		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc3390.pdf}		\\\\

			\multicolumn{2}{l}{\textbf{\small{}OTP (One-Time Programmable)}}					\\
			T87C5101		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc3c0c80904bc57.pdf}	\\
			T83C5101		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc3c0c80904bc57.pdf}	\\
			AT80C32X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4184.pdf}		\\
			TS87C52X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4184.pdf}		\\
			AT87C52X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4184.pdf}		\\
			AT80C54X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\\\

			\multicolumn{2}{l}{\textbf{\small{}ROM}}								\\
			T83C5102		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc3c0c80904bc57.pdf}	\\
			TS80C32X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4184.pdf}		\\
			TS80C52X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4184.pdf}		\\
			AT80C58X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\
			AT87C54X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\
			AT87C58X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\
			TS80C54X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\
			TS80C58X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\
			TS87C54X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\
			AT80C52X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4184.pdf}		\\
			TS87C58X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4431.pdf}		\\\\

			\multicolumn{2}{l}{\textbf{\small{}ROMless}}								\\
			TS80C31X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4428.pdf}		\\
			AT80C31X2		& \url{http://www.atmel.com/dyn/resources/prod\_documents/doc4428.pdf}		\\
		\end{longtable}
		}

\chapter{Change log}
	{
	\mysmallfont{}
	\begin{verbatim}
		1.3.11 -> 1.4
			* Bug fixes
			* Added new Virtual HW component: LCD display controlled by HD44780
			* Added new Virtual HW component: simulated DS1620 temperature sensor
			* Added new Virtual HW component: File interface
			* Added AT89S51
			* Improved performance of Virtual HW
			* Added support for spelling checker (Hunspell)
			* Added 8051 Instruction table
			* Improved table of symbols on the right panel
			* Final draft of the handbook

		1.3.10 -> 1.3.11
		        * Bug fixes
		        * New interface for hardware control plug-ins
		        * Added new assembler directives: ELSEIF ELSEIFN ELSEIFDEF ELSEIFNDEF
		        * Removed assembler directive: EXITM

		1.3.9 -> 1.3.10
		        * Bug fixes
		        * Extended help menu
		        * Extended global configuration dialog
		        * Added support for multiple widget styles and GUI background colors
		        * Added draft of handbook
		        * Added basic support for assembler and simulator regression testing
		        * Added regular support for i18n (internationalization)
		        * Modified welcome dialog
		        * Added support for external links in the GUI

		1.3.8 -> 1.3.9
		        * Bug fixes

		1.3.7 -> 1.3.8
		        * Bug fixes
		        * Added feature "Global Font Size Factor" (see MCU 8051 IDE configuration dialog)
		        * Added breakpoint validation

		1.3.6 -> 1.3.7
		        * Bug fixes

		1.3.5 -> 1.3.6
		        * Bug fixes

		1.3.4 -> 1.3.5
		        * Bug fixes

		1.3.3 -> 1.3.4
		        * "Modernized" GUI
		        * Bug fixes

		1.3.1 -> 1.3.3
		        * Bug fixes

		1.3.1 -> 1.3.2
		        * Bug fixes

		1.3 -> 1.3.1
		        * Dependency on TclX is now only optional
		        * Important chage !: Native assembler now expands macro instructions before doing conditional
		          assembly and before defining constants and variables ! Control sequence $NOMACROSFIRST can
		          be used to change this behavior to the state of previous versions.
		        * Added support for AS31 assembler
		        * Added files notepad
		        * Improved instruction help panel
		        * Native assembler was extended to support these directives: "IFN IFDEF IFNDEF BYTE FLAG REPT
		        TIMES" and these constrol sequences: "$NOXR $NOXREF $XR $XREF $NOSB $SB $RESTORE $RS $SA
		        $SAVE $PHILIPS $NOPI $PI $NOTABS $NOMOD51 $NOBUILTIN $NOMO $MO $MOD51 $NOMACRO $NOMR $LI
		        $NOLI $GENONLY $GO $NOGEN $NOGE $GEN $GE $ $EJ $NODB $NODEBUG $DB $DEBUG $CONDONLY $NOCOND
		        $COND $TT $PW $PL $MR $MACRO $INC $WARNING $ERROR $DA $NOMACROSFIRST"
		        * Added stack monitor
		        * Various bug fixes

		1.2 -> 1.3
		        * New dependency: TclX (tested with v8.4)
		        * Added RS232/UART debugger
		        * A few changes in assembler
		        * Bug fixes (Thanks to Miroslav Hradílek for many useful bug reports)

		1.1.1 -> 1.2
		        * Bug fixes
		        * Added tab bar

		1.1 -> 1.1.1
		        * Added "Special calculator"
		        * Added "Base converter"
		        * Many tiny improvements

		1.0.9 -> 1.1
		        * Added support for new MCUs from Intel®: 8031, 8751, 8032, 8752, 80C31, 87C51, 80C52,
		        87C52, 80C32, 80C54, 87C54, 80C58, 87C58
		        * Added support for simulating virtual hardware
		        * Improved simulator (Implemented UART (experimental support), improved support for timers, etc.)
		        * Improved register watches
		        * Improved editor (improved autocompletion and many other things)
		        * Improved panel "Instruction details"
		        * Improved 8-segment editor
		        * Bug fixes in assembler, disassembler and simulator engine
		        * Some other bug fixes
		        * Added utility "Scribble notepad"
		        * Improved graph panel

		1.0.7 -> 1.0.9
		        * Added support for C language
		        * Added map of bit addressable area

		1.0.6 -> 1.0.7
		        * Added Stopwatch
		        * Improved code editor
		        * Some bug fixes

		1.0.5 -> 1.0.6
		        * Fixed critical bug in Assembler v1.0.5 (related to peephole code optimization)
		        * Added 8 segment LED display editor
		        * Added ASCII chart
		        * Added Assembly symbol table viewer

		1.0 -> 1.0.5
		        * Added support for external assemblers ("ASEM-51" and  "ASL")
		        * Added support for external editors ("emacs", "gvim", "kwrite" and "gedit")
		        * Added support for embedded editors ("emacs", "vim", "nano", "dav" and "le")
		        * Added embedded terminal emulator (rxvt-unicode)
		        * Added function "File statistics"
		        * Improved assembler
		        * Added syntax highlight for code listing (*.lst)
		        * Added search bars for "Messages" and "Todo"
		        * Removed dependency on "tcl-thread" and "tclxml"
		        * Added dependency on "TkImg" and "tdom"
		        * Improved hex editor
		        * Improved simulator (especially simulation across multiple files)
		        * Added panel "Find in files"
		        * Modified GUI
		        * New error handling dialog
		        * Some bug fixes (especially critical bug in disassembler and a few bugs in assembler)
		        * All images are now in PNG (Portable Network Graphics) (Requires TkImg)
		        * Some more improvements

		0.9.5 -> 1.0
		        * MANY BUG FIXES ! (including critical)
		        * Added support for some new MCUs (
		            AT89S52,	AT89LS51,	AT89LS52,	AT89S8253,	AT89S2051,	AT89S4051,
		            T87C5101,	T83C5101,	T83C5102,	TS80C32X2,	TS80C52X2,	TS87C52X2,
		            AT80C32X2,	AT80C52X2,	AT87C52X2,	AT80C54X2,	AT80C58X2,	AT87C54X2,
		            AT87C58X2,	TS80C54X2,	TS80C58X2,	TS87C54X2,	TS87C58X2,	TS80C31X2,
		            AT80C31X2
		        )
		        * Added support for peephole optimization
		        * Faster project opening
		        * Added interrupt monitor
		        * Added subprograms monitor
		        * Added SFR map
		        * Added SFR watches
		        * Extended command line interface
		        * Compiler now checks for valid memory addressing (new CLI options --iram-size, --eram-size,
		          --xram-size, --code-size)
		        * Added program hibernation capability
		        * Added editor commands hibernate, resume, switch-mcu, set-xcode and set-xdata
		        * Added desktop file and application icon
		        * Some more improvements

		0.9.1 -> 0.9.5
		        * Implemented support for 80C51, 8052, AT89C2051, AT89C4051, AT89C51, AT89C51RC, AT89C52,
		          AT89C55WD, AT89LV51, AT89LV52 and AT89LV55
		        * Simulator can now step back
		        * Added popup-based completion for editor
		        * Added tool tips for bits in simulator control panel
		        * Added simulator configuration dialog
		        * Added auto save function
		        * Manual page
		        * Added support for multi-view (editor can be now splitted vertically or horizontally)
		        * Many bug fixes (in compiler, editor, file selection dialog, syntax highlight, simulator, etc.)
		        * Some minor improvements (graph, disassembler, etc.)
		        * Thread extension is no longer required to run this program (but custom commands will won't
		          work without it)

		0.9.0 -> 0.9.1
		        * New hexadecimal editor
		        * New file selection dialog
		        * Added file system browser tab on left panel
		        * Added tips on start-up
		        * Added editor command line
		        * Improved editor configuration dialog
		        * A few bug fixes
		        * Removed dependency on IWidgets and Tix
		        * Some minor improvements

		0.8.7 -> 0.9.0
		        * Implemented graph
		        * Many bug fixes (GUI, compiler, memory leaks)
		        * Editable shortcuts
		        * Bookmarks for opened and project files
		        * Search panels in left and right panel
		        * Modified GUI (checkboxes, radio buttons ...)
		        * Support for various encodings and EOLs
		        * Added "Tools" -> "Change letter case", "Normalize HEX" and "SIM -> BIN"
		        * Added editor functions "Lowercase", "Uppercase" and "Capitalize"
		        * Added help windows for opened and project files and opened projects
		        * Added pop-up menus for entry and text widgets (globally)
		        * Fixed problem with fonts (bad sizes)
		        * Implemented support for line wrapping (experimental)
		        * Added new command line options (see `mcu8051ide --help')
		        * More status tips and tool tips
		        * Added welcome dialog
		        * Added demonstration project
		        * Cleaner, faster and safer compiler
		        * Some more minor improvements

		0.8.5 -> 0.8.7
		        * Implemented code validation
		        * Added tab "Instruction details" (on the right panel)
		        * Added Clean Up dialog
		        * Added Right Panel configuration dialog
		        * Added Toolbar configuration dialog
		        * Added support for custom commands
		        * Fixed some bugs (in GUI)
		        * Fixed many memory leaks
		        * Cleaner code

		0.8.4 -> 0.8.5
		        * Fixed many bugs in GUI
		        * Improved editor
		        * Extended calculator
		        * Redesigned editor configuration dialog
		        * Added functions "Tools -> Reformat code" and "Tools -> Sim2Hex"
		        * Extended CLI (--reset-user-settings, --config-file, --compile, --hex2bin ...)

		0.8.1 -> 0.8.4
		        * Fixed many bugs ... (including critical)
		        * Added compiler configuration dialog
		        * Added calculator timers preset
		        * Added dialog about
		        * Added support for exporting highlighted source code to LaTeX source
		        * Added many ToolTips
		        * Added StatusBar tips
		        * Added splash screen
		        * Added support for command line options
		        * All images are now *.XPM (X PixMap) (require Tix package)
		        * Changed installation procedure

		0.8.0 -> 0.8.1
		        * Fixed some bugs in compiler (not critical)
		        * Fixed bug in to do list (saving text as SGML)
		        * Fixed bug in project management
		        * Added pop-up menu to to do list
	\end{verbatim}
	}

\listoftables
\listoffigures
\end{document}
