0% found this document useful (0 votes)
427 views

Deeds User Manual

This document provides a user manual for Deeds, a digital electronics education and design suite. It introduces Deeds as an integrated learning environment for teaching digital electronics theory, solving exercises, and designing electronic systems. Deeds includes three main simulation tools: a digital circuit simulator, a finite state machine simulator, and a microcomputer emulator. It also includes two main browsers: a main browser for accessing course materials and documentation, and an assistant browser for viewing assignments. The manual provides overviews of the key features and functions of Deeds and each of its simulation tools and browsers. It includes examples of how to use the tools to design and simulate circuits and systems. It also includes reference sections describing the instruction sets and commands for the various simulation

Uploaded by

Nourallah Aouina
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
427 views

Deeds User Manual

This document provides a user manual for Deeds, a digital electronics education and design suite. It introduces Deeds as an integrated learning environment for teaching digital electronics theory, solving exercises, and designing electronic systems. Deeds includes three main simulation tools: a digital circuit simulator, a finite state machine simulator, and a microcomputer emulator. It also includes two main browsers: a main browser for accessing course materials and documentation, and an assistant browser for viewing assignments. The manual provides overviews of the key features and functions of Deeds and each of its simulation tools and browsers. It includes examples of how to use the tools to design and simulate circuits and systems. It also includes reference sections describing the instruction sets and commands for the various simulation

Uploaded by

Nourallah Aouina
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 121

Deeds

Digital Electronics Education and Design Suite

User Manual
(Feb 2004)

Edited by Giuliano Donzellini and Domenico Ponta

1
Exegi monumentum aere perennius
regalique situ pyramidum altius
quod non imber edax, non Aquilo impotens
possit diruere, aut innumerabilis
annorum series et fuga temporum.

Quinto Orazio Flacco

2
Deeds - Digital Electronics Education and Design Suite
User Manual

Index
Preface P. 8
Introduction P. 9

Deeds as a learning environment for digital electronics P. 10


How to use Deeds to teach theory P. 10
How to use Deeds to solve exercises P. 10
How to use Deeds to learn to design electronic systems P. 11
The Deeds simulation tools P. 12

Deeds: The Main Browser P. 13


Deeds: Main browser Menu P. 16

Deeds: The Assistant Browser (d-AsT) P. 22


Deeds: The Assistant Browser Menu P. 23

Deeds: The Digital Circuit Simulator d-DcS P. 25


Introduction P. 26
A simple example P. 27
A simple example of interaction between Deeds browsers and d-DcS P. 30
d-DcS: Menu Commands P. 35

Deeds: Finite State Machine Simulator d-FsM P. 48


Introduction P. 49
Finite State Machines P. 50
FSM description languages: ASM charts P. 50
State Block P. 51
Decision Block P. 51
Conditional Output Block P. 51
ASM Charts & State Diagrams P. 51
FSM description languages: state transition table P. 53
FSM description languages: hardware description language P. 53
Learning FSM: methods and problems P. 55
Reusing FSM component: they can be imported in d-DcS P. 55
A simple example P. 56
A simple example of interaction between Deeds browsers and d-FsM P. 60
The timing diagram window P. 67
d-FsM: Menu Commands P. 68

Deeds: The Micro Computer Emulator d-McE P. 77


Introduction P. 78
A simple example P. 80
A simple example of interaction between Deeds browsers and d-McE P. 84
d-McE: Menu Commands P. 91

3
DMC8 Instruction Set P. 100
Load Instructions (8 bits) P. 100
Load Instructions (16 bits) (first section) P. 101
Load Instructions (16 bits) (second section) P. 102
Arithmetic and Logic Instructions (8 bits) P. 103
Arithmetic Instructions (16 bits) P. 104
CPU Control Instructions P. 104
Jump Instructions P. 105
Call and Return Instructions P. 105
Rotate and Shift Instructions P. 106
Bit Handling Instructions P. 107
Input and Output Instructions P. 107

DMC8 Instructions (in alfabetical order) P. 108

DMC8 Instructions (in numerical order) P. 112

Appendix: Deeds historical version notes P. 116

4
Index of Figures
Page #

Fig. 1: An example of laboratory report displayed in the main browser of Deeds 11


Fig. 2: The Deeds environment: the main and assistant browsers (on top left), and the three 12
Simulation Tools: the Digital Circuit Simulator (on top right), the Finite State Machine Simulator
(on bottom left) and the Micro Computer Emulator (on bottom right).
Fig. 3: The main browser of Deeds, showing the HTML page that allows to connect to the Deeds 13
web site and to the ‘on-line’ learning materials.
Fig. 4: The main browser, connected to the ‘Sreen Shots’ page of the Deeds web site. 14
Fig. 5: The download page in the Deeds web site. 14
Fig. 6: the learning material page (available in the Deeds web site), opened in the main 15
browser.
Fig. 7: The main browser “File“ menu. 16
Fig. 8: The Open Page dialog window. 16
Fig. 9: The main browser “Run“ menu. 18
Fig. 10: The main browser “Tools“ menu. 19
Fig. 11: The main browser “Options“ menu. 20
Fig. 12: The main browser “Help“ menu. 21
Fig. 13: The Assistant opened aside of the main browser, showing a page with a problem 22
assignment.
Fig. 14: The Assistant main menu, appended to the toolbar. 23
Fig. 16: The circuit editor of the Digital Circuit Simulator (d-DcS). 26
Fig. 17a: The drawing phase of the digital circuit editor: the insertion of components. 27
Fig. 17b: The next phase of the work: the connection of components, using wires 27
Fig. 17c: The animation at work: the user switches the Inputs and the circuit shows changes on 28
the Outputs.
Fig. 18: The Timing Diagram simulation window. 28
Fig. 19: The timing simulation results, displayed in the Timing Diagram window. 29
Fig. 20: A list of laboratory assignments, opened in the Deeds main browser. 30
Fig. 21: The specific laboratory assignment, opened in the Assistant browser. 31
Fig. 22: The Digital Circuit Simulator, opened by a click on the web page. The circuit template 32
has been automatically downloaded from the courseware site.
Fig. 23: The timing simulation of the circuit, once completed by the student. 32
Fig. 24: The student can download the report template to speed up its compilation and 33
delivering.
Fig. 25: The report template for this laboratory assignment. 34
Fig. 26a: The d-DcS “File“ menu. 35
Fig. 26b: The Paper Setup dialog window. 36
Fig. 27: The d-DcS “Edit“ menu. 37
Fig. 28: The d-DcS “View“ menu. 38
Fig. 29: The d-DcS “Tools“ menu. 39
Fig. 30: The d-DcS “Circuit“ menu. 40
Fig. 31: The d-DcS “Simulation“ menu. 44
Fig. 32: The d-DcS “Deeds“ menu. 45
Fig. 33: The d-DcS “Options“ menu. 46
Fig. 34: The d-DcS “Help“ menu. 47
Fig. 35: The ASM editor of the Finite State Machine Simulator (d-FsM). 49
Fig. 36: The ASM editor of the Finite State Machine Simulator (d-FsM). 50
Fig. 37: A simple Algorithmic State Machine (ASM) diagram. 50
Fig. 38a: State Block 51
Fig. 38b: Decision Block 51
Fig. 38c: Conditional Output Block 51
Fig. 39a: The State Diagram representation of a SR flip-flop. 51
Fig. 39b: The ASM Chart representation of a SR flip-flop. 52
Fig. 40a: ASM chart and State diagram representing the same algorithm: the FSM waits in the 52
state ‘a’ until the x input goes to one.
Fig. 40b: Another example of ASM chart and State diagram representing the same algorithm. 53
Fig. 41: The state transition table of the example above, as generated by the d-FsM. 53
Fig. 42: The VHDL equivalent of the ASM diagram in Fig. 37, as generated by the d-FsM. 54

5
Fig. 43: In this example, a component, designed with the d-FsM, has been imported in the 55
d-DcS.
Fig. 44a: The student inserts state blocks, setting their properties. 56
Fig. 44b: The student inserts conditional blocks, setting their properties. 56
Fig. 44c: The student inserts logical path (the green lines, no property needs to be set). Note 57
that the line arrows are automatically added.
Fig. 45: The simulation results for the edge detector described above. 57
Fig. 46a,b: The ASM transition table describing the component, on the left, and the generated 58
symbol, on the right.
Fig. 47: Two instances of the component are connected in a circuit composed of standard gates, 58
in the d-DcS.
Fig. 48: Timing simulation of the previous network, obtained with the d-DcS. 59
Fig. 49: A list of laboratory assignments, with use of d-FsM, opened in the Deeds main browser. 60
Fig. 50a: The specific laboratory assignment, opened in the Assistant browser (first page). 61
Fig. 50b: The specific laboratory assignment, opened in the Assistant browser (second page). 62
Fig. 51: The downloaded ASM diagram, template of the solution. 62
Fig. 52a,b,c: The three pages of the Input/Output dialog window, used to define inputs, outputs 63
and state variables .
Fig. 53: The property window, displaying the properties of the ‘a’ state. 63
Fig. 54: The property window, displaying the properties of a condition block. 64
Fig. 55: The finished ASM diagram, and its timing simulation, in the d-FsM. 64
Fig. 56: The finished d-DcS schematic, and the timing simulation of the component, in the d- 65
DcS.
Fig. 57: Also in this case, the student will download the report template to speed up its 66
compilation and delivering.
Fig. 58: The report template for this laboratory assignment assignment. 66
Fig. 59: The Timing Diagram window of the d-FsM. 67
Fig. 60: The ASM Table window. 67
Fig. 61: The d-FsM “File“ menu. 68
Fig. 62: The VHDL code window. 69
Fig. 63: The Paper Setup dialog window. 69
Fig. 64: The d-FsM “Edit“ menu. 71
Fig. 65: The three pages of the Input/Output dialog window, used to define inputs, outputs and 71
state variables .
Fig. 66: The d-FsM “View“ menu. 72
Fig. 67: The four pages of Property Window, used to define properties of state, conditional and 72
conditional output blocks.
Fig. 68: The d-FsM “Simulation“ menu. 73
Fig. 69: The d-FsM “Window“ menu. 74
Fig. 70: The d-FsM “Deeds“ menu. 75
Fig. 71: The d-FsM 76
Fig. 72: The assembler code editor of the Micro Computer Emulator (d-McE). 78
Fig. 73: The assembler-level debugger of the Micro Computer Emulator. 79
Fig. 74: The emulated board, as represented in the Micro Computer Emulator. 79
Fig. 75: The editing phase of an assembly program, in the d-McE. 80
Fig. 76: The DMC8 “architecture”, as shown by the help-system. 81
Fig. 77: An example of the ‘on line’ instruction set documentation: the Arithmetic and Logic 81
instructions.
Fig. 78: Another example of the ‘on line’ instruction set documentation: the Shift and Rotate 82
instructions.
Fig. 79: The Assembler module reports an error in the source code. 82
Fig. 80: The Debugger module shows the program under test, the memory, the CPU registers, 83
the I/O ports.
Fig. 81: A list of laboratory assignments, opened in the Deeds main browser. 84
Fig. 82a: The specific laboratory assignment, opened in the Assistant browser (first part). 85
Fig. 82b: The specific laboratory assignment, opened in the Assistant browser (second part). 86
Fig. 83: The Micro Computer Emulator, opened by a click on the web page. The editor shows 87
the trace of the solution, automatically downloaded from the courseware site.
Fig. 84: The program under test in the interactive debugger of the d-McE: a Warning has be sent 88
to the user.
Fig. 85: Port addresses can be modified in the “I/O Ports Address Decoding” dialog window. 89
Fig. 86: Port addresses can be modified by a mouse click on the simulated ‘on board’ dip 89

6
switches.
Fig. 87: The student can download the report template to speed up its compilation and 89
delivering.
Fig. 88: The simple template provided on the web page, that the student can download. 90
Fig. 89: A partial view of a ‘final’ student report. 90
Fig. 90: The d-McE “File“ menu. 91
Fig. 91: The d-McE “Edit“ menu. 93
Fig. 92: The d-McE “Project“ menu. 94
Fig. 93: The “Source Info” dialog window. 94
Fig. 94: The “I/O Ports Address Decoding” dialog window. 94
Fig. 95: The d-McE “Emulation“ menu. 95
Fig. 96: The d-McE “Deeds“ menu. 96
Fig. 97: The d-McE “Options“ menu. 97
Fig. 98: The d-McE “View“ menu. 98
Fig. 99: The Symbol Table window. (Compact View or Extended View). 98
Fig. 100: The d-McE “Help“ menu. 99

7
Preface
Deeds is the acronym of Digital Electronics Education and Design Suite… but, as ”deeds”
mean, I’m not sure if they will be good or bad… just like The Deeds of Gallant Knights that the splash form
recalls…

“The Deeds of Gallant Knights"


…from a picture of G. David, XVI Century - Paris, Musèe de l'Armèe

8
Deeds
Digital Electronics Education and Design Suite

Introduction
Deeds is conceived as a suite of simulators, tools and learning material for Digital Electronics. Deeds helps
student acquiring theoretical foundations, analysis capabilities, ability to solve problems all over the subject
topics, practical synthesis and design skills. Its approach is characterised by the "learning-by-doing” concept.

It covers the following areas of digital electronics:


• Combinational logic networks (from simple gates to decoders,
encoders, multiplexers and demultiplexers);
• Sequential logic networks (from simple flip-flops to registers and
counters);
• Finite state machine design;
• Micro-computer programming (at assembly level) and interfacing;

Major tools that Deeds includes are:


• An HTML main browser, to navigate in Internet, where students will
find lessons, exercises and laboratory assignments;
• An HTML assistant browser, that assists students in their work;
• A schematic digital circuit editor (with component data-sheet support);
• An interactive circuit ‘animator’ (to experiment with components and
simple networks directly on the schematics);
• An interactive logic simulator (with a timing diagram tracer to analyse
events in the logic networks, and to interact step-by-step with the
circuit);
• A finite state machine editor / simulator (the algorithm is described
using an Algorithmic State Machine graphical editor);
• A microcomputer board emulator (the board include an 8 bit CPU,
ROM, RAM, I/O ports);
• An assembler level / interactive debugger module.

Deeds tools can interact with each other:


• The HTML main and assistant browsers allows to launch all the other
tools and interact with them;
• The browser can control editors and simulators, to realise a true
interaction between text and experiments;
• The schematic editor allows to connect traditional logic circuits with
subsystems defined by the user with the help of the finite state
machine editors and the micro-computer emulator.
• It is possible to experiment with digital systems controlled by state
machines.

The architecture of Deeds allows a “scalable” approach to the lessons, exercises and laboratory sessions.
All the tools included allow either a simplified scenario to beginners and a more exhaustive and complete
environment for skilled students.

9
Deeds as a learning environment for digital electronics
Deeds is conceived as a learning environment for digital electronics. With such term we mean a collection
of tools and text material that help students acquiring:

• theoretical foundations of the subject;


• analysis capabilities;
• ability to solve problems all over the subject topics;
• practical synthesis and design skills.

Deeds is conceived as a common resource for all introductive courses in digital electronics. As such, it may
contain different technical subjects, different pedagogical formats (lectures, exercises, lab assignments,
etc.) delivered at different student levels. Deeds is therefore born as a set of tools (listed before) that
teachers can complete and personalise to suit their pedagogical needs by contributing to the ”lecture space”
with their own materials.
There is no need for a specific authoring tool, because the lecture space can be composed with any HTML
editor, completed by a helper application that facilitates the linking of the editors and simulators’ commands
to the lecture text.

How to use Deeds to teach theory


A “lecture” based on Deeds appears as HTML pages with text and figures. The page aspect and layout are
totally up to the author. At this level, students see a “normal” on-line book or document. But many of the
figures and visual objects are “active”, because they are connected to the editing and simulation tools of
Deeds.
For example, let’s suppose that theory presents a certain digital circuit , visualising its schematics in a
picture. When the user clicks on the picture, Deeds launches the corresponding simulator, and opens that
schematic, together with another windows (the Helper) that contains step-by-step instructions on how to
explore or test the circuit itself. Such procedure is equally useful to convey concepts on simple components
or quite complex networks. In the first case, simulators allows to “animate” circuits, i.e. to explore them
interactively. In the second one, their capabilities of tracing signals in the time and data domain allows a
thorough test of the network.

How to use Deeds to solve exercises


The target of traditional exercises is to help understanding theory, applying it to simple cases and providing a
feedback to the teacher through the delivery of the solutions. In our system exercises are presented as
HTML pages, containing text and figures of the assignments. The role of Deeds is to allow students to check
the correctness of the solutions obtained manually and to provide
graphical tools for editing the web page containing their reports,
until they are satisfied with their work and use Deeds to deliver the
reports through the network.
The use of Deeds implies also a different approach to the structure
of the exercises. In fact, with the simulator, students may be
tempted to skip manual analysis. Exercises, therefore, must be
targeted more to the real understanding of the issues than to the
execution of repetitive tasks.

10
How to use Deeds to learn to design electronic systems
The development of a digital design project is the field where Deeds can fully be exploited. In fact, the
interactive logic simulator, the finite state machine module and the microcomputer board emulator can work
simultaneously in the simulation of a system where standard digital components can be controlled by a state
machines as it is the case in contemporary digital design. Obviously, the modules can be used
independently, to test separately the system’s parts. The student can complete its work programming at
assembly level a microcomputer board.
Students use Deeds to download the assignment from a web page. The assignment consists of a functional
description and a set of specification of the system that students must design. The approach is meant to
replicate the features of a professional environment, within the guidelines suggested by the educational
purposes. Project development phases are guided by help and instructions supplied through the Assistant
Browser. Such instructions can be given step-by-step or by simple guidelines: the use of the simulation tools
can be more or less guided by the text of the assignment (to left creativity and fantasy to the user initiative).
In Fig. 1, an example of laboratory student report, displayed in the main browser.

Fig. 1: An example of laboratory report displayed in the main browser of Deeds

11
The Deeds simulation tools
The simulation tools are three: a Digital Circuit Simulator (d-DcS), a Finite State Machine Simulator (d-FsM),
and a Micro Computer Board Emulator (d-McE). All the simulation tools are characterized by a “learn-by-
doing” approach. They are integrated together: design and simulation of complex networks integrating
standard logic with state machines are possible. In Fig. 2 a few screen shots of the Deeds tools are shown.

Fig. 2: The Deeds environment: the main and assistant browsers (on top left), and the three Simulation Tools:
the Digital Circuit Simulator (on top right), the Finite State Machine Simulator (on bottom left)
and the Micro Computer Emulator (on bottom right).

12
Deeds: The Main Browser
The simulators are integrated around two HTML browsers, enabling active Internet navigation to sites
where students find pages with lessons, exercises and laboratory assignments. The main web browser of
Deeds, when activated, shows a HTML page that allows to connect to the Deeds web site and to the ‘on-
line’ learning materials developed at DIBE (University of Genoa).

The main browser (Fig. 3) has been developed around the standard Microsoft WebBrowser ® component,
the same used by the Microsoft Internet Explorer ®, extended to support all the required functions by the
Deeds environment. It is mainly used to connect to the sites containing the learning materials. The browser
supports all the features that the user can expect to find, including JAVA Virtual Machine ®, JavaScript ®,
VBScript ®, XML support.

Fig. 3: The main browser of Deeds, showing the HTML page that allows to connect to the Deeds web site and to the
‘on-line’ learning materials.

When the user launches the Deeds environment, the main browser shows up. All the other tools can be
activated by the menu and/or toolbar command. The main browser acts as ‘main window’ of the application
suite.

13
With Deeds, the user can directly navigate to the own web site, where Learning Material are available. In
Fig. 4 you see the ‘screen shots’ web page of the site.

Fig. 4: The main browser, connected to the ‘Sreen Shots’ page of the Deeds web site.

The user can also download the last version of the Deeds suite, as soon as it become available (Fig. 5):

Fig. 5: The download page in the Deeds web site.

14
Deeds has been developed as common simulation tool to be shared among different institutions running
courses on Digital Design, as a support of the activities of the NetPro project in the field of Electronic
Engineering. NetPro, a European project of the Leonardo DaVinci program, develops project-based
learning through Internet. It has created models, tools and services to facilitate communication and
collaboration between distant students, and to manage access and control of project deliverables.
We test NetPro methodologies and tools by running pilot projects. An important characteristic of the pilot
courses is that project groups can be distributed over different academic institutions and countries. A pilot
course may have teams from more than one institution and more than one nation while teams themselves
could be inter-institutional and international.
The immediate goal of the collaboration between pilot sites is to provide learning tasks that are meaningful
for all students, independently of their local arrangements.
Joint working is possible if teams use the same language (all the components of our pilots, including
student deliverables and communication, are in English) and if the classes involved study the same topic at
the same time of year. All documents produced are available as web sites for on-line fruition or as
downloadable files. In fig. 6 you see, opened in the main browser, the learning material index page,
available in the Deeds web site.

Fig. 6: the learning material page (available in the Deeds web site), opened in the main browser.

15
Deeds: Main browser Menu
The main browser menu allows to navigate web site, to run simulators and tools, to switch between the
opened tools, and to customize the user options.

File Menu

Fig. 7: The main browser “File“ menu.

Home Page
Command to navigate to the main browser home page (it can be user-defined)..

Open Page
Open the Open Page dialog (Fig. 8). In this dialog window, the user can type
directly a URL address, or browse the local network or disk. The chosen web page
can be set as Home Page. A short history of previously opened pages is
maintained.

Fig. 8: The Open Page dialog window.

16
Back
Standard browsing command to return to the ‘previous’ opened page.

Forward
Standard browsing command to return to the ‘next’ opened page, after using the
‘Back’ command.

Stop
Standard browsing command to stop the download of the current page.

Refresh
Standard browsing command to reload the currently opened page.

Print Preview
Standard command to preview the current page before printing.

Print Page
Standard command to print the current page.

Exit
Standard command to close the Assistant.

17
Run Menu

Fig. 9: The main browser “Run“ menu.

Assistant Browser
Command to open manually an instance of the Assistant Browser.

Digital Circuit
Simulator
Command to open manually an instance of the Digital Circuit Simulator (d-DcS).

Finite State
Machine Designer
Command to open manually an instance of the Finite State Machine
Designer/Simulator (d-FsM).

Micro Computer
Board Emulator
Command to open manually an instance of the Micro Computer Board Emulator
(d-McE).

18
Tools Menu

Fig. 10: The main browser “Tools“ menu.

First items group


Commands to switch focus to the chosen tool. All the opened tools are indexed
here, together with the name of the corresponding opened file, if any. When the
user click on an item, the tool will go ‘on top’.

Switch to Next
Deeds Application
Command to switch to the next Deeds open tool or browser.

Switch to
Tool on Top
Command to switch to the tool that was ‘on top’ before switching to the main
browser.

Close All Tool


Command to close all the opened tool. If a file, opened in a tool, is not saved, the
user will be prompted, and the close operation stopped.

19
Options Menu

Fig. 11: The main browser “Options“ menu.

Configuration
Command to change the application configuration (disabled in this version).

ToolBars
Commands to control ToolBars appearance.

Browser ToolBar
Command to hide or show the Browser ToolBar.

Status Bar
Command to hide or show the Status Bar.

Show and Dock


All ToolBars
Command to show and dock in all the ToolBars.

Dockable
ToolBars
Command to enable or disable the docking modality of the ToolBars.

20
Help Menu

Fig. 12: The main browser “Help“ menu.

Index
Command to open the Deeds Help System.

License
Agreement
Command to display the Licence Agreement.

Version Notes
Command to display the Version Notes file.

About
Command to display the Deeds ‘splash’ window dialog.

21
Deeds: The Assistant Browser (d-AsT)
The “Assistant” HTML browser has characteristics similar to those of the main browser, but it is specialized
to assist students, side by side, in their work (fig. 13). This is the browser used to open lessons, exercises
and laboratory assignments. As the main, also the Assistant browser has been conceived around the
standard Microsoft WebBrowser ® component.
In Fig. 13 the Assistant browser is opened aside of the main one, showing a page with a problem
assignment (from the ESD1 NetPro course). To open an assignment, the user will click on the desired
topic, listed in the main browser: the Assistant will open automatically, showing itself aside.

Fig. 13: The Assistant opened aside of the main browser, showing a page with a problem assignment.

All objects, that a web page visualises, can be made “active”. For instance, by clicking on the figure
showing the schematics, the Digital Circuit Simulator could be started and the circuit loaded, ready to be
tested (this important feature will be described in detail later).

22
Deeds: Assistant browser Menu
The Assistant menu has been reduced to the essential (Fig. 14), to simplify user operation. Its graphical
shape has been chosen to minimize the window size, allowing the positioning of the Assistant aside of the
simulation tool without occupy to much area of the screen.

Fig. 14: The Assistant main menu, appended to the toolbar.

Home Page
Command to navigate to the Assistant local home page.

Open Page
Open the Open Page dialog (Fig. 15). In this dialog window, the user can type
directly a URL address, or browse the local network or disk. The chosen web page
can be set as Home Page. A short history of previously opened pages is
maintained.

Fig. 15: The Open Page dialog window.

Back
Standard browsing command to return to the ‘previous’ opened page.

Forward
Standard browsing command to return to the ‘next’ opened page, after using the
‘Back’ command.

23
Stop
Standard browsing command to stop the download of the current page.

Refresh
Standard browsing command to reload the currently opened page.

Print Preview
Standard command to preview the current page before printing.

Print Page
Standard command to print the current page.

Deeds
Command group to navigate between the opened Deeds tools.

Options
Command group to change the Assistant configuration and options.

Exit
Standard command to close the Assistant.

24
Deeds: The Digital Circuit Simulator d-DcS

This image from the Tapestry of Bayeux, Bayeux Cathedral, France

25
Introduction
The Digital Circuit Simulator d-DcS appears to the user as a graphical schematic editor, with a library of
simplified logic components, specialised toward pedagogical needs and not describing specific commercial
products (Fig. 16).

As described before, the schematic editor allows to build simple digital networks composed of gates, flip-
flops, pre-defined combinational and sequential circuits and custom-defined components (defined as Finite
state machine).

Fig. 16: The circuit editor of the Digital Circuit Simulator (d-DcS).

Simulation can be interactive or in timing-mode. In the first mode, the student can "animate" the digital
system in the editor, controlling its inputs and observing the results. This is the simplest mode to examine a
digital network, and this way of operation can be useful for the beginners.
In the timing mode, the behaviour of the circuit can be analysed by a timing diagram window, in which the
user can define graphically an input signal sequence and observe the simulation results. This is the mode
nearest to the professional simulators.

26
A simple example
In following screen shots (Fig. 17a,b,c), you can see the circuit during the drawing and then simulated by
animation:
a) the student picks-up components from the bin on the Component Tool Bar, then
b) connects them using Wires. When finished,
c) the student activates the animation.

Fig. 17a: The drawing phase of the digital circuit editor: the insertion of components.

Fig. 17b: The next phase of the work: the connection of components, using wires .

27
Fig. 17c: The animation at work: the user switches the Inputs and the circuit shows changes on the Outputs.

To enter the ‘animation’ mode, the user clicks on the triangular ‘play’ button on the toolbar.

During the animation, the editing command are disabled, and the circuit can’t be changed; when the user

clicks on the Input Switches (see Fig. 17c), the Outputs change according to the simulation results,

showing ‘0’ , ‘1’ or ‘unknown’ values.


To exit the ‘animation’ mode, it is necessary to click on the square ‘stop’ button .

Instead, if the timing simulation is to be performed, the user should click on the Timing Simulation button .
This will show the Timing Diagram simulation window (Fig. 18), very similar to the ones that we find in
professional tools for digital electronics.

Fig. 18: The Timing Diagram simulation window.

28
In this window, first of all the user defines the timing of the input signals, drawing them on the diagram with
the mouse. A vertical line cursor permits to define the ‘end time’ of the simulation. When the user clicks on
the triangular ‘play’ button on the toolbar, the simulation is executed, and its results are displayed in the
same window (Fig. 19).

Fig. 19: The timing simulation results, displayed in the Timing Diagram window.

The student can verify the correct behaviour of the network under test, comparing simulation results with
reasoning and theory concepts.

29
A simple example of interaction between Deeds browsers and d-DcS
In Fig. 20 a list of assignments is opened in the Deeds main browser. Suppose that the student has to attend
the assignment # 2.1: “Analysis of a demultiplexer (1 to 2)”.

Fig. 20: A list of laboratory assignments, opened in the Deeds main browser.

Than, he or she clicks on the link, and the assignment will open in the Assistant (see Fig. 21).

30
Fig. 21: The specific laboratory assignment, opened in the Assistant browser.

The assignment asks the user to verify the behavior of the 1->2 demultiplexer represented in the figure,
using the Deeds Digital Circuit Simulator ). The text suggests to click on the figure to open in the d-DcS a
trace of the network's schematic, and then to complete it.

In this example, you see that it is necessary only a simple click on the figure to activate the simulator and to
download from the web site a ‘template’ of the solution. This approach aims to simplify user operation,
avoiding to spend time in no useful and distracting tasks.

31
The user will see the Digital Circuit Simulator, and the file downloaded in it, as in Fig. 22.

Fig. 22: The Digital Circuit Simulator, opened by a click on the web page. The circuit
template has been automatically downloaded from the courseware site.

The assignment suggests now to complete the drawing, and also to activate a few useful simulator
commands directly from the web page, with a simple click.

Once completed the schematic, also the simulation can be started, directly from the Deeds web page. In Fig.
23 you can see the results expected from the student work.

Fig. 23: The timing simulation of the circuit, once completed by the student.

32
Now is the time for the student to compile and deliver a good report. In the Deeds assignment page, a link is
prepared to download and edit a report template file (Fig. 24).

Fig. 24: The student can download the report template to speed up its compilation and delivering.

This has been previewed to uniform the report styles, making easier the teacher task, especially when the
number of student is valuable. But the availability of a report template is very useful also to the student,
because it saves a lot of time, speeding up the student work and leaving more time to concentrate on the
arguments to learn.

33
This is the report template for this laboratory assignment (Fig. 25).

Fig. 25: The report template for this laboratory assignment.

34
d-DcS: Menu Commands
The menu of the Digital Circuit Simulator allows the user to access all the function of the application. The
ToolBars replicate most of the commands already in the menu, to speed up user operations.

File Menu

Fig. 26a: The d-DcS “File“ menu.

New
Command to create a new circuit file.

Open
Command to open a circuit file. The file can be also downloaded directly from a
web site.

Save
Command to save current circuit file.

Save as
Command to save current circuit file with a different name or in a different position.

Print
Command to print the circuit.

35
Paper Setup
Command to define current paper format and orientation. It displays the Paper
Setup dialog window (Fig. 26b).

Fig. 26b: The Paper Setup dialog window.

Recent Files List


Commands to re-open the most recent files. Up to 8 recent files can be reopened
with this list. The symbol that is displayed on the left of the file name means that:
The file has been stored by the user on the local disk or network.

The file has been downloaded from a web site, but it has not been saved
(yet) on the local disk or network.
The file has been loaded from a local courseware, where it is read only
and it has not been saved (yet) on the local disk or network.

Exit
Standard command to close the application.

36
Edit Menu

Fig. 27: The d-DcS “Edit“ menu.

Undo
Command to undo the previous operation.

Redo
Command to redo the operation previously cancelled by the Undo command
(command temporary inhibited).

Cut
Command to cut the selected part of the circuit, and copy it on the clipboard
(command temporary inhibited).

Copy
Command to copy the selected part of the circuit on the clipboard (command
temporary inhibited).

Paste
Command to paste the clipboard content in the circuit (command temporary
inhibited).

Select All
Command to select all the object of the drawing.

Copy Image
Command to copy the selection as a bitmap image and put it on the Clipboard.

Delete
Command to delete all the selected components.

37
View Menu

Fig. 28: The d-DcS “View“ menu.

Zoom In
Command to “zoom in” the drawing.

Zoom Out
Command to “zoom out” the drawing.

Zoom 1,2,3,4,5
Command to “zoom” the view to different levels The “standard” level is the ‘3’.

Normal
Command to set the “normal view” of drawing space (i.e. as uniform continuous
background, only with the indication of drawing margins).

Page Layout
Command to set the view of the drawing space as a paper foil (i.e. with visible foil
borders and shadows, together with drawing margins).

38
Tools Menu

Fig. 29: The d-DcS “Tools“ menu.

Select One
Command to selects one object (by point and click).

Select by Area
Command to select a group of objects in a rectangular area.

Select and Move


Command to select and move a single object (by point and click).

Select and Delete


Command to select and delete a single object (by point and click).

Label
Command to insert (or edit) the label of a selected object (it is possible to associate
labels only to Input/Output blocks and to Finite State Machine components).

Rotate
Group of commands to rotate an object (during its insertion).

Right, Down
Left, Up
Four commands to rotate an object (during its insertion) to the specified direction.

Toggle
Command to toggle the direction of an object (during its insertion).

39
Circuit Menu

Fig. 30: The d-DcS “Circuit“ menu.

Clock Generator
Command to insert in the circuit a Clock Generator component.

Input
Command to insert in the circuit a Input Switch component.

High Level
Command to insert in the circuit a High Level Input component (logic ‘1’).

Low Level
Command to insert in the circuit a Low Level Input component (logic ‘0’).

Wire
Command to insert in the circuit a wire segment. The wiring system supports
automatic insertion of “wire nodes” when a wire is connected to another one.

40
Output
Command to insert in the circuit a binary Output Display component (it displays ‘0’,
‘1’ or ‘unknown’ symbols).

Display
Command to insert in the circuit an Hexadecimal Output Display component (it
displays hex digits from ‘0’ to ‘F’, or a ‘unknown’ symbol).

Input
Command to insert in the circuit a Input Switch component.

Error Check List


Command to error check the wiring of the circuit. It shows or hides, at the bottom of
the window, an “error check list” of wire connections.

Components
Command to insert in the circuit a component, selected by the user in the sub
menu. A description of all the sub menu’s is reported in the following.

Not

Command to insert a ‘NOT’ component.

ANDs

Commands to insert ‘AND’ components.

NANDs

Commands to insert ‘NAND’ components.

ORs

Commands to insert ‘OR’ components.

41
NORs

Commands to insert ‘NOR’ components.

EXORs

Commands to insert ‘EXOR’ and ‘EXOR tree’ components.

Decoders

Commands to insert ‘Decoder’ components.

Encoders

Commands to insert a ‘Priority Encoder’ component.

Multiplexers

Commands to insert ‘Multiplexer’ components.

Demultiplexers

Commands to insert ‘Demultiplexer’ components.

42
Flip-Flop

Commands to insert ‘Flip-Flop’ components.

Registers

Commands to insert ‘Register’ components.

Counters

Commands to insert ‘Counter’ components.

Finite State
Machine

Commands to insert ‘Finite State Machine’ components.


The ‘New’ command activate the Finite State Machine Simulator (d-FsM), allowing
the user to create a new component ‘from scratch’.
The ‘Load’ command allows the user to load a previously designed component.

43
Simulation Menu

Fig. 31: The d-DcS “Simulation“ menu.

Mode
Command group to set the simulation mode.

Interactive
Animation
Command to set the Interactive Animation Mode for simulation. When activated,
simulation don’t start immediately. If the Timing Diagram window is opened, it will
be closed. The editing commands are disabled, and the user is prompted to save
the file in the schematic editor, if it is not.

Timing Diagram
Simulation
Command to set the Timing Diagram Mode for simulation. When activated,
simulation doesn’t start immediately, but the Timing Diagram window is opened
instead. The editing commands are disabled and the user is prompted to save the
file in the schematic editor, if it is not.

Start Animation
Command to start simulation, when currently mode is ‘Animation’.

Stop Animation
Command to stop simulation, when currently mode is ‘Animation’.

44
Deeds Menu

Fig. 32: The d-DcS “Deeds“ menu.

Switch to Deeds
Command to switch focus to the Deeds main browser.

Switch to Last
Command to switch to the tool that was ‘last on top’ before switching to the
currently opened instance of the d-DcS.

Switch to Next
Command to switch focus among all active Deeds applications, in order of
activation.

45
Options Menu

Fig. 33: The d-DcS “Options“ menu.

Configuration
Command to change the application configuration (disabled in this version).

ToolBars
Commands to control ToolBars appearance.

Standard ToolBar
Command to hide or show the Standard ToolBar (the upper one).

Component
ToolBar
Command to hide or show the Component ToolBar (the lower one).

Show and Dock


All ToolBars
Command to show and dock in all the ToolBars.

Dockable
ToolBars
Command to enable or disable the docking modality of the ToolBars.

Status Bar
Command to hide or show the Status Bar.

46
Help Menu

Fig. 34: The d-DcS “Help“ menu.

Index
Command to open the d-DcS Help System (disabled in this version).

Data sheets
Command to open the Data Sheets help system (disabled in this version).

License
Agreement
Command to display the Licence Agreement.

Version Notes
Command to display the Deeds “Version Notes” file.

About
Command to display the d-Dcs ‘splash’ window dialog.

47
Deeds: Finite State Machine Simulator d-FsM

This image from the Tapestry of Bayeux, Bayeux Cathedral, France

48
Introduction
The Finite State Machine Simulator d-FsM allows graphical editing and simulation of Finite State
Machines components, using the ASM (Algorithmic State Machine) paradigm (fig. 35). The tool allows the
local functional simulation of the finite state machines designed by the user, with runtime display of the
relations between state and timing evolution (fig. 36).

Fig. 35: The ASM editor of the Finite State Machine Simulator (d-FsM).

The components that the d-FsM produces can be directly used in the d-DcS and inserted into any digital
circuit. Also, it can be exported in VHDL language.
A general purpose Finite State Machine software simulator helps the student to enhance his design skills
and facilitates also the transition from the pedagogical to the professional field, by introducing CAD
methodologies.

49
Fig. 36: The ASM editor of the Finite State Machine Simulator (d-FsM).

Finite State Machines


Finite State Machines (FSM) represent a model to design a class of digital
sequential circuits. A sequential system is a block whose outputs are a
function not only of the current inputs but also of the previous ones. In other
words, the logic has a sort of “memory” which records previous input
history so it can be responded to in the present.
Given this definition, sequential circuits would seem to require enormous
amounts of memory to record all previous inputs. However, for any real
logic design task, the fact that previous input combinations result in only a
finite number of distinct output classes reduces this memory requirement to
manageable levels. This class of design is called a Finite State Machine, or
just a state machine.
Modern digital circuit design is essentially based on Finite State Machines.
Design, synthesis and documentation of a state machine require a formal
approach. Currently, several design methods are employed, based either
on graphic, tabular or textual representations of the algorithm underlying
the state machine.

FSM description languages: ASM charts


The most common graphical methods currently in use to describe a FSM
are Moore and Mealy State Diagrams. In our simulator we use the ASM
(Algorithmic State Machine) method, instead.
A typical ASM chart (or diagram) resembles flowchart notation (Fig. 37),
even if they are not the same thing. It describes state flow, the output
functions and the next-state functions of a state machine. ASM charts have
the same function as Moore and Mealy State Diagrams: they describe the
behaviour of finite state machines so that it is clearly understandable for the Fig. 37: A simple Algorithmic
designer and, at the same time, ASM charts support a direct translation into State Machine (ASM) diagram.
a hardware realization of the control algorithm.

50
An ASM chart is composed of three basic elements, the State (rectangular box), the Decision Block
(diamond) and the Conditional Output Box.
A set composed of one state box, decision blocks and conditional output blocks is named ASM Block. An
ASM Block has one entry point, but may have any number of exit paths, each of them connecting to another
state box.
The FSM moves from state to state at each clock cycle; each state may have a state output; conditional
blocks allow choosing a direction as a function of the value of the inputs; conditional outputs depend not only
on states but also on input values.

State Block
On an ASM chart, a state is represented by a state box, which is a rectangle
with the name of the state encircled and placed at the side of the rectangle
(Fig. 38a). You can specify that an output signal is unconditionally active in a
particular state by writing the output signal's name inside the corresponding
state box. Output signals written inside state boxes are known as state outputs
or Moore outputs. Fig. 38a: State Block

Decision Block
While unconditional transitions can be represented with a straight, not labelled
arrow traced between two state boxes, conditional transitions deserve a more
specific symbol. This is called decision diamond. Depending on the value of the
expression written inside the diamond, the machine will follow one of the two
labelled transition arrows going out of the diamond. A diamond has always two
outgoing arrows, one labelled "1" (or TRUE) and the other labelled "0" (or
FALSE) that corresponds to the values of the boolean expression inside.
Fig. 38b: Decision Block

Conditional Output Block


Sometimes you may need to activate an output signal in a particular state only
if a certain condition on inputs is satisfied (such output signals are known as
conditional outputs or Mealy outputs). In that case you need to use the
conditional output block.
Just put the ellipse on a transition arrow coming out of a decision diamond, and
write inside the ellipse the name of the output signal you want to activate when
the expression inside the diamond is true. Please notice that the conditional Fig. 38c: Conditional Output
block does not represent a state; instead it activates an output that it is active Block
in the state it descends from.

ASM Charts & State Diagrams


It is easy to convert a State Diagram in an ASM Chart, and vice versa. In Fig. 39a we report a basic example
of State Diagram:

Fig. 39a: The State Diagram representation of a SR flip-flop.

51
The following ASM Chart (Fig. 39b) can be used to model exactly the same behaviour:

Fig. 39b: The ASM Chart representation of a SR flip-flop.

The first thing you can see is that in both models you have an object to represent the states of the machine.
The states are numbered (1, 2) in the State Diagram and labelled with letters (a, b) in the ASM Chart, but the
1:1 relationship between them is obvious:
• state 1 = state a = flip-flop output "0"
• state 2 = state b = flip-flop output "1"
Another noticeable thing is that the two models are morphologically very similar. In both models you can
observe that every state has two outgoing transitions, one being a loop on the state itself, and the other
going to the other state. This similarity is always true if you make a conversion between ASM Charts and
State Diagrams, just remember that in ASM Charts conditional transitions come out of decision diamonds
which are not states (but they "belong" to the state they descend from).
The method used to represent conditional transitions on ASM Charts is more algorithm-oriented, as it uses
flow-chart syntax, which is less redundant than State Diagram syntax. In this case, for example, it helps the
reader understand that the transition that follows state a depends only on the value of the S input. Similar
considerations can be done about the transition that follows state b: only the value of the R input is relevant
in that case.

The following pictures are examples of ASM Chart <-> State Diagram conversion (Fig. 40a and 40b).

Fig. 40a: ASM chart and State diagram representing the same algorithm:
the FSM waits in the state ‘a’ until the x input goes to one.

52
Fig. 40b: Another example of ASM chart and State diagram representing the same algorithm.

FSM description languages: state transition table


The state transition table (Fig. 41) is the most compact description of a FSM and lends itself very well to be
used as interface with computer software and as a basis for the logical synthesis of the hardware. Of course,
the table is not a valid FSM design tool because it does not provide any help in conceiving the FSM
algorithm. Its main usefulness rests therefore in its use as a synthetic representation that may be common to
both the languages described above.

Fig. 41: The state transition table of the example above, as generated by the d-FsM.

FSM description languages: hardware description language


The use of circuit description languages (HDL, VHDL, Verilog) to represent finite state machine has gained a
strong diffusion and probably in many cases has replaced the graphical languages. The description of the
state machine takes in this case the format of a high level software program.
The Finite State Machine Simulator exports the FSM components in VHDL format (Very High speed
integrated circuits Hardware Description Language). In Fig. 42 you can see the VHDL equivalent of the ASM
diagram in Fig. 37, as generated by the Finite State Machine Simulator.
The list starts with the “Entity” i.e. the definition of the FSM as a block with inputs and outputs. Then an
object (Architecture) of the entity is instantiated. An entity may be described in three different ways:
structural, data flow, functional. The structural description decomposes the entity in terms of basic digital
components and their connections. The data flow description represents the FSM in terms of signals and
operations on them. The last description, the functional one, is the more powerful because it allows to see
the hardware circuit as a software program with input and output variables.
The FSM is therefore described as a process activated, in our case, by the clock or reset signals. Each state
is coded as an internal variable. An instruction “case” within each state defines the outputs to activate and
the next state.

53
------------------------------------------------------------
-- DEEDS (Digital Electronics Education and Design Suite)
-- VHDL Code generated
-- by Finite State Machine Simulator (d-FsM)
-- Copyright © 2001-2004 DIBE, University of Genoa, Italy
-- Web Site: http://esng.dibe.unige.it/netpro/Deeds
------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY Deriv_UC IS
PORT( ------------------------>Clock & Reset:
Ck: IN std_logic;
Reset: IN std_logic;
------------------------>Inputs:
IIN: IN std_logic;
------------------------>Outputs:
OOUT: OUT std_logic );
END Deriv_UC;

ARCHITECTURE behave OF Deriv_UC IS -- (Behavioral Description)


TYPE states is ( state_a,
state_b );
SIGNAL State,
Next_State: states;
BEGIN
-- Next State Combinational Logic ----------------------------------
FSM: process( State, IIN )
begin
CASE State IS
when state_a =>
if (IIN = '1') then
Next_State <= state_b;
else
Next_State <= state_a;
end if;
when state_b =>
if (IIN = '1') then
Next_State <= state_b;
else
Next_State <= state_a;
end if;
END case;
end process;

-- State Register --------------------------------------------------


REG: process( Ck, Reset )
begin
if (Reset = '0') then
State <= state_a;
elsif rising_edge(Ck) then
State <= Next_State;
end if;
end process;

-- Outputs Combinational Logic -----------------------------------


OUTPUTS: process( State, IIN )
begin
-- Set output defaults:
OOUT <= '0';

-- Set output as function of current state and input:


CASE State IS
when state_a =>
if (IIN = '1') then
OOUT <= '1';
end if;
when state_b =>
if (IIN = '0') then
OOUT <= '1';
end if;
END case;
end process;
END behave;

Fig. 42: The VHDL equivalent of the ASM diagram in Fig. 37, as generated by the d-FsM.

54
Learning FSM: methods and problems
The choice of a FSM description language is very important under the pedagogical point of view. When first
introducing the state machine, we believe it is essential that the learner masters its fundamental concepts
and develop an intuitive understanding of its behaviour. At this level, therefore we believe it is convenient to
represent the machine algorithms with graphical methods, in our case ASM charts.
When the student has gained familiarity with the design method and is ready to develop non-standard digital
structures described by a set of specifications, switching to an hardware description language will develop
his abstraction skills and introduce him to professional design.
The VHDL export feature has been developed to make easier the transition from ASM description method to
the HDL-based world.

Reusing FSM component: they can be imported in d-DcS


As said before, the component the d-FsM produces can be directly used in the d-DcS and inserted into any
digital circuit. In Fig. 43 you see a screen shot where the simple component (seen before) is imported in the
d-DcS, and the network is simulated.

Fig. 43: In this example, a component, designed with the d-FsM, has been imported in the d-DcS.

In the d-DcS the FSM interpreter works together the simulator kernel to produce functional results. FSM to a
maximum number of 64 states can be designed and simulated, and a practical limitation to 8 inputs and 8
outputs has been introduced, mostly for graphical reasons. Such limitations are largely compatible with the
learning aims of the simulator. The FSM interpreter is able to simulate synchronous FSM with conditioned
outputs.
In the d-DcS the student can drive the inputs and observe the outputs of the FSM block as well as the
internal state of the FSM (in Fig. 43, the row named with the name of the component: ‘deriv.fsm’).
The user can connect standard digital components to the FSM block and therefore simulate digital systems
characterised by a functional division between architecture and controller, the last one being implemented by
a finite state machine.
If a student wishes to compare the results with the ones obtained by traditional synthesis, he can proceed
manually using the table of transitions or the ASM chart in order to obtain a traditional structure with a state
register made by flip-flops and a combinational network based on logic gates.

55
A simple example
In following screen shots of the d-FsM (Fig. 44a,b,c), you can see the drawing of an ASM diagram, followed
by a preliminary verification in the internal timing simulator.

d) the student picks-up state blocks from the bin on the Tool Bar (Fig. 44a), then
e) adds conditional blocks (Fig. 44b) and, by last,
f) connect logically them using lines (Fig. 44c).

At every step, when needed, the student sets properties of each introduced block.

Fig. 44a: The student inserts state blocks, setting their properties.

Fig. 44b: The student inserts conditional blocks, setting their properties.

56
Fig. 44c: The student inserts logical path (the green lines, no property needs to be set).
Note that the line arrows are automatically added.

The diagram describes an edge detector. Each time the input ‘IN’ presents a transition (‘0’ to ‘1’, or ‘1’ to ‘0’),
an output pulse, of the duration of one clock cycle, is generated.

To verify its behaviour, it is possible simulate it with the d-FsM. The timing simulation of the d-FsM is only
functional: it don’t take in count component delays, for instance, because it simulates directly the algorithm,
without synthesize the network in term of gates and flip-flops. Fig. 45 shows the results of the simulation. As
expected, the output line OUT goes ‘high’ for one clock cycle each time the input line IN presents a level
transition.

Fig. 45: The simulation results for the edge detector described above.

57
In Fig. 46 is reported the ASM transition table describing the designed FSM, as well as the preview of the
automatically generated symbol of the new component.

Fig. 46: The ASM transition table describing the component, on the left, and the generated symbol, on the right.

Now the component is ready to be imported in the d-DcS. We insert the component in a very simple way,
loading it from file. An example of use of this component in the d-DcS is shown in the Fig. 47, where two
instances of it are connected in a circuit composed also of standard gates.

Fig. 47: Two instances of the component are connected in a circuit composed of standard gates, in the d-DcS.

58
Then the student could verify the correct behaviour of the network under test, comparing d-DcS simulation
results with those expected, in particular with the functional simulation produced by the d-Fsm. In Fig. 48,
you see a screen shot of the timing simulation obtained with the d-DcS.

Fig. 48: Timing simulation of the previous network, obtained with the d-DcS.

This image from the Tapestry of Bayeux, Bayeux Cathedral, France

59
A simple example of interaction between Deeds browsers and d-FsM
As in the example applied to the Deeds with the d-DcS, in Fig. 49 a list of laboratory assignments is opened
in the Deeds main browser.

Fig. 49: A list of laboratory assignments, with use of d-FsM, opened in the Deeds main browser.

The student executes the assignment # 8.1: “Design of a synchronous mod-5 up/down counter”. As in the
example related to the d-DcS, with a click of the user on the link, the specific assignment will be opened in
the Assistant (Fig. 50a and 50b).

60
Fig. 50a: The specific laboratory assignment, opened in the Assistant browser (first page).

The assignment asks the user to design a synchronous mod-5 up/down counter, using the Finite State
Machine Simulator.

In the laboratory assignment (Fig. 50a) is explained that the counter should generate a numerical sequence
on the outputs QC, QB and QA, depending from the line input EN and DIR. The counter is synchronous with
the clock CK and it is initialized by an asynchronous Reset input. In particular, the input DIR defines the
count direction (up or down), and the input EN enables the count operation, that will take place on every
clock positive edge.

61
In Fig. 50b, the assignment continues with a suggestion: to download an ASM diagram template, to be
guided toward the solution. If the student use this option, he or she could concentrate better on the
argument, instead of build from scratch the solution, bothering with the simulator details and spending time in
less useful and distracting tasks. The option is not mandatory, however, and the student can freely activate
the simulator without using the template.

Fig. 50b: The specific laboratory assignment, opened in the Assistant browser (second page).

To download the template, it is necessary only a simple click on the link in the text. The d-FsM will be
activated, and the file downloaded from the web site, automatically. In Fig. 51 you see the suggested
template, as downloaded in the simulator.

Fig. 51: The downloaded ASM diagram, template of the solution.

In the template, as the text of the assignment explains, the student will find some important definition already
set: the state variables X,Y,Z, the outputs QC, QB, QA and the inputs DIR and EN. The necessary five state
blocks are already drawn.

62
In Fig. 52a,b,c are displayed the pre-defined properties, as they appear in the Input/Output dialog windows,
that the user activates with the tool bar command .

Fig. 52a,b,c: The three pages of the Input/Output dialog window, used to define inputs, outputs and state variables .

Note that the specification requires that the 'a' state will be the 'Reset' state, i.e. the 'starting' state of the
component at the activation of the asynchronous !Reset. Also this characteristic has been pre-defined in the
template, as the ‘a’ state appears in the drawing with a little diamond placed on it.

Actually, all the states properties have been pre-defined in the template. The user can modify this properties
opening the Property Window. This can be left aside to the editor, during the operations (to open it, press the
tool bar button ). In Fig. 53 you see the Property Window, as it appears when the user select the ‘a’ state
block (with a mouse click on it).

Fig. 53: The property window, displaying the properties of the ‘a’ state.

For a state block, the user can set or change the symbolic name (‘a’ in the present case), the state code
(‘000’, here), and the active outputs (none, in the example). The check box on the left imposes this one as
‘Reset State’.

The user is asked to complete the ASM diagram and, using the timing simulation integrated in the d-FsM, to
verify the correct sequence of output values and state codes. The user will start drawing, adding path lines
and diamonds, as required by the requested functionality.

63
In Fig. 54 you see the Property Window, as it appears when the user select a condition block. The user can
change the orientation of the diamond connections and the condition, chosen among the input variables
(‘DIR’ in this example).

Fig. 54: The property window, displaying the properties of a condition block.

Once the student have finished the design, the next step required is to verify the behaviour of the counter
with the timing simulator of the d-FsM itself (Fig. 55).

Fig. 55: The finished ASM diagram, and its timing simulation, in the d-FsM.

64
When the user clicks on the ‘Clock’ button, the internal simulator evaluates next state and outputs (according
to the current input values) and displays the results on the time diagram.

At the same time, in the editor window, the corresponding new state is highlighted (with a coloured frame
around it, see Fig. 55). This is an important feature, because a major difficulty, for a beginner, is to
understand the correspondence between states and events time sequence.

Finally, when the behaviour of the component satisfies all the required specifications, the component could
be imported in the d-DcS (see the assignment, Fig. 50b). Also in this case, a simple d-DcS schematic
template is provided, to speed up the operations; it can be easy downloaded and opened in the d-DcS with a
click on the hyperlink in the text. Once completed the schematic, the simulation of the counter could be
repeated in the d-DcS timing simulator (Fig. 56).

Fig. 56: The finished d-DcS schematic, and the timing simulation of the component, in the d-DcS.

As in the example related to the d-DcS, at this point the student will compile and deliver a report about its
work. As already seen, in the assignments page, a link is set to download a report template file (Fig. 57).

65
Fig. 57: Also in this case, the student will download the report template to speed up its compilation and delivering.

In Fig. 58 is displayed the report template prepared for this laboratory assignment, downloaded and ready to
be edited.

Fig. 58: The report template for this laboratory assignment assignment.

66
The timing diagram window
In this window (Fig. 59) the timing diagram of all the signals is constructed, during the simulation, in a
interactive mode. The timing diagram displays the Input and Output signals and, at bottom, the current State,
by symbolic name and by code.

Fig. 59: The Timing Diagram window of the d-FsM.

In the default mode, the user clicks on the ‘Clock’ button to advance the simulation by one step (a
clock cycle).
If the tool bar button is checked, the simulation step is automated (the execution speed is controlled by
the tool bar cursor ).
To toggle Input signal values, the user clicks on the Input signal buttons, under the ‘Clock’ button. In the

example of Fig. 59, the button is .


The button restarts simulation (from time = 0).
The button activates the ASM Table window (Fig. 60). In this table Inputs, Outputs and current and next
States are expressed in a compact, tabular form.

Fig. 60: The ASM Table window.

67
d-FsM: Menu Commands
The menu of the Finite State Machine Simulator allows the user to access all the function of the
application. The ToolBars replicate most of the commands already in the menu, to speed up user
operations.

File Menu

Fig. 61: The d-FsM “File“ menu.

New
Command to create a new Finite State Machine file.

Open
Command to open a Finite State Machine file. The file can be also downloaded
directly from a web site.

Save
Command to save current Finite State Machine file.

Save as
Command to save current Finite State Machine file with a different name or in a
different position.

68
Close
Command to close the current Finite State Machine.

Export VHDL
Command to export the Finite State Machine ASM diagram in VHDL language. It
shows a window with the equivalent VHDL code, generated from the internal data
base (Fig. 62).

Fig. 62: The VHDL code window.

If you wish to save the generated code in a file, click on the ‘Save’ button: you will
prompted to chose a name file, before to save it. If you want include the VHDL
code in another text file, click on the ‘Copy’ button to pass all the VDHL code onto
the ‘clipboard’, ready to be pasted in a code editor of your choice.

Print
Command to print the Finite State Machine ASM diagram.

Paper Setup
Command to define current paper format and orientation. It displays the Paper
Setup dialog window (Fig. 63).

Fig. 63: The Paper Setup dialog window.

69
Recent Files List
Commands to re-open the most recent files. Up to 8 recent files can be reopened
with this list. The symbol that is displayed on the left of the file name means that:
The file has been stored by the user on the local disk or network.

The file has been downloaded from a web site, but it has not been saved
(yet) on the local disk or network.
The file has been loaded from a local courseware, where it is read only
and it has not been saved (yet) on the local disk or network.

Exit
Standard command to close the application.

70
Edit Menu

Fig. 64: The d-FsM “Edit“ menu.

Undo
Command to undo the previous operation (command temporary inhibited).

Cut
Command to cut the selected part of the ASM diagram, and copy it on the
clipboard (command temporary inhibited).

Copy Image
Command to copy the selection as a bitmap image and put it on the Clipboard.

Paste
Command to paste the clipboard content in the circuit (command temporary
inhibited).

Select All
Command to select all the object of the drawing.

Define In / Out
Command to define or modify Inputs, Outputs and State Variables. It activates a
modal dialog window (see Fig. 65), where the user can add, rename and delete the
Input and Output lines (up to 8 lines), as well as the State Variables (up to 6). The
dialog is divided in the specialized pages (Input, Output and State Vars).

Fig. 65: The three pages of the Input/Output dialog window, used to define inputs, outputs and state variables .

71
View Menu

Fig. 66: The d-FsM “View“ menu.

Zoom In, Out


Command to “zoom in” or “zoom out” the drawing.

Property ToolBox
Command to activate the “Property Window”, that enables the user to set and
modify the properties of the selected State Block, Conditional Block or Conditional
Output Block. It shows four different “property pages”, depending on the context
(Fig. 67).

Fig. 67: The four pages of Property Window, used to define properties of state, conditional and conditional output blocks.

Normal
Command to set the “normal view” of drawing space (i.e. as uniform continuous
background, only with the indication of drawing margins).

Page Layout
Command to set the view of the drawing space as a paper foil (i.e. with visible foil
borders and shadows, together with drawing margins).

72
Tools Menu

Fig. 68: The d-FsM “Simulation“ menu.

Start Simulation
Command to start the functional simulation of the finite state machine represented
by the currently ASM diagram. During simulation, the editor commands are
inhibited, and the “Timing Diagram” window is displayed (Fig. 59).

Stop Simulation
Command to stop simulation and return to the edit mode of the ASM diagram.
Four commands to rotate an object (during its insertion) to the specified direction.

73
Window Menu

Fig. 69: The d-FsM “Window“ menu.

Tile Vertical
Command to tile vertically the opened windows (the graphical editor, the timing
diagram, the ASM table).

Tile Horizontal
Command to tile horizontally the opened windows (as above).

Cascade
Command to cascade diagonally the opened windows (as above).

Arrange Icons
Command to reorder the icons of the iconized windows, at the bottom of the main
window.

Opened windows
list
Command to switch focus among the opened windows within the main window.

74
Deeds Menu

Fig. 70: The d-FsM “Deeds“ menu.

Switch to Deeds
Command to switch focus to the Deeds main browser.

Switch to Last
Command to switch to the tool that was ‘last on top’ before switching to the
currently opened instance of the d-DcS.

Switch to Next
Command to switch focus among all active Deeds applications, in order of
activation.

75
Help Menu

Fig. 71: The d-FsM “Help“ menu.

Index
Command to open the d-FsM Help System (disabled in this version).

License
Agreement
Command to display the Licence Agreement.

Version Notes
Command to display the Deeds “Version Notes” file.

About
Command to display the d-FsM ‘splash’ window dialog.

76
Deeds: The Micro Computer Emulator d-McE

This image from the ancient (and mysterious) Piri Reis map (1513)

77
Introduction
With the Micro Computer Emulator d-McE, the user can practice programming at assembly language level
(Fig. 72). It functionally emulates a board including a CPU, ROM and RAM memory, parallel I/O ports, reset
circuitry and a simple interrupt logic. The custom 8 bit CPU, named DMC8, has been designed to suite our
educational needs, and it is based on a simplified version of the well-known ‘Z80-CPU’ processor.

Fig. 72: The assembler code editor of the Micro Computer Emulator (d-McE).

The integrated source code editor enables user to enter assembly programs, and a simple command permits
to assemble, link and load them in the emulated system memory.

78
The execution of the programs can be run step by step in the interactive debugger (Fig. 73). In the debugger,
as in professional tools, the user can evaluate the contents of all the structures involved in the hardware /
software system, by stepping the execution of the programs.

Fig. 73: The assembler-level debugger of the Micro Computer Emulator.

Fig. 74: The emulated board, as represented in the Micro Computer Emulator.

79
A simple example
In the following screen shot (Fig. 75) you can see an assembly program edited in the d-McE code editor. The
code editor supports syntax highlighting. The code of the DMC8 microprocessor assembly is mainly the
same of the well-known ‘Z80-CPU’ processor, but reduced of some instructions, to simplify and ‘linearize’ the
instruction set.

Fig. 75: The editing phase of an assembly program, in the d-McE.

The microprocessor architecture is documented in the help system. This presents topics to the user as a
“multi-page” window (Fig. 76).

The instruction set is documented ‘on line’, to help the user in writing the assembly programs (examples in
Fig. 77 and 78).

80
Fig. 76: The DMC8 “architecture”, as shown by the help-system.

Fig. 77: An example of the ‘on line’ instruction set documentation: the Arithmetic and Logic instructions.

81
Fig. 78: Another example of the ‘on line’ instruction set documentation: the Shift and Rotate instructions.

When the user wishes to verify the correctness of the written code, or when the coding is finished, he or she
can launch the Assembler module, using the tool bar button . In Fig. 79 an example of assembling report,
in case of error, is shown (a unknown label was found, and the offending line is pointed by a little symbol).

Fig. 79: The Assembler module reports an error in the source code.

82
When the code has been cleaned, and no syntax error is reported, the program can be tested in the
debugger (Fig. 80).

Fig. 80: The Debugger module shows the program under test, the memory, the CPU registers, the I/O ports.

The first ‘pane’ in the window shows the CPU internal registers. For instance, at this moment of the program
execution, the Program Counter register contains the value 003Ah (as you can see also in the last pane,
where the current instruction to be executed in actually at this address).

The second pane displays the memory contents. The used memory locations are highlighted: they
correspond to the object code under execution. The user can change manually each memory location.

The third pane represents the Input / Output port contents. The user can interact with these ports, changing
the Input values, by clicking on the little round buttons (corresponding to the port bits), or writing the value in
the field aside (in decimal or hexadecimal coding).

The last pane presents to the user the object code in execution, as loaded in memory, in numerical format
(on the left) and in assembly source format (on the right).

The student can execute the program step by step, or by animation, a modality that resembles the real
execution, but at ‘human readable’ speed. A cursor permits to regulate the animation speed to the needs of
the test.

83
A simple example of interaction between Deeds browsers and d-McE
In Fig. 81 a list of laboratory assignments is opened in the Deeds main browser. The student has to attend
the assignment # 4.1 of the course on Microcomputer: “Asynchronous serial communication”.

Fig. 81: A list of laboratory assignments, opened in the Deeds main browser.

With a click on the link, the assignment will open in the Assistant (see Fig. 82a and 82b).

84
Fig. 82a: The specific laboratory assignment, opened in the Assistant browser (first part).

In this assignment (Fig. 82a), we require to the student to write a program to receive and retransmit serial
asynchronous information, using the parallel ports available in the d-McE. The program should take in
charge the operation of de-serializing and serializing data. Also a simple cryptographic method is applied to
data before retransmitting it.

In the assignment is described the format of the serial data packet (standard 8 bit asynchronous serial
communication, without parity control). That protocol previews one start bit at ‘1’, eight data bits b7..b0 (b7
ahead), one stop bit at ‘0’. It is defined a low bit rate (100 bits per second), with the aim to let the user
concentrate on the basic tasks, without bothering too attention to timing problems.

The text continues suggesting to connect the input and output serial lines to specific bits of the available
input and output ports (INPORT and OUTPORT ).

The simple cryptographic operation requires that the program remember the previous transmitted byte and
combine it in a byte-wise EXOR operation with the currently received one.

85
Fig. 82b: The specific laboratory assignment, opened in the Assistant browser (second part).

The theme continue with the guidelines for a possible solution, as the student, at the moment of this
laboratory session, faces this kind of problems for the first time (Fig. 82b).

The Deeds let to get a trace of the solution, with a simple click on the specific link. It will be automatically
downloaded and opened in the source code editor of the d-McE (Fig. 83). As usual, this approach let the
user simplify the operations necessary to start with the ‘true’ work.

86
Fig. 83: The Micro Computer Emulator, opened by a click on the web page. The editor
shows the trace of the solution, automatically downloaded from the courseware site.

Note the icon visible on top of the editor page: . In this case the symbol indicates that the file has been
downloaded from the web. When the user will save it on the local disk, this little icon will change in .

Once completed the assembly coding of the program, the student will compile it. If no syntax error has been
found, the verification of the program functionality can start (Fig. 84).

87
Fig. 84: The program under test in the interactive debugger of the d-McE: a Warning has be sent to the user.

In Fig. 84 the program is ‘Animated’ by the student, i.e. it is automatically executed step by step, at a ‘human
readable’ speed. The speed is controlled by the cursor visible on the tool bar (“Animation Speed”).

In this example, a typical warning message is generated by the debugger. In a real case, if a port hardware
address is not correctly instanced in the program code, unpredictable events could result. By the learner
point of view, it could be very difficult realize what really happens in the system.

The d-McE debugger, instead, has been designed to track many common mistakes, reporting them to the
student before then unwanted results could complicate the understanding of the wrong behaviour of the
program.

In the present case (Fig. 84), the processor should execute the OUT instruction at address 011Dh. But the
address instanced by the instruction is 35h, while no port has been set to respond to this address. So, the
student has two possibilities: to return to the editor and change the source code, adapting it to the board
setup, or to change the board setup.

88
To change the board setup, for instance, it is possible to activate (with a right-click on the port pane) the
“I/O Ports Address Decoding” dialog window (Fig. 85).

Fig. 85: Port addresses can be modified in the “I/O Ports Address Decoding” dialog window.

Another possibility, that resembles the real case, is to switch the current d-McE “page” and visualize the
physical board, as seen in Fig. 74. Now it is possible to toggle, with a mouse click, the address ‘dip-switches’
that define the hardware address decoding (Fig. 86).
IA, IB, IC and ID are the addresses of the four parallel input ports available on board; OA, OB, OC and OD
are those of the four output ports.

Fig. 86: Port addresses can be modified by a mouse click on the simulated ‘on board’ dip switches.

When finished, the student had to compile and deliver a report. A template file for the report is available in
the assignment page (see Fig. 87).

Fig. 87: The student can download the report template to speed up its compilation and delivering.

89
In this case, the template presents only a header that permit to uniform all the report styles, making easier
the teacher task (Fig. 88).

Fig. 88: The simple template provided on the web page, that the student can download.

In the next figure, an example of complete report is displayed (Fig. 89).

Fig. 89: A partial view of a ‘final’ student report.

90
d-McE: Menu Commands
The menu of the Micro Computer Emulator allows the user to access all the function of the application.
The ToolBars replicate most of the commands already in the menu, to speed up user operations.

File Menu

Fig. 90: The d-McE “File“ menu.

New
Command to create a new (void) source file. If one or more files not void are
already in the editor, a new editor page is created.

Open
Command to open a source file. If one or more files are already in the editor, a new
editor page is created, and the file will be opened in it. The file can be downloaded
directly from a web site.

Save
Command to save current source file.

Save as
Command to save current source file with a different name or in a different
position.

Print
Command to print the source file.

91
Recent Files List
Commands to re-open the most recent files. Up to 8 recent files can be reopened
with this list. The symbol that is displayed on the left of the file name means that:
The file has been stored by the user on the local disk or network.

The file has been downloaded from a web site, but it has not been saved
(yet) on the local disk or network.
The file has been loaded from a local courseware, where it is read only
and it has not been saved (yet) on the local disk or network.

Exit
Standard command to close the application.

92
Edit Menu

Fig. 91: The d-McE “Edit“ menu.

Undo
Command to undo the previous operation (command temporary inhibited).

Cut
Command to cut the selected piece of text, and put it onto the clipboard.

Copy
Command to copy the selected piece of text onto the clipboard.

Paste
Command to paste the text from the clipboard.

Delete
Command to delete the selected piece of text.

Select All
Command to select all the text in the editor.

Find
Standard command to search strings in the text file opened in the editor.

93
Project Menu

Fig. 92: The d-McE “Project“ menu.

Assemble
Command to compile (assemble) the assembly source file opened in the editor.

Informations
Command to show statistical information about the previous compile (assemble)
operation. It shows the “Source Info” dialog window (Fig. 93).

Fig. 93: The “Source Info” dialog window.

I/O Ports Address


Decoding
Command to display the “I/O Ports Address Decoding” dialog window, that lets the
user set the hardware addresses of the Input / Output ports (Fig. 94).

Fig. 94: The “I/O Ports Address Decoding” dialog window.

94
Emulation Menu

Fig. 95: The d-McE “Emulation“ menu.

Animate
Debugger command to “Animate” the execution of the program.

Pause
Debugger command to pause the “Animation”.

Step
Debugger command to execute one instruction (the one pointed by the Program
Counter).

Step Over
This debugger command has the same effect of the previous “Step” command,
except for a particular case, the execution of the CALL. When the Program
Counter points to a CALL instruction, the Step Over command forces the
execution of the program until the corresponding RET (return) instruction is found.

Reset Board
Debugger command to simulate the effect of a Hardware Reset.

Interrupt Request
Debugger command to simulate the effect of a Interrupt Request.

Partial Timer
Reset
Debugger command to reset the ‘partial’ clock cycle.

95
Deeds Menu

Fig. 96: The d-McE “Deeds“ menu.

Switch to Deeds
Command to switch focus to the Deeds main browser.

Switch to Last
Command to switch to the tool that was ‘last on top’ before switching to the
currently opened instance of the d-McE.

Switch to Next
Command to switch focus among all active Deeds applications, in order of
activation.

96
Options Menu

Fig. 97: The d-McE “Options“ menu.

Configuration
Command to change the application configuration (disabled in this version).

97
View Menu

Fig. 98: The d-McE “View“ menu.

Assembler Output
Command to hide / show the “Assembler Output” message list (at bottom).

Directory browser
Commands to hide / show the “Directory Browser” (to the left of main window)..

Symbol Table
Command to hide or show the assembler Symbol Table window (Fig. 99).

Fig. 99: The Symbol Table window.

Registers

Command to change the user numerical format of the registers (Hexadecimal or


Decimal).

Object Code

Command to change the display mode of the Object Code pane of the Debugger
(Compact View or Extended View).

98
Help Menu

Fig. 100: The d-McE “Help“ menu.

Index
Command to open the d-McE Help System (disabled in this version).

DMC8 Short Guide


Command to open the DMC8 short programming guide.

License
Agreement
Command to display the Licence Agreement.

Version Notes
Command to display the Deeds “Version Notes” file.

About
Command to display the d-McE ‘splash’ window dialog.

99
DMC8 Instruction Set
In this chapter all the instructions implemented in the DMC8 microprocessor are listed.

Load Instructions (8 bits)


Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
LD r, r’ r ← r’ • • • • • • 01 r r’ 1 1 4
r, r’ Reg.
LD r, n r←n • • • • • • 00 r 110 2 2 7 000 B
← n → 001 C
LD r, (HL) r ← (HL) • • • • • • 01 r 110 1 2 7 010 D
011 E
LD r, (IX + d) r ← (IX + d) • • • • • • 11 011 101 DD 3 5 19 100 H
01 r 110 101 L
← d → 111 A
LD r, (IY + d) r ← (IY + d) • • • • • • 11 111 101 FD 3 5 19
01 r 110
← d →
LD (HL), r (HL) ← r • • • • • • 01 110 r 1 2 7

LD (IX + d), r (IX + d) ← r • • • • • • 11 011 101 DD 3 5 19


01 110 r
← d →
LD (IY + d), r (IY + d) ← r • • • • • • 11 111 101 FD 3 5 19
01 110 r
← d →
LD (HL), n (HL) ← n • • • • • • 00 110 110 36 2 3 10
← n →
LD (IX + d), n (IX + d) ← n • • • • • • 11 011 101 DD 4 5 19
00 110 110 36
← d →
← n →
LD (IY + d), n (IY + d) ← n • • • • • • 11 111 101 FD 4 5 19
00 110 110 36
← d →
← n →
LD A, (BC) A ← (BC) • • • • • • 00 001 010 0A 1 2 7

LD A, (DE) A ← (DE) • • • • • • 00 011 010 1A 1 2 7

LD A, (nn) A ← (nn) • • • • • • 00 111 010 3A 3 4 13


← n →
← n →
LD (BC), A (BC) ← A • • • • • • 00 000 010 02 1 2 7

LD (DE), A (DE) ← A • • • • • • 00 010 010 12 1 2 7

LD (nn), A (nn) ← A • • • • • • 00 110 010 32 3 4 13


← n →
← n →
Notes: r, r’ means any of the registers A, B, C, D, E, H, L.
Flag Notation: • = flag is not affected.

100
Load Instructions (16 bits) (first section)
Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
LD dd, nn dd ← nn • • • • • • 00 dd0 001 3 3 10 dd Pair
← n → 00 BC
← n → 01 DE
LD IX, nn IX ← nn • • • • • • 11 011 101 DD 4 4 14 10 HL
00 110 001 21 11 SP
← n →
← n →
LD IY, nn IY ← nn • • • • • • 11 111 101 FD 4 4 14
00 110 001 21
← n →
← n →
LD HL, (nn) L ← (nn) • • • • • • 00 101 010 2A 3 5 16
H ← (nn+1) ← n →
← n →
LD dd, (nn) ddL ← (nn) • • • • • • 11 101 101 ED 4 6 20
ddH ← (nn+1) 01 dd1 011
← n →
← n →
LD IX, (nn) IXL ← (nn) • • • • • • 11 011 101 DD 4 6 20
IXH ← (nn+1) 00 101 010 2A
← n →
← n →
LD IY, (nn) IYL ← (nn) • • • • • • 11 111 101 FD 4 6 20
IYH ← (nn+1) 00 101 010 2A
← n →
← n →
LD (nn), HL (nn) ← L • • • • • • 00 100 010 22 3 5 16
(nn+1) ← H ← n →
← n →
LD (nn), dd (nn) ← ddL • • • • • • 11 101 101 DD 4 6 20
(nn+1) ← ddH 01 dd0 011
← n →
← n →
LD (nn), IX (nn) ← IXL • • • • • • 11 011 101 DD 4 6 20
(nn+1) ← IXH 00 100 010 22
← n →
← n →
LD (nn), IY (nn) ← IYL • • • • • • 11 111 101 FD 4 6 20
(nn+1) ← IYH 00 100 010 22
← n →
← n →
LD SP, HL SP ← HL • • • • • • 11 111 001 F9 1 1 6

LD SP, IX SP ← IX • • • • • • 11 011 101 DD 2 2 10


11 111 001 F9
LD SP, IY SP ← IY • • • • • • 11 111 101 FD 2 2 10
11 111 001 F9
Notes: dd is any of the register pair BC, DE, HL, SP.
qq is any of the register pair BC, DE, HL, AF.
Flag Notation: • = flag is not affected.

(continue)

101
Load Instructions (16 bits) (second section)
Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
PUSH qq SP ← SP - 1 • • • • • • 11 qq0 101 1 3 11 qq Pair
(SP) ← qqH 00 BC
SP ← SP - 1 01 DE
(SP) ← qqL 10 HL
PUSH IX SP ← SP - 1 • • • • • • 11 011 101 DD 2 4 15 11 AF
(SP) ← IXH 11 100 101 E5
SP ← SP - 1
(SP) ← IXL
PUSH IY SP ← SP - 1 • • • • • • 11 111 101 FD 2 4 15
(SP) ← IYH 11 100 101 E5
SP ← SP - 1
(SP) ← IYL
POP qq (SP) ← qqL • • • • • • 11 qq0 001 1 3 10
SP ← SP + 1
(SP) ← qqH
SP ← SP + 1
POP IX (SP) ← IXL • • • • • • 11 011 101 DD 2 4 14
SP ← SP + 1 11 100 001 E1
(SP) ← IXH
SP ← SP + 1
POP IY (SP) ← IYL • • • • • • 11 111 101 FD 2 4 14
SP ← SP + 1 11 100 001 E1
(SP) ← IYH
SP ← SP + 1
PUSH qq SP ← SP - 1 • • • • • • 11 qq0 101 1 3 11 qq Pair
(SP) ← qqH 00 BC
SP ← SP - 1 01 DE
(SP) ← qqL 10 HL
Notes: dd is any of the register pair BC, DE, HL, SP.
qq is any of the register pair BC, DE, HL, AF.
Flag Notation: • = flag is not affected.

102
Arithmetic and Logic Instructions (8 bits)
Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Byte Cycles Cycles Comments
s
ADD A, r A←A+r ↕ ↕ ↕ V 0 ↕ 10 000 r 1 1 4
r Reg..
ADD A, n A←A+n ↕ ↕ ↕ V 0 ↕ 11 000 110 2 2 7 000 B
← n → 001 C
ADD A, (HL) A ← A + (HL) ↕ ↕ ↕ V 0 ↕ 10 000 110 1 2 7 010 D
011 E
ADD A, (IX + d) A ← A + (IX + d) ↕ ↕ ↕ V 0 ↕ 11 011 101 DD 3 5 19 100 H
10 000 110 101 L
← d → 111 A
ADD A, (IY + d) A ← A + (IY + d) ↕ ↕ ↕ V 0 ↕ 11 111 101 FD 3 5 19
10 000 110
← d →
ADC A, s A ← A + s + CY ↕ ↕ ↕ V 0 ↕ 001 s is any of r, n,
(HL),
SUB s A←A- s ↕ ↕ ↕ V 1 ↕ 010 (IX+d),
(IY+d),
SBC A, s A ← A - s - CY ↕ ↕ ↕ V 1 ↕ 011 as shown for the
ADD instruction.
AND s A ← A AND s ↕ ↕ 1 P 0 0 100 The underlined
bits replace the
OR s A ← A OR s ↕ ↕ 0 P 0 0 110 underlined bits
in the ADD set.
XOR s A ← A XOR s ↕ ↕ 0 P 0 0 101

CP s A-s ↕ ↕ ↕ V 1 ↕ 111

INC r r←r+1 ↕ ↕ ↕ V 0 • 00 r 100 1 1 4

INC (HL) (HL) ← (HL) + 1 ↕ ↕ ↕ V 0 • 00 110 100 1 3 11

INC (IX + d) (IX + d) ← ↕ ↕ ↕ V 0 • 11 011 101 DD 3 6 23


(IX + d) + 1 00 110 100
← d →
INC (IY + d) (IY + d) ← ↕ ↕ ↕ V 0 • 11 111 101 FD 3 6 23
(IY + d) + 1 00 110 100
← d →
DEC m M←m-1 ↕ ↕ ↕ V 1 • 101 m is any of r,
(HL), (IX+d),
(IY+d), as
shown for the
INC instruction.
DEC same
format and
states as INC.
Replace 100
with 101 in
opcode.

CPL _ • • 1 • 1 • 00 101 111 2F 1 1 4 One’s


A←A complement.
NEG _ ↕ ↕ ↕ V 1 ↕ 11 101 101 ED 2 2 8 Two’s
A←A -1 01 000 100 44 complement.
Notes: The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation.
Similarly the P symbol indicates parity.
r means any of the registers A, B, C, D, E, H, L.
CY means the carry flip-flop.
Flag Notation: • = flag is not affected, 0 = flag is reset, 1 = flag is set,
↕ = flag is set according to the result of the operation.

103
Arithmetic Instructions (16 bits)
Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
2 1
ADD HL, ss HL ← HL + ss • • ↕ • 0 ↕ 00 ss1 001 1 3 11
ss Reg.
1 1 2 1 1
ADC HL, ss HL ← HL + ss ↕ ↕ ↕ V 0 ↕ 11 101 101 ED 2 4 15 00 BC
+ CY 01 ss1 010 01 DE
1 1 2 1 1
SBC HL, ss HL ← HL – ss ↕ ↕ ↕ V 1 ↕ 11 101 101 ED 2 4 15 10 HL
– CY 01 ss0 010 11 SP
2 1
ADD IX, pp IX ← IX + pp • • ↕ • 0 ↕ 11 011 101 DD 2 4 15
00 pp1 001 pp Reg.
2 1
ADD IY, rr IY ← IY + rr • • ↕ • 0 ↕ 11 111 101 FD 2 4 15 00 BC
00 rr1 001 01 DE
INC ss ss ← ss + 1 • • • • • • 00 ss0 011 1 1 6 10 IX
11 SP
INC IX IX ← IX + 1 • • • • • • 11 011 101 DD 2 2 10
00 100 011 23
INC IY IY ← IY + 1 • • • • • • 11 111 101 FD 2 2 10 rr Reg.
00 100 011 23 00 BC
DEC ss ss ← ss - 1 • • • • • • 00 ss1 011 1 1 6 01 DE
10 IY
DEC IX IX ← IX - 1 • • • • • •
11 011 101 DD 2 2 10 11 SP
00 101 011 2B
DEC IY IY ← IY - 1 • • • • • • 11 111 101 FD 2 2 10
00 101 011 2B
Notes: The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation.
Ss means any of the registers BC, DE, HL, SP.
Pp means any of the registers BC, DE, IX, SP.
Rr means any of the registers BC, DE, IY, SP.
16 bit additions are performed by first adding the two low order eight bits, and then the two high order eight bits.
1
Indicates the flag is affected by the 16 bit result of the operation.
2
Indicates the flag is affected by the 8 bit addition of the high order eight bits.
CY means the carry flip-flop.
Flag Notation: • = flag is not affected, 0 = flag is reset, 1 = flag is set,
↕ = flag is set according to the result of the operation.

CPU Control Instructions


Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
CCF __ • • X • 0 ↕ 00 111 111 3F 1 1 4 Complement
CY ← CY carry flag.
SCF CY ← 1 • • 0 • 0 1 00 110 111 37 1 1 4

NOP No Operation • • • • • • 00 000 000 00 1 1 4

HALT CPU halted • • • • • • 01 110 110 76 1 1 4


1
DI IFF ← 0 • • • • • • 11 110 011 F3 1 1 4
1
EI IFF ← 1 • • • • • • 11 111 011 FB 1 1 4

Notes: The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation.
Similarly the P symbol indicates parity.
1
No interrupts are issued directly after a DI or EI.
CY means the carry flip-flop.
Flag Notation: • = flag is not affected, 0 = flag is reset, 1 = flag is set, X = flag is “don’t care”,
↕ = flag is set according to the result of the operation.

104
Jump Instructions
Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
JP nn PC ← nn • • • • • • 11 000 011 C3 3 3 10
← n →
← n →
JP cc, nn if cc is true, • • • • • • 11 cc 010 3 3 10 cc Condition
PC ← nn ← n → 000 NZ non zero
← n → 001 Z zero
010 NC non carry
011 C carry
100 PO parity odd
101 PE parity even
110 P sign positive
111 M sign
negative
JP ( HL ) PC ← HL • • • • • • 11 101 001 E9 1 1 4

JP ( IX ) PC ← IX • • • • • • 11 011 101 DD 2 2 8
11 101 001 E9
JP ( IY ) PC ← IY • • • • • • 11 111 101 FD 2 2 8
11 101 001 E9
Notes:
Flag Notation: • = flag is not affected.

Call and Return Instructions


Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
CALL nn SP ← SP - 1 • • • • • • 11 001 101 CD 3 5 17
(SP) ← PCH ← n →
SP ← SP - 1 ← n →
(SP) ← PCL
PC ← nn
CALL cc, nn if cc is true, • • • • • • 11 ccc 100 3 3 10 if cc is false
SP ← SP - 1 ← n → 3 5 17 if cc is true
(SP) ← PCH ← n →
SP ← SP - 1
(SP) ← PCL
PC ← nn
RET PCL ← (SP) • • • • • • 11 001 001 C9 1 3 10
SP ← SP + 1
PCH ← (SP)
SP ← SP + 1
+RET cc if cc is true, • • • • • • 11 ccc 000 1 1 5 if cc is false
PCL ← (SP) 1 3 11 if cc is true
SP ← SP + 1
PCH ← (SP)
SP ← SP + 1
RST p SP ← SP - 1 • • • • • • 11 t 111 1 3 11 __t _ p
(SP) ← PCH 000 0000h
SP ← SP - 1 001 0008h
(SP) ← PCL 010 0010h
PC ← p 011 0018h
100 0020h
101 0028h
110 0030h
111 0038h
Notes:
Flag Notation: • = flag is not affected.

105
Rotate and Shift Instructions
Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
RLCA • • 0 • 0 ↕ 00 000 111 07 1 1 4

RLA • • 0 • 0 ↕ 00 010 111 17 1 1 4

RRCA • • 0 • 0 ↕ 00 001 111 0F 1 1 4

RRA • • 0 • 0 ↕ 00 011 111 1F 1 1 4

RLC r ↕ ↕ 0 P 0 ↕ 11 001 011 CB 2 2 8 r Reg.


00 000 r 000 B
RLC (HL) ↕ ↕ 0 P 0 ↕ 11 001 011 CB 2 4 15 001 C
00 000 110 010 D
RLC (IX + d) ↕ ↕ 0 P 0 ↕ 11 011 101 DD 4 6 23 011 E
11 001 011 CB 100 H
← d → 101 L
00 000 110 111 A
RLC (IY + d) ↕ ↕ 0 P 0 ↕ 11 111 101 FD 4 6 23
11 001 011 CB
← d →
00 000 110
RL m ↕ ↕ 0 P 0 ↕ 010 m is any of r, (HL),
(IX+d), (IY+d), as
RRC m ↕ ↕ 0 P 0 ↕ 001 shown for the RLC

RR m ↕ ↕ 0 P 0 ↕ 011 instruction.

SLA m ↕ ↕ 0 P 0 ↕ 100 Instruction format

SRA m ↕ ↕ 0 P 0 ↕ 101 and States are the


same as RLC.
SRL m ↕ ↕ 0 P 0 ↕ 111 Replace 000 with
shown code.
RLD ↕ ↕ 0 P 0 • 11 101 101 ED 2 5 18
01 101 111 6F
RRD ↕ ↕ 0 P 0 • 11 101 101 ED 2 5 18
01 100 111 67
Notes: The P symbol in the P/V flag column indicates that the P/V flag contains the parity of the result.
r means any of the registers A, B, C, D, E, H, L.
CY means the carry flip-flop.
Flag Notation: • = flag is not affected, 0 = flag is reset, 1 = flag is set,
↕ = flag is set according to the result of the operation.

106
Bit Handling Instructions
Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
BIT b, r _ X ↕ 1 X 0 • 11 001 011 CB 2 2 8 r Reg.
Z ← rb 01 b r 000 B
BIT b, (HL) ___ X ↕ 1 X 0 • 11 001 011 CB 2 3 12 001 C
Z ← (HL)b 01 b 110 010 D
BIT b, (IX + d) _____ X ↕ 1 X 0 • 11 011 101 DD 4 5 20 011 E
Z ← (IX+ d)b 11 001 011 CB 100 H
← d → 101 L
01 b 110 111 A
BIT b, (IY + d) _____ X ↕ 1 X 0 • 11 111 101 FD 4 5 20
Z ← (IY+ d)b 11 001 011 CB
← d →
01 b 110
SET b, r rb ← 1 • • • • • • 11 001 011 CB 2 2 8 b Bit.
11 b r 000 0
001 1
SET b, (HL) (HL)b ← 1 • • • • • • 11 001 011 CB 2 4 15 010 2
11 b 110 011 3
SET b, (IX + d) (IX+ d)b ← 1 • • • • • • 11 011 101 DD 4 6 23 100 4
11 001 011 CB 101 5
← d → 110 6
11 b 110 111 7
SET b, (IY + d) (IY+ d)b ← 1 • • • • • • 11 111 101 FD 4 6 23
11 001 011 CB
← d →
11 b 110
RES b, m mb ← 0 • • • • • • To form new
m ≡ r, (HL), 10 opcode replace
(IX+d), 11 of SET b, s
(IY+d) with 10. Flags
and states are
the same.
Notes: The notation mb indicates bit b (0 to 7) of location m.
BIT instructions are performed by an bitwise AND.
Flag Notation: • = flag is not affected, 0 = flag is reset, 1 = flag is set, X = flag is “don’t care”,
↕ = flag is set according to the result of the operation.

Input and Output Instructions


Symbolic Flags Opcode M Clock
Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments
IN A, (n) A ← (n) • • • • • • 11 011 011 DB 2 3 11 R Reg.
← n → 000 B
IN r, (C) r ← (C) ↕ ↕ 0 P 0 • 11 101 101 ED 2 3 12 001 C
01 r 000 010 D
OUT (n), A (n) ← A • • • • • • 11 010 011 D3 2 3 11 011 E
← n → 100 H
OUT (C), r (C) ← r • • • • • • 11 101 101 ED 2 3 12 101 L
01 r 001 111 A
Notes: The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation.
Similarly the P symbol indicates parity.
r means any of the registers A, B, C, D, E, H, L.
Flag Notation: • = flag is not affected, 0 = flag is reset, 1 = flag is set,
↕ = flag is set according to the result of the operation.

107
DMC8 Instructions (in alfabetical order)
The instructions are 659, considering all the possible variations.

8E ADC A, (HL) FDCB d 46 BIT 0, (IY + d) CB6F BIT 5, A


DD8E d ADC A, (IX + d) CB47 BIT 0, A CB68 BIT 5, B
FD8E d ADC A, (IY + d) CB40 BIT 0, B CB69 BIT 5, C
8F ADC A, A CB41 BIT 0, C CB6A BIT 5, D
88 ADC A, B CB42 BIT 0, D CB6B BIT 5, E
89 ADC A, C CB43 BIT 0, E CB6C BIT 5, H
8A ADC A, D CB44 BIT 0, H CB6D BIT 5, L
8B ADC A, E CB45 BIT 0, L CB76 BIT 6, (HL)
8C ADC A, H CB4E BIT 1, (HL) DDCB d 76 BIT 6, (IX + d)
8D ADC A, L DDCB d 4E BIT 1, (IX + d) FDCB d 76 BIT 6, (IY + d)
CE n ADC A, n FDCB d 4E BIT 1, (IY + d) CB77 BIT 6, A
ED4A ADC HL, BC CB4F BIT 1, A CB70 BIT 6, B
ED5A ADC HL, DE CB48 BIT 1, B CB71 BIT 6, C
ED6A ADC HL, HL CB49 BIT 1, C CB72 BIT 6, D
ED7A ADC HL, SP CB4A BIT 1, D CB73 BIT 6, E
86 ADD A, (HL) CB4B BIT 1, E CB74 BIT 6, H
DD86 d ADD A, (IX + d) CB4C BIT 1, H CB75 BIT 6, L
FD86 d ADD A, (IY + d) CB4D BIT 1, L CB7E BIT 7, (HL)
87 ADD A, A CB56 BIT 2, (HL) DDCB d 7E BIT 7, (IX + d)
80 ADD A, B DDCB d 56 BIT 2, (IX + d) FDCB d 7E BIT 7, (IY + d)
81 ADD A, C FDCB d 56 BIT 2, (IY + d) CB7F BIT 7, A
82 ADD A, D CB57 BIT 2, A CB78 BIT 7, B
83 ADD A, E CB50 BIT 2, B CB79 BIT 7, C
84 ADD A, H CB51 BIT 2, C CB7A BIT 7, D
85 ADD A, L CB52 BIT 2, D CB7B BIT 7, E
C6 n ADD A, n CB53 BIT 2, E CB7C BIT 7, H
9 ADD HL, BC CB54 BIT 2, H CB7D BIT 7, L
19 ADD HL, DE CB55 BIT 2, L DC n n CALL C, nn
29 ADD HL, HL CB5E BIT 3, (HL) FC n n CALL M, nn
39 ADD HL, SP DDCB d 5E BIT 3, (IX + d) D4 n n CALL NC, nn
DD09 ADD IX, BC FDCB d 5E BIT 3, (IY + d) CD n n CALL nn
DD19 ADD IX, DE CB5F BIT 3, A C4 n n CALL NZ, nn
DD29 ADD IX, IX CB58 BIT 3, B F4 n n CALL P, nn
DD39 ADD IX, SP CB59 BIT 3, C EC n n CALL PE, nn
FD09 ADD IY, BC CB5A BIT 3, D E4 n n CALL PO, nn
FD19 ADD IY, DE CB5B BIT 3, E CC n n CALL Z, nn
FD29 ADD IY, IY CB5C BIT 3, H 3F CCF
FD39 ADD IY, SP CB5D BIT 3, L BE CP (HL)
A6 AND (HL) CB66 BIT 4, (HL) DDBE d CP (IX + d)
DDA6 d AND (IX + d) DDCB d 66 BIT 4, (IX + d) FDBE d CP (IY + d)
FDA6 d AND (IY + d) FDCB d 66 BIT 4, (IY + d) BF CP A
A7 AND A CB67 BIT 4, A B8 CP B
A0 AND B CB60 BIT 4, B B9 CP C
A1 AND C CB61 BIT 4, C BA CP D
A2 AND D CB62 BIT 4, D BB CP E
A3 AND E CB63 BIT 4, E BC CP H
A4 AND H CB64 BIT 4, H BD CP L
A5 AND L CB65 BIT 4, L FE n CP n
E6 n AND n CB6E BIT 5, (HL) 2F CPL
CB46 BIT 0, (HL) DDCB d 6E BIT 5, (IX + d) 35 DEC (HL)
DDCB d 46 BIT 0, (IX + d) FDCB d 6E BIT 5, (IY + d) DD35 d DEC (IX + d)

108
FD35 d DEC (IY + d) 74 LD (HL), H 4A LD C, D
3D DEC A 75 LD (HL), L 4B LD C, E
5 DEC B 36 n LD (HL), n 4C LD C, H
0B DEC BC DD77 d LD (IX + d), A 4D LD C, L
0D DEC C DD70 d LD (IX + d), B 0E n LD C, n
15 DEC D DD71 d LD (IX + d), C 56 LD D, (HL)
1B DEC DE DD72 d LD (IX + d), D DD56 d LD D, (IX + d)
1D DEC E DD73 d LD (IX + d), E FD56 d LD D, (IY + d)
25 DEC H DD74 d LD (IX + d), H 57 LD D, A
2B DEC HL DD75 d LD (IX + d), L 50 LD D, B
DD2B DEC IX DD36 d n LD (IX + d), n 51 LD D, C
FD2B DEC IY FD77 d LD (IY + d), A 52 LD D, D
2D DEC L FD70 d LD (IY + d), B 53 LD D, E
3B DEC SP FD71 d LD (IY + d), C 54 LD D, H
F3 DI FD72 d LD (IY + d), D 55 LD D, L
FB EI FD73 d LD (IY + d), E 16 n LD D, n
76 HALT FD74 d LD (IY + d), H ED5B n n LD DE, (nn)
ED78 IN A, (C) FD75 d LD (IY + d), L 11 n n LD DE, nn
DB n IN A, (n) FD36 d n LD (IY + d), n 5E LD E, (HL)
ED40 IN B, (C) 32 n n LD (nn), A DD5E d LD E, (IX + d)
ED48 IN C, (C) ED43 n n LD (nn), BC FD5E d LD E, (IY + d)
ED50 IN D, (C) ED53 n n LD (nn), DE 5F LD E, A
ED58 IN E, (C) 22 n n LD (nn), HL 58 LD E, B
ED60 IN H, (C) ED63 n n LD (nn), HL 59 LD E, C
ED68 IN L, (C) DD22 n n LD (nn), IX 5A LD E, D
34 INC (HL) FD22 n n LD (nn), IY 5B LD E, E
DD34 d INC (IX + d) ED73 n n LD (nn), SP 5C LD E, H
FD34 d INC (IY + d) 0A LD A, (BC) 5D LD E, L
3C INC A 1A LD A, (DE) 1E n LD E, n
4 INC B 7E LD A, (HL) 66 LD H, (HL)
3 INC BC DD7E d LD A, (IX + d) DD66 d LD H, (IX + d)
0C INC C FD7E d LD A, (IY + d) FD66 d LD H, (IY + d)
14 INC D 3A n n LD A, (nn) 67 LD H, A
13 INC DE 7F LD A, A 60 LD H, B
1C INC E 78 LD A, B 61 LD H, C
24 INC H 79 LD A, C 62 LD H, D
23 INC HL 7A LD A, D 63 LD H, E
DD23 INC IX 7B LD A, E 64 LD H, H
FD23 INC IY 7C LD A, H 65 LD H, L
2C INC L 7D LD A, L 26 n LD H, n
33 INC SP 3E n LD A, n 2A n n LD HL, (nn)
E9 JP (HL) 46 LD B, (HL) 21 n n LD HL, nn
DDE9 JP (IX) DD46 d LD B, (IX + d) DD2A n n LD IX, (nn)
FDE9 JP (IY) FD46 d LD B, (IY + d) DD21 n n LD IX, nn
DA n n JP C, nn 47 LD B, A FD2A n n LD IY, (nn)
FA n n JP M, nn 40 LD B, B FD21 n n LD IY, nn
D2 n n JP NC, nn 41 LD B, C 6E LD L, (HL)
C3 n n JP nn 42 LD B, D DD6E d LD L, (IX + d)
C2 n n JP NZ, nn 43 LD B, E FD6E d LD L, (IY + d)
F2 n n JP P, nn 44 LD B, H 6F LD L, A
EA n n JP PE, nn 45 LD B, L 68 LD L, B
E2 n n JP PO, nn 06 n LD B, n 69 LD L, C
CA n n JP Z, nn ED4B n n LD BC, (nn) 6A LD L, D
2 LD (BC), A 01 n n LD BC, nn 6B LD L, E
12 LD (DE), A 4E LD C, (HL) 6C LD L, H
77 LD (HL), A DD4E d LD C, (IX + d) 6D LD L, L
70 LD (HL), B FD4E d LD C, (IY + d) 2E n LD L, n
71 LD (HL), C 4F LD C, A ED7B n n LD SP, (nn)
72 LD (HL), D 48 LD C, B F9 LD SP, HL
73 LD (HL), E 49 LD C, C DDF9 LD SP, IX

109
FDF9 LD SP, IY CB91 RES 2, C F0 RET P
31 n n LD SP, nn CB92 RES 2, D E8 RET PE
ED44 NEG CB93 RES 2, E E0 RET PO
0 NOP CB94 RES 2, H C8 RET Z
B6 OR (HL) CB95 RES 2, L CB16 RL (HL)
DDB6 d OR (IX + d) CB9E RES 3, (HL) DDCB d 16 RL (IX + d)
FDB6 d OR (IY + d) DDCB d 9E RES 3, (IX + d) FDCB d 16 RL (IY + d)
B7 OR A FDCB d 9E RES 3, (IY + d) CB17 RL A
B0 OR B CB9F RES 3, A CB10 RL B
B1 OR C CB98 RES 3, B CB11 RL C
B2 OR D CB99 RES 3, C CB12 RL D
B3 OR E CB9A RES 3, D CB13 RL E
B4 OR H CB9B RES 3, E CB14 RL H
B5 OR L CB9C RES 3, H CB15 RL L
F6 n OR n CB9D RES 3, L 17 RLA
ED79 OUT (C), A CBA6 RES 4, (HL) CB06 RLC (HL)
ED41 OUT (C), B DDCB d A6 RES 4, (IX + d) DDCB d 06 RLC (IX + d)
ED49 OUT (C), C FDCB d A6 RES 4, (IY + d) FDCB d 06 RLC (IY + d)
ED51 OUT (C), D CBA7 RES 4, A CB07 RLC A
ED59 OUT (C), E CBA0 RES 4, B CB00 RLC B
ED61 OUT (C), H CBA1 RES 4, C CB01 RLC C
ED69 OUT (C), L CBA2 RES 4, D CB02 RLC D
D3 n OUT (n), A CBA3 RES 4, E CB03 RLC E
F1 POP AF CBA4 RES 4, H CB04 RLC H
C1 POP BC CBA5 RES 4, L CB05 RLC L
D1 POP DE CBAE RES 5, (HL) 7 RLCA
E1 POP HL DDCB d AE RES 5, (IX + d) ED6F RLD
DDE1 POP IX FDCB d AE RES 5, (IY + d) CB1E RR (HL)
FDE1 POP IY CBAF RES 5, A DDCB d 1E RR (IX + d)
F5 PUSH AF CBA8 RES 5, B FDCB d 1E RR (IY + d)
C5 PUSH BC CBA9 RES 5, C CB1F RR A
D5 PUSH DE CBAA RES 5, D CB18 RR B
E5 PUSH HL CBAB RES 5, E CB19 RR C
DDE5 PUSH IX CBAC RES 5, H CB1A RR D
FDE5 PUSH IY CBAD RES 5, L CB1B RR E
CB86 RES 0, (HL) CBB6 RES 6, (HL) CB1C RR H
DDCB d 86 RES 0, (IX + d) DDCB d B6 RES 6, (IX + d) CB1D RR L
FDCB d 86 RES 0, (IY + d) FDCB d B6 RES 6, (IY + d) 1F RRA
CB87 RES 0, A CBB7 RES 6, A CB0E RRC (HL)
CB80 RES 0, B CBB0 RES 6, B DDCB d 0E RRC (IX + d)
CB81 RES 0, C CBB1 RES 6, C FDCB d 0E RRC (IY + d)
CB82 RES 0, D CBB2 RES 6, D CB0F RRC A
CB83 RES 0, E CBB3 RES 6, E CB08 RRC B
CB84 RES 0, H CBB4 RES 6, H CB09 RRC C
CB85 RES 0, L CBB5 RES 6, L CB0A RRC D
CB8E RES 1, (HL) CBBE RES 7, (HL) CB0B RRC E
DDCB d 8E RES 1, (IX + d) DDCB d BE RES 7, (IX + d) CB0C RRC H
FDCB d 8E RES 1, (IY + d) FDCB d BE RES 7, (IY + d) CB0D RRC L
CB8F RES 1, A CBBF RES 7, A 0F RRCA
CB88 RES 1, B CBB8 RES 7, B ED67 RRD
CB89 RES 1, C CBB9 RES 7, C C7 RST 00h
CB8A RES 1, D CBBA RES 7, D CF RST 08h
CB8B RES 1, E CBBB RES 7, E D7 RST 10h
CB8C RES 1, H CBBC RES 7, H DF RST 18h
CB8D RES 1, L CBBD RES 7, L E7 RST 20h
CB96 RES 2, (HL) C9 RET EF RST 28h
DDCB d 96 RES 2, (IX + d) D8 RET C F7 RST 30h
FDCB d 96 RES 2, (IY + d) F8 RET M FF RST 38h
CB97 RES 2, A D0 RET NC 9E SBC A, (HL)
CB90 RES 2, B C0 RET NZ DD9E d SBC A, (IX + d)

110
FD9E d SBC A, (IY + d) CBE2 SET 4, D CB3A SRL D
9F SBC A, A CBE3 SET 4, E CB3B SRL E
98 SBC A, B CBE4 SET 4, H CB3C SRL H
99 SBC A, C CBE5 SET 4, L CB3D SRL L
9A SBC A, D CBEE SET 5, (HL) 96 SUB (HL)
9B SBC A, E DDCB d EE SET 5, (IX + d) DD96 d SUB (IX + d)
9C SBC A, H FDCB d EE SET 5, (IY + d) FD96 d SUB (IY + d)
9D SBC A, L CBEF SET 5, A 97 SUB A
DE n SBC A, n CBE8 SET 5, B 90 SUB B
ED42 SBC HL, BC CBE9 SET 5, C 91 SUB C
ED52 SBC HL, DE CBEA SET 5, D 92 SUB D
ED62 SBC HL, HL CBEB SET 5, E 93 SUB E
ED72 SBC HL, SP CBEC SET 5, H 94 SUB H
37 SCF CBED SET 5, L 95 SUB L
CBC6 SET 0, (HL) CBF6 SET 6, (HL) D6 n SUB n
DDCB d C6 SET 0, (IX + d) DDCB d F6 SET 6, (IX + d) AE XOR (HL)
FDCB d C6 SET 0, (IY + d) FDCB d F6 SET 6, (IY + d) DDAE d XOR (IX + d)
CBC7 SET 0, A CBF7 SET 6, A FDAE d XOR (IY + d)
CBC0 SET 0, B CBF0 SET 6, B AF XOR A
CBC1 SET 0, C CBF1 SET 6, C A8 XOR B
CBC2 SET 0, D CBF2 SET 6, D A9 XOR C
CBC3 SET 0, E CBF3 SET 6, E AA XOR D
CBC4 SET 0, H CBF4 SET 6, H AB XOR E
CBC5 SET 0, L CBF5 SET 6, L AC XOR H
CBCE SET 1, (HL) CBFE SET 7, (HL) AD XOR L
DDCB d CE SET 1, (IX + d) DDCB d FE SET 7, (IX + d) EE n XOR n
FDCB d CE SET 1, (IY + d) FDCB d FE SET 7, (IY + d)
CBCF SET 1, A CBFF SET 7, A
CBC8 SET 1, B CBF8 SET 7, B
CBC9 SET 1, C CBF9 SET 7, C
CBCA SET 1, D CBFA SET 7, D
CBCB SET 1, E CBFB SET 7, E
CBCC SET 1, H CBFC SET 7, H
CBCD SET 1, L CBFD SET 7, L
CBD6 SET 2, (HL) CB26 SLA (HL)
DDCB d D6 SET 2, (IX + d) DDCB d 26 SLA (IX + d)
FDCB d D6 SET 2, (IY + d) FDCB d 26 SLA (IY + d)
CBD7 SET 2, A CB27 SLA A
CBD0 SET 2, B CB20 SLA B
CBD1 SET 2, C CB21 SLA C
CBD2 SET 2, D CB22 SLA D
CBD3 SET 2, E CB23 SLA E
CBD4 SET 2, H CB24 SLA H
CBD5 SET 2, L CB25 SLA L
CBDE SET 3, (HL) CB2E SRA (HL)
DDCB d DE SET 3, (IX + d) DDCB d 2E SRA (IX + d)
FDCB d DE SET 3, (IY + d) FDCB d 2E SRA (IY + d)
CBDF SET 3, A CB2F SRA A
CBD8 SET 3, B CB28 SRA B
CBD9 SET 3, C CB29 SRA C
CBDA SET 3, D CB2A SRA D
CBDB SET 3, E CB2B SRA E
CBDC SET 3, H CB2C SRA H
CBDD SET 3, L CB2D SRA L
CBE6 SET 4, (HL) CB3E SRL (HL)
DDCB d E6 SET 4, (IX + d) DDCB d 3E SRL (IX + d)
FDCB d E6 SET 4, (IY + d) FDCB d 3E SRL (IY + d)
CBE7 SET 4, A CB3F SRL A
CBE0 SET 4, B CB38 SRL B
CBE1 SET 4, C CB39 SRL C

111
DMC8 Instructions (in numerical order)

0 NOP 40 LD B, B 78 LD A, B
01 n n LD BC, nn 41 LD B, C 79 LD A, C
2 LD (BC), A 42 LD B, D 7A LD A, D
3 INC BC 43 LD B, E 7B LD A, E
4 INC B 44 LD B, H 7C LD A, H
5 DEC B 45 LD B, L 7D LD A, L
06 n LD B, n 46 LD B, (HL) 7E LD A, (HL)
7 RLCA 47 LD B, A 7F LD A, A
9 ADD HL, BC 48 LD C, B 80 ADD A, B
0A LD A, (BC) 49 LD C, C 81 ADD A, C
0B DEC BC 4A LD C, D 82 ADD A, D
0C INC C 4B LD C, E 83 ADD A, E
0D DEC C 4C LD C, H 84 ADD A, H
0E n LD C, n 4D LD C, L 85 ADD A, L
0F RRCA 4E LD C, (HL) 86 ADD A, (HL)
11 n n LD DE, nn 4F LD C, A 87 ADD A, A
12 LD (DE), A 50 LD D, B 88 ADC A, B
13 INC DE 51 LD D, C 89 ADC A, C
14 INC D 52 LD D, D 8A ADC A, D
15 DEC D 53 LD D, E 8B ADC A, E
16 n LD D, n 54 LD D, H 8C ADC A, H
17 RLA 55 LD D, L 8D ADC A, L
19 ADD HL, DE 56 LD D, (HL) 8E ADC A, (HL)
1A LD A, (DE) 57 LD D, A 8F ADC A, A
1B DEC DE 58 LD E, B 90 SUB B
1C INC E 59 LD E, C 91 SUB C
1D DEC E 5A LD E, D 92 SUB D
1E n LD E, n 5B LD E, E 93 SUB E
1F RRA 5C LD E, H 94 SUB H
21 n n LD HL, nn 5D LD E, L 95 SUB L
22 n n LD (nn), HL 5E LD E, (HL) 96 SUB (HL)
23 INC HL 5F LD E, A 97 SUB A
24 INC H 60 LD H, B 98 SBC A, B
25 DEC H 61 LD H, C 99 SBC A, C
26 n LD H, n 62 LD H, D 9A SBC A, D
29 ADD HL, HL 63 LD H, E 9B SBC A, E
2A n n LD HL, (nn) 64 LD H, H 9C SBC A, H
2B DEC HL 65 LD H, L 9D SBC A, L
2C INC L 66 LD H, (HL) 9E SBC A, (HL)
2D DEC L 67 LD H, A 9F SBC A, A
2E n LD L, n 68 LD L, B A0 AND B
2F CPL 69 LD L, C A1 AND C
31 n n LD SP, nn 6A LD L, D A2 AND D
32 n n LD (nn), A 6B LD L, E A3 AND E
33 INC SP 6C LD L, H A4 AND H
34 INC (HL) 6D LD L, L A5 AND L
35 DEC (HL) 6E LD L, (HL) A6 AND (HL)
36 n LD (HL), n 6F LD L, A A7 AND A
37 SCF 70 LD (HL), B A8 XOR B
39 ADD HL, SP 71 LD (HL), C A9 XOR C
3A n n LD A, (nn) 72 LD (HL), D AA XOR D
3B DEC SP 73 LD (HL), E AB XOR E
3C INC A 74 LD (HL), H AC XOR H
3D DEC A 75 LD (HL), L AD XOR L
3E n LD A, n 76 HALT AE XOR (HL)
3F CCF 77 LD (HL), A AF XOR A
112
B0 OR B CB21 SLA C CB65 BIT 4, L
B1 OR C CB22 SLA D CB66 BIT 4, (HL)
B2 OR D CB23 SLA E CB67 BIT 4, A
B3 OR E CB24 SLA H CB68 BIT 5, B
B4 OR H CB25 SLA L CB69 BIT 5, C
B5 OR L CB26 SLA (HL) CB6A BIT 5, D
B6 OR (HL) CB27 SLA A CB6B BIT 5, E
B7 OR A CB28 SRA B CB6C BIT 5, H
B8 CP B CB29 SRA C CB6D BIT 5, L
B9 CP C CB2A SRA D CB6E BIT 5, (HL)
BA CP D CB2B SRA E CB6F BIT 5, A
BB CP E CB2C SRA H CB70 BIT 6, B
BC CP H CB2D SRA L CB71 BIT 6, C
BD CP L CB2E SRA (HL) CB72 BIT 6, D
BE CP (HL) CB2F SRA A CB73 BIT 6, E
BF CP A CB38 SRL B CB74 BIT 6, H
C0 RET NZ CB39 SRL C CB75 BIT 6, L
C1 POP BC CB3A SRL D CB76 BIT 6, (HL)
C2 n n JP NZ, nn CB3B SRL E CB77 BIT 6, A
C3 n n JP nn CB3C SRL H CB78 BIT 7, B
C4 n n CALL NZ, nn CB3D SRL L CB79 BIT 7, C
C5 PUSH BC CB3E SRL (HL) CB7A BIT 7, D
C6 n ADD A, n CB3F SRL A CB7B BIT 7, E
C7 RST 0h CB40 BIT 0, B CB7C BIT 7, H
C8 RET Z CB41 BIT 0, C CB7D BIT 7, L
C9 RET CB42 BIT 0, D CB7E BIT 7, (HL)
CA n n JP Z, nn CB43 BIT 0, E CB7F BIT 7, A
CB00 RLC B CB44 BIT 0, H CB80 RES 0, B
CB01 RLC C CB45 BIT 0, L CB81 RES 0, C
CB02 RLC D CB46 BIT 0, (HL) CB82 RES 0, D
CB03 RLC E CB47 BIT 0, A CB83 RES 0, E
CB04 RLC H CB48 BIT 1, B CB84 RES 0, H
CB05 RLC L CB49 BIT 1, C CB85 RES 0, L
CB06 RLC (HL) CB4A BIT 1, D CB86 RES 0, (HL)
CB07 RLC A CB4B BIT 1, E CB87 RES 0, A
CB08 RRC B CB4C BIT 1, H CB88 RES 1, B
CB09 RRC C CB4D BIT 1, L CB89 RES 1, C
CB0A RRC D CB4E BIT 1, (HL) CB8A RES 1, D
CB0B RRC E CB4F BIT 1, A CB8B RES 1, E
CB0C RRC H CB50 BIT 2, B CB8C RES 1, H
CB0D RRC L CB51 BIT 2, C CB8D RES 1, L
CB0E RRC (HL) CB52 BIT 2, D CB8E RES 1, (HL)
CB0F RRC A CB53 BIT 2, E CB8F RES 1, A
CB10 RL B CB54 BIT 2, H CB90 RES 2, B
CB11 RL C CB55 BIT 2, L CB91 RES 2, C
CB12 RL D CB56 BIT 2, (HL) CB92 RES 2, D
CB13 RL E CB57 BIT 2, A CB93 RES 2, E
CB14 RL H CB58 BIT 3, B CB94 RES 2, H
CB15 RL L CB59 BIT 3, C CB95 RES 2, L
CB16 RL (HL) CB5A BIT 3, D CB96 RES 2, (HL)
CB17 RL A CB5B BIT 3, E CB97 RES 2, A
CB18 RR B CB5C BIT 3, H CB98 RES 3, B
CB19 RR C CB5D BIT 3, L CB99 RES 3, C
CB1A RR D CB5E BIT 3, (HL) CB9A RES 3, D
CB1B RR E CB5F BIT 3, A CB9B RES 3, E
CB1C RR H CB60 BIT 4, B CB9C RES 3, H
CB1D RR L CB61 BIT 4, C CB9D RES 3, L
CB1E RR (HL) CB62 BIT 4, D CB9E RES 3, (HL)
CB1F RR A CB63 BIT 4, E CB9F RES 3, A
CB20 SLA B CB64 BIT 4, H CBA0 RES 4, B

113
CBA1 RES 4, C CBDD SET 3, L DD35 d DEC (IX + d)
CBA2 RES 4, D CBDE SET 3, (HL) DD36 d n LD (IX + d), n
CBA3 RES 4, E CBDF SET 3, A DD39 ADD IX, SP
CBA4 RES 4, H CBE0 SET 4, B DD46 d LD B, (IX + d)
CBA5 RES 4, L CBE1 SET 4, C DD4E d LD C, (IX + d)
CBA6 RES 4, (HL) CBE2 SET 4, D DD56 d LD D, (IX + d)
CBA7 RES 4, A CBE3 SET 4, E DD5E d LD E, (IX + d)
CBA8 RES 5, B CBE4 SET 4, H DD66 d LD H, (IX + d)
CBA9 RES 5, C CBE5 SET 4, L DD6E d LD L, (IX + d)
CBAA RES 5, D CBE6 SET 4, (HL) DD70 d LD (IX + d), B
CBAB RES 5, E CBE7 SET 4, A DD71 d LD (IX + d), C
CBAC RES 5, H CBE8 SET 5, B DD72 d LD (IX + d), D
CBAD RES 5, L CBE9 SET 5, C DD73 d LD (IX + d), E
CBAE RES 5, (HL) CBEA SET 5, D DD74 d LD (IX + d), H
CBAF RES 5, A CBEB SET 5, E DD75 d LD (IX + d), L
CBB0 RES 6, B CBEC SET 5, H DD77 d LD (IX + d), A
CBB1 RES 6, C CBED SET 5, L DD7E d LD A, (IX + d)
CBB2 RES 6, D CBEE SET 5, (HL) DD86 d ADD A, (IX + d)
CBB3 RES 6, E CBEF SET 5, A DD8E d ADC A, (IX + d)
CBB4 RES 6, H CBF0 SET 6, B DD96 d SUB (IX + d)
CBB5 RES 6, L CBF1 SET 6, C DD9E d SBC A, (IX + d)
CBB6 RES 6, (HL) CBF2 SET 6, D DDA6 d AND (IX + d)
CBB7 RES 6, A CBF3 SET 6, E DDAE d XOR (IX + d)
CBB8 RES 7, B CBF4 SET 6, H DDB6 d OR (IX + d)
CBB9 RES 7, C CBF5 SET 6, L DDBE d CP (IX + d)
CBBA RES 7, D CBF6 SET 6, (HL) DDCB d 06 RLC (IX + d)
CBBB RES 7, E CBF7 SET 6, A DDCB d 0E RRC (IX + d)
CBBC RES 7, H CBF8 SET 7, B DDCB d 16 RL (IX + d)
CBBD RES 7, L CBF9 SET 7, C DDCB d 1E RR (IX + d)
CBBE RES 7, (HL) CBFA SET 7, D DDCB d 26 SLA (IX + d)
CBBF RES 7, A CBFB SET 7, E DDCB d 2E SRA (IX + d)
CBC0 SET 0, B CBFC SET 7, H DDCB d 3E SRL (IX + d)
CBC1 SET 0, C CBFD SET 7, L DDCB d 46 BIT 0, (IX + d)
CBC2 SET 0, D CBFE SET 7, (HL) DDCB d 4E BIT 1, (IX + d)
CBC3 SET 0, E CBFF SET 7, A DDCB d 56 BIT 2, (IX + d)
CBC4 SET 0, H CC n n CALL Z, nn DDCB d 5E BIT 3, (IX + d)
CBC5 SET 0, L CD n n CALL nn DDCB d 66 BIT 4, (IX + d)
CBC6 SET 0, (HL) CE n ADC A, n DDCB d 6E BIT 5, (IX + d)
CBC7 SET 0, A CF RST 8h DDCB d 76 BIT 6, (IX + d)
CBC8 SET 1, B D0 RET NC DDCB d 7E BIT 7, (IX + d)
CBC9 SET 1, C D1 POP DE DDCB d 86 RES 0, (IX + d)
CBCA SET 1, D D2 n n JP NC, nn DDCB d 8E RES 1, (IX + d)
CBCB SET 1, E D3 n OUT (n), A DDCB d 96 RES 2, (IX + d)
CBCC SET 1, H D4 n n CALL NC, nn DDCB d 9E RES 3, (IX + d)
CBCD SET 1, L D5 PUSH DE DDCB d A6 RES 4, (IX + d)
CBCE SET 1, (HL) D6 n SUB n DDCB d AE RES 5, (IX + d)
CBCF SET 1, A D7 RST 10h DDCB d B6 RES 6, (IX + d)
CBD0 SET 2, B D8 RET C DDCB d BE RES 7, (IX + d)
CBD1 SET 2, C DA n n JP C, nn DDCB d C6 SET 0, (IX + d)
CBD2 SET 2, D DB n IN A, (n) DDCB d CE SET 1, (IX + d)
CBD3 SET 2, E DC n n CALL C, nn DDCB d D6 SET 2, (IX + d)
CBD4 SET 2, H DD09 ADD IX, BC DDCB d DE SET 3, (IX + d)
CBD5 SET 2, L DD19 ADD IX, DE DDCB d E6 SET 4, (IX + d)
CBD6 SET 2, (HL) DD21 n n LD IX, nn DDCB d EE SET 5, (IX + d)
CBD7 SET 2, A DD22 n n LD (nn), IX DDCB d F6 SET 6, (IX + d)
CBD8 SET 3, B DD23 INC IX DDCB d FE SET 7, (IX + d)
CBD9 SET 3, C DD29 ADD IX, IX DDE1 POP IX
CBDA SET 3, D DD2A n n LD IX, (nn) DDE5 PUSH IX
CBDB SET 3, E DD2B DEC IX DDE9 JP (IX)
CBDC SET 3, H DD34 d INC (IX + d) DDF9 LD SP, IX

114
DE n SBC A, n FD09 ADD IY, BC FDCB d DE SET 3, (IY + d)
DF RST 18h FD19 ADD IY, DE FDCB d E6 SET 4, (IY + d)
E0 RET PO FD21 n n LD IY, nn FDCB d EE SET 5, (IY + d)
E1 POP HL FD22 n n LD (nn), IY FDCB d F6 SET 6, (IY + d)
E2 n n JP PO, nn FD23 INC IY FDCB d FE SET 7, (IY + d)
E4 n n CALL PO, nn FD29 ADD IY, IY FDE1 POP IY
E5 PUSH HL FD2A n n LD IY, (nn) FDE5 PUSH IY
E6 n AND n FD2B DEC IY FDE9 JP (IY)
E7 RST 20h FD34 d INC (IY + d) FDF9 LD SP, IY
E8 RET PE FD35 d DEC (IY + d) FE n CP n
E9 JP (HL) FD36 d n LD (IY + d), n FF RST 38h
EA n n JP PE, nn FD39 ADD IY, SP
EC n n CALL PE, nn FD46 d LD B, (IY + d)
ED40 IN B, (C) FD4E d LD C, (IY + d)
ED41 OUT (C), B FD56 d LD D, (IY + d)
ED42 SBC HL, BC FD5E d LD E, (IY + d)
ED43 n n LD (nn), BC FD66 d LD H, (IY + d)
ED44 NEG FD6E d LD L, (IY + d)
ED48 IN C, (C) FD70 d LD (IY + d), B
ED49 OUT (C), C FD71 d LD (IY + d), C
ED4A ADC HL, BC FD72 d LD (IY + d), D
ED4B n n LD BC, (nn) FD73 d LD (IY + d), E
ED50 IN D, (C) FD74 d LD (IY + d), H
ED51 OUT (C), D FD75 d LD (IY + d), L
ED52 SBC HL, DE FD77 d LD (IY + d), A
ED53 n n LD (nn), DE FD7E d LD A, (IY + d)
ED58 IN E, (C) FD86 d ADD A, (IY + d)
ED59 OUT (C), E FD8E d ADC A, (IY + d)
ED5A ADC HL, DE FD96 d SUB (IY + d)
ED5B n n LD DE, (nn) FD9E d SBC A, (IY + d)
ED60 IN H, (C) FDA6 d AND (IY + d)
ED61 OUT (C), H FDAE d XOR (IY + d)
ED62 SBC HL, HL FDB6 d OR (IY + d)
ED63 n n LD (nn), HL FDBE d CP (IY + d)
ED67 RRD FDCB d 06 RLC (IY + d)
ED68 IN L, (C) FDCB d 0E RRC (IY + d)
ED69 OUT (C), L FDCB d 16 RL (IY + d)
ED6A ADC HL, HL FDCB d 1E RR (IY + d)
ED6F RLD FDCB d 26 SLA (IY + d)
ED72 SBC HL, SP FDCB d 2E SRA (IY + d)
ED73 n n LD (nn), SP FDCB d 3E SRL (IY + d)
ED78 IN A, (C) FDCB d 46 BIT 0, (IY + d)
ED79 OUT (C), A FDCB d 4E BIT 1, (IY + d)
ED7A ADC HL, SP FDCB d 56 BIT 2, (IY + d)
ED7B n n LD SP, (nn) FDCB d 5E BIT 3, (IY + d)
EE n XOR n FDCB d 66 BIT 4, (IY + d)
EF RST 28h FDCB d 6E BIT 5, (IY + d)
F0 RET P FDCB d 76 BIT 6, (IY + d)
F1 POP AF FDCB d 7E BIT 7, (IY + d)
F2 n n JP P, nn FDCB d 86 RES 0, (IY + d)
F3 DI FDCB d 8E RES 1, (IY + d)
F4 n n CALL P, nn FDCB d 96 RES 2, (IY + d)
F5 PUSH AF FDCB d 9E RES 3, (IY + d)
F6 n OR n FDCB d A6 RES 4, (IY + d)
F7 RST 30h FDCB d AE RES 5, (IY + d)
F8 RET M FDCB d B6 RES 6, (IY + d)
F9 LD SP, HL FDCB d BE RES 7, (IY + d)
FA n n JP M, nn FDCB d C6 SET 0, (IY + d)
FB EI FDCB d CE SET 1, (IY + d)
FC n n CALL M, nn FDCB d D6 SET 2, (IY + d)

115
Appendix: Deeds historical version notes
(Notes are reported in time reverse order).

20 - 01 - 2004
d-McE
• It has been solved a bug of the “Save As” command: now, if you press the ‘Cancel’ button
of the ‘Save As’ standard dialog, the Close operations, if running, are aborted as expected.
• The execution of the RRCA instruction has been fixed.
• The “I/O Port Address” dialog, on computers with the video card configured in a low-
resolution mode, did not appear. The problem has been fixed, the dialog now will show
always (centred on the main window).

11 - 11 - 2003
Deeds, d-AsT
• Now, when a new version of the Deeds is installed, the browser home pages are reset to
the defaults, to avoid confusion between the different Deeds versions. However, the
address of the previous user home page is not lost: it will be found in the history list of the
opened pages, in the ‘open’ window.
d-DcS
• An error in simulation of finite state machine components has been fixed (the behaviour of
the network when the FSM Reset input is activated at time=0).
• Now, when you start the ’interactive’ simulation, the input switches are initialised according
to the assigned names: as in the ‘timing’ simulation mode, the initial value will be set to
‘one’ if the name represents an ‘active low’ signal (i.e. the name is negated). As a
consequence, for instance, all the components that require a (low activated) reset now will
start un-initialised, showing ‘unknown’ outputs until the user will reset them expressly.
When you exit the ’interactive’ simulation all inputs an outputs reset to their default status.
• Now, during the ‘timing’ simulation, the circuit in the editor shows input and output value
coherently with simulation results. You can observe the input/output status of the circuit in
the editor before and after each simulation step.
• Now, when you print the circuit, or copy it as image on the clipboard, the resulting picture
is coherent with the input/output values currently displayed in the editor.
• The maximum time for simulation has been fixed, now it is no more limited to 32678 nS.
d-FsM
• Now, when timing simulation window is iconized and the simulation closed, the bar buttons
are correctly enabled and updated.
• Now, when editor and timing windows are in iconized or maximized state, and the user
closes them, their ‘normal’ position, instead of the currently one, is saved. In this way, when
the user will re-open the windows, these will be placed in their ‘normal’ position. The
correction has been done to reduce flickering and flashing of the windows on the screen.

04 - 11 - 2003
d-DcS

116
• An error in simulation of decoder components has been fixed.
d-McE
• In the debugger OBJECT CODE frame, the memory ‘extended view’ command has been
fixed: now, in this mode, all the micro-processor memory space is shown.
• The ASCII table page, in the On Line Help, has been corrected.

15 - 10 - 2003
d-McE
• A new simulation tool has been added to the Deeds: the Micro-Computer Emulator (d-
McE).
• The functionally emulated board include a CPU, ROM and RAM memory, parallel I/O ports,
reset circuitry and a simple interrupt logic.
• The custom 8 bit CPU, named DMC8, has been designed to suite our educational needs,
and it is based on a simplified version of the well-known ‘Z80’ processor.
• The d-McE integrates a Code Editor, an Assembler and a machine-level interactive
Debugger.
• The integrated source code editor enables user to enter assembly programs, and a simple
command permits to assemble, link and load them in the emulated system memory.
• The execution of the programs can be run step by step in the interactive debugger, where
the user can observe all the structures involved in the hardware/software system
• By now, the integration of this tool with the Deeds is not complete: the board can not be
inserted in the d-DcS (yet).
d-DcS
• The simulation kernel code has been completely revised, and its code linked with the
executable. The current version doesn’t need the installation of the ActiveX that the previous
versions do, and some mistake in the simulation of complex components has been fixed.
• The ‘Delete’ (by Selection) command has been fixed.
• Some other minor bugs have been corrected.

11 - 07 - 2003
d-FsM
• Now the d-FsM tool can export the finite state machine in VHDL format. The command is
available under the ‘File’ menu item. The user can view the VHDL code, copy it on the
clipboard, or save it on a text file (‘.vhd’).
• The ‘State at Reset’ is highlighted with a little diamond, placed on the top-left of the state
block. A ‘starting’ state block is now accepted (i.e., a state without a connection over it,
normally used as ‘State at Reset’, or to drive the FSM, through the unused states, to a ‘safe’
state).
• The graphic editor has been radically modified. Now blocks and lines can’t be inserted or
moved over other blocks and lines: this is highlighted in the editor by displaying a red
‘denied’ signal when appropriate.
• The ’selection’ rectangle is now re-sizable, ‘grip points’ are available to move the four
vertexes with the mouse.
• Now it is possible to show/hide the ‘drawing grid’ (the command is under the ‘View’ menu
item).
• In the editor the user can use the new Zoom commands; they permit an easier editing of the
ASM diagrams (the commands are under the ‘View’ menu item and on the toolbar).

117
• A new feature of the editor permits the controls of insertion, moving and editing of lines. This
feature automatically breaks (or links together) the lines, as they are inserted, moved or
edited. The criteria are to connect line segments only on their vertexes. In this way all the
previous bugs, related a ‘lateral’ (‘T’ shaped) connection between lines, have been fixed.
• The algorithm that automatically assigns the code to a ‘newly created’ state has been
modified. Now it assigns to the state the first not-used code (checking it from the lowest code
available). If no state is deleted, this mode of operation is equivalent to assign codes in up-
order. If a state is deleted, its code will be re-used. If a code value is no more available, the
user, when trying to insert a new state block, is prompted to add another variable to the state
register.
• During insertion, moving or editing of ASM blocks and lines, if the user presses the
<escape> key, the current operation is automatically aborted.
• The <delete> key now acts on the ‘key-down’ instead of the ‘key-up’ (conforming its
behaviour to all the Windows application).
• In the IN/OUT dialog, pressing the <Return> key generates no more a tedious beep; also, in
the same dialog, it is now possible to edit, as expected, the eighth Input (or Output) entry.
• Now it is possible to design a FSM having no input signal (for instance, a simple binary
counter).

d-DcS
• In the previous version, a click on the ‘Cancel’ button of the message dialog that appears
when you want to create a new Finite State Machine hanged the d-DcS. The problem has
been fixed.

13 - 05 - 2003
d-FsM
• ‘Cascade’ connection of more than two conditional blocks do not hang the program anymore:
the bug has been fixed. Now the program seems also to process correctly conditional blocks
connected in a ‘nonsense’ mode.
• Some algorithmic optimization has been done, so the program now is faster that before
(during redrawing, when the diagram is ‘big’).
• The Properties window now shows correctly for all the screen resolution. Now the user
controls its visibility and the visibility is remembered between work sessions.
• The In/Out dialog now remembers, between work sessions, which page was last opened.
• The timing window doesn’t ask the user anymore, if no simulation has been started; instead,
now the program prompts the user on a “clear diagram” request, if data could be lost.
• Drawing of output names, in the state and conditional output blocks has been enhanced.
They are displayed from left to right, on two lines. If some output name can not be displayed,
for lack of space, a ‘+’ sign appears after the last one, on the second line, to notify the user
that more output have been assigned to the block, but that they can not be displayed.
Anyway, the complete output list is visible on the bottom status bar, when the user points the
mouse over the block of interest.
• The algorithm that shows the arrows on the lines has been enhanced, and the arrow shape
modified.
• Drawing of the input name in the decisional blocks has been horizontally centered.
d-DcS
• Drawing of input and output pin names, in the FSM components, has been enhanced. To
avoid overlapping of ‘long’ names, names too long are shorted (at display level).

118
24 - 02 - 2003
d-AsT
• A little bug was fixed: it occurred during page loading in the Assistant Browser.

20 - 02 - 2003
All
• The Deeds and Assistant browsers are now enabled and specialized to ‘run’ the Deeds
learning material (as well ordinary HTML pages). During operation, these browsers decode
the so-called Deeds Commands, that the author of a lesson (or laboratory session) include
in the HTML page to enable interactivity between the HTML page and each Deeds tool
included in the suite.
• Now it is possible to open a file downloading it from internet. This command is intended to
be driven by the Deeds browser, when the user clicks on an active link, to open a file.
Deeds
• Now, when a Tool is launched, the “Splash Form” is displayed only the firth time.
• The problem of ‘double launch’ of Deeds when you start it from the Application Bar has been
solved.
• For debug reasons, a “hard close” command has been added. If could be necessary, you
may close the Deeds main application (without closing also the other tools), activating the
ordinary “File/Close” command while pressing the <Shift> and <Control> keys.
d-DcS
• Now the title of the Timing Diagram window shows the current timing simulation mode (the
modes enabled are, by now: the Incremental Interactive Simulation mode [IIS], and the
Timing Interval Simulation mode [TIS].
• Now it is possible to open a file downloading it from internet. This command is intended to
be driven by the Deeds browser, when the user clicks on an active link, to open a file.
• The warning messages of the simulator, when needed, are displayed in a list at the
bottom of the main window (if in ‘animation’ mode), or at the bottom of the timing
diagram window (if in ‘timing’ mode). In this way the messages results more kind to the user
than before, when each message was displayed by a dialog box.
• Now, the last status bar message can be displayed moving the mouse over the bar itself.
In the Timing Diagram, the highlighting of the transitions of a specific signal has been
enhanced. By clicking the button corresponding to a specific signal, you can toggle among
four highlight modes: a) vertical lines on 0→1 transitions only; b) vertical lines on 1→0
transitions only; c) vertical line on all transition; d) no highlight.
d-FsM
• Drag and Drop of FSM files from the file manager has been enabled.

10 - 05 - 2002
d-DcS
• Finite State Machine components, when not completed, cann’t be loaded in the d-DcS. This
is OK, but under some circumstances, the user message explaining that the file wasn’t
completed didn’t appear. This problem has been fixed.
119
d-FsM
• The Print command has been fixed, now it is possible to print on paper ASM diagrams.
• Some file/save file/open bugs has been fixed.
• The “Save” file commands have been completed with automatic file backup generation: for
instance, before saving file “name.fsm”, if a previous version of the file exists, this is renamed
in “name.˜fsm“.
• The File/Close command has been fixed: it no more operational if no file is opened.
• A known problem has not been fixed yet: under some circumstances, ‘big’ ASM diagrams
can show a sensible slowing of window repainting.

22 - 03 - 2002
d-DcS
• Now, in the schematic editor, labeling of the component is allowed only for Input/Output
components. Attempt to label another kind of component results in a warning message on
the status bar of the window. You can set a negation bar over Input/Output component labels
placing a ‘!’ on front of the label string. The editor accepts also a leading ‘/’ or ‘\’, but the ‘!’
has to be preferred. Moreover, the negation bar is now displayed also on the signal name in
the timing diagram window.
• Drawing of Finite State Machine components has been (partially) fixed for those components
placed with “down” and “up” orientation. Before this fix, displayed name of inputs and outputs
were not the right ones. Anyway, we suggest to not use “down” and “up” orientation for Finite
State Machines, as name strings could easily overlap.
• In the Timing Diagram, now signal names are “buttons” evidenced by proper glyphs and
colors, and negated signal are displayed up-lined.
• You can highlight the transitions of a specific signal with a click on its name button (in this
way, you can relate its transitions with the behaviour of the network under simulation).
• If you click with the mouse right button on a signal name button, you activate a context menu.
Context Menus allow to move up or down the signal traces and to set signal properties. For
instance, you can change clock period and initial value for clock inputs, and initial value of
the ordinary input signals can be set.
• In the Timing Diagram, activating simulation and/or signal editing without to release the
“Time Stop” cursor is now inhibited, avoiding the bug of losing the cursor.
• Now the “F8” short cut not only sets the Timing Diagram Simulation mode, but also put the
Timing Diagram window on the Top if already present. Instead, if the Timing Diagram window
is on Top, the “F8” short cut gets the main window on Top again.
• The problem of redrawing of the vertical lines used as cursors in the timing diagram has
been fixed (before, when “hint” messages of buttons were displayed and the mouse moved
away through the diagram, some pieces of lines remained on the screen).
• When timing simulation is active, editing of circuit is now actually inhibited (the "out of
bound" error has been eliminated).
• Now, before to simulate, the application asks the user for saving the file of the circuit, if the
file has been modified.
• The internal ”simulation loop” has been enhanced, making timing simulation faster.
• Now it is possible to break simulation when tired to wait for long times, by clicking on the
Stop button. You’ll be requested to confirm breaking.
• During long simulations, a percentage of the work is displayed on the status bar, at bottom.
• Finite State Machine simulation has been fixed and enhanced: now, at simulation start, their
state is considered “undefined” until the Reset signal is activated, as expected. However, due
to limitation of the model used, by now the outputs are considered always “unknown” until
state stay undefined, without taking in count conditions from the inputs.
d-FsM

120
• Now it is possible to restore correctly the application windows after having closed them in the
maximized state.
• Now, some commands no more generate errors when activated in absence of opened
windows.
• Some error message revised, some others translated in English.
• The Print command has been disabled, waiting a major fix of the printing module.
• A few minor bugs have been fixed.
Deeds
• The main browser is not yet fully operational, but a link to the Deeds Web Site has been
added in the demo page.

01 - 03 - 2002
d-DcS
• Added the ability to copy on the Clipboard the Timing Diagram current view.
• Now, in the Timing Diagram, you can highlight the transitions of a specific signal with a click
on its button; in this way, you can relate its transitions with the behaviour of the network
under simulation.
• A few bugs have been fixed.

22 - 02- 2002 (and before)


• Released for internal beta test only.

121

You might also like