M03-Operating Instructions in Microprocessor
M03-Operating Instructions in Microprocessor
M03-Operating Instructions in Microprocessor
EQUIPMENT SERVICING
Level – III
Based on April 2022, Curriculum Version
Ocb, 2023
Addis Ababa, Ethiopia
The microprocessor is a continuation of the trend toward smaller computers that began in the middle 1960s.
In the early years of computer development the ea4>hasis was on larger and more powerful machines.
Computers were so expensive that only large institutions could own them and only specially trained
personnel could operate them. New technologies, such as transistors and integrated circuits, provided greater
speed but did not reduce costs. Computers remained remote and mysterious objects. Nfinicomputers started
the present trend. The first minicomputers were primitive by computer standards and still cost tens of
thousands of dollars. Nevertheless, laboratories, factories, and smaller institutions that could not afford large
com puters could now purchase a small computer like the Digital Equipment PDP-8, Data General Nova,
Scientific Data Systems 92, or IBM 1130. Cheaper electronic dfcults led to cheaper minicomputers; by 1970
a small minicomputer for use in a laboratory, office, factory, warehouse, or classroom cost a few thousand
dollars. Yet developments in integrated circuits went far beyond reducing the cost of minicomputers. Soon
the construction of a single integrated circuit that could perform the functions of a computer became
possible.
1.2. Applying work health and safety (OHS).
1.2.1. Occupational Health and Safety
Occupational health and safety is the field of public health that studies trends in illnesses and injuries in the
worker population and proposes and implements strategies and regulations to prevent them. Its scope is
broad, encompassing a wide variety of discipline from toxicology and epidemiology to ergonomics and
violence prevention.
Workplace safety is an important part of any job and requires that everyone in the company adhere to the
safety guidelines and policies in place. Carefully following appropriate safety guidelines can go a long way
toward preventing workplace injuries. Here are some ways you can work to stay safe on the job.
A. Core OHS principles
Occupational health and safety is an extensive multidisciplinary field, invariably touching on issues related
to scientific areas such as medicine
H. Multi-meters: Multi-meters are versatile instruments used to measure voltage, current, resistance, and
continuity. They are commonly used to troubleshoot and test electrical connections on microprocessor
boards.
I. Logic Analyzers: Logic analyzers capture and analyze digital signals in real-time. They help in
debugging complex digital circuits by providing insights into signal timing, protocol analysis, and system
behavior.
J. Oscilloscopes: Oscilloscopes are used to visualize and measure electrical waveforms. They enable
technicians to analyze the timing and shape of signals in microprocessor circuits, helping identify issues such
as noise, glitches, or improper signal levels.
In conclusion, assembling microprocessors requires a range of tools, equipment, and testing instruments to
ensure accurate placement of components and proper functionality of the final product. Soldering irons,
tweezers, desoldering tools, hot air rework stations, microscopes or magnifying lamps, ESD protection
equipment, and various testing instruments are essential for successful microprocessor assembly.
Both the expert mode and the doctor–patient mode demand that the consultant, an outsider, offers a well-
considered, expert solution – a prescription – to address the problems that the business faces. Process
consulting takes a different stance. It is based on the premise that the only people who can help the business
are the people who make it up. The consultant, as an outsider, cannot impose a solution on the organization.
To check device installation for compliance of microprocessors, there are several steps and considerations
that need to be taken into account. This process ensures that the microprocessors are installed correctly and
meet the necessary requirements for optimal performance and functionality. In this response, we will outline
the key aspects to consider when checking device installation for compliance of microprocessors.
1. Physical Installation: The first step in checking device installation is to ensure that the physical
installation of the microprocessor is done correctly. This involves properly aligning the processor with the
socket on the motherboard and securing it in place using the appropriate locking mechanism. It is crucial to
follow the manufacturer's guidelines and instructions during this process to avoid any damage or improper
installation.
2. Power Supply: Microprocessors require a stable and adequate power supply to function properly. It is
essential to verify that the power supply unit (PSU) is capable of delivering sufficient power to the
microprocessor. This can be done by checking the PSU's specifications and ensuring that it meets or exceeds
the recommended power requirements of the microprocessor. Additionally, proper cable connections
between the PSU and motherboard should be verified to ensure a reliable power supply.
3. Cooling System: Microprocessors generate heat during operation, and it is crucial to have an efficient
cooling system in place to prevent overheating. The cooling system typically consists of a heatsink, fan, or
liquid cooling solution. When checking device installation for compliance, it is important to ensure that the
cooling system is properly installed and functioning correctly. This includes verifying that the heatsink or
cooling solution is securely attached to the microprocessor, thermal paste or pads are applied correctly, and
fans are spinning at appropriate speeds.
4. BIOS/UEFI Settings: The Basic Input/Output System (BIOS) or Unified Extensible Firmware Interface
(UEFI) settings play a significant role in ensuring proper device installation compliance for microprocessors.
These settings control various aspects of the microprocessor's operation, such as clock speed, voltage, and
power management. It is important to access the BIOS/UEFI settings and verify that they are configured
Page 15 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
correctly for the specific microprocessor being installed. This may involve enabling or disabling certain
features or adjusting settings based on the manufacturer's recommendations.
5. Operating System Compatibility: Another aspect to consider when checking device installation
compliance is the compatibility of the microprocessor with the operating system (OS) being used. Different
microprocessors may have specific requirements or limitations when it comes to OS compatibility. It is
essential to consult the documentation provided by the microprocessor manufacturer to ensure that the
installed OS is supported and that any necessary drivers or updates are installed.
6. Testing and Benchmarking: Once the device installation is complete, it is recommended to perform
testing and benchmarking to ensure that the microprocessor is functioning correctly and meeting
performance expectations. Various software tools and utilities are available for stress testing, temperature
monitoring, and benchmarking purposes. These tests can help identify any potential issues or bottlenecks in
the system and allow for adjustments or optimizations if needed.
In conclusion, checking device installation for compliance of microprocessors involves several crucial steps
such as physical installation, power supply verification, cooling system assessment, BIOS/UEFI settings
configuration, operating system compatibility check, and testing/benchmarking. By following these steps
and considering the specific requirements provided by the microprocessor manufacturer, one can ensure a
compliant and well-functioning microprocessor installation.
This unit will also assist you to attain the learning outcomes stated in the cover page. Specifically, upon
completion of this learning guide, you will be able to:
Introducing machine languages.
Prepare basic flow chart for the intended assembly language.
Understand machine language in assembly language
Identify logic instructions for registers, stacks operations, and interfacing devices
Organize assembly language
Implement basic software techniques
Machine languages are low-level programming languages that are directly understood and executed by a
computer's hardware. They consist of a set of instructions that can be executed by the central processing unit
(CPU) of a computer. In the context of instruction micro, machine languages play a crucial role in defining
the operations and behavior of microprocessors.
Instruction micro refers to the design and implementation of microprocessors, which are integrated circuits
that serve as the central processing unit (CPU) of a computer system. These microprocessors execute
instructions stored in memory, performing arithmetic, logical, control, and input/output operations. When
introducing machine languages for instruction micro, it is essential to consider the specific architecture and
design principles of the microprocessor being used. Different microprocessors may have different instruction
sets and formats, requiring specific machine language instructions to perform various operations.
Machine languages for instruction micro typically consist of binary code, where each instruction is
represented by a sequence of 0s and 1s. Each binary instruction corresponds to a specific operation or
command that the microprocessor can execute. These instructions are designed to be easily interpretable by
the microprocessor's hardware.
To facilitate programming in machine language, mnemonic codes are often used as human-readable
representations of machine instructions. These mnemonics provide a more intuitive way for programmers to
write code in machine language. For example, instead of writing a binary sequence like "10110010," a
programmer can use a mnemonic like "ADD" to represent an addition operation.
The mapping between mnemonics and their corresponding binary instructions is defined by an assembly
language. Assembly languages are symbolic representations of machine languages that provide mnemonics
for each machine instruction. They serve as a bridge between high-level programming languages and
machine languages, making it easier for programmers to write code at a lower level of abstraction.
It is important to note that different microprocessors may have different assembly languages and instruction
sets. Each microprocessors architecture has its own unique set of instructions and addressing modes, which
determine how operands are specified for each instruction. Therefore, when introducing machine languages
for instruction micro, it is crucial to consider the specific microprocessor architecture being used.
In summary, machine languages play a vital role in instruction micro by providing a low-level programming
interface for microprocessors. These languages consist of binary instructions that directly correspond to
operations executed by the hardware. Assembly languages serve as a human-readable representation of
machine languages, allowing programmers to write code using mnemonic instructions. Assemblers then
translate this assembly code into binary machine code that can be executed by the microprocessor.
2.2. Preparing basic flow chart for the intended assembly language
The purpose of this section is to provide a basic flow chart for the intended assembly language programming
for the project. The flow chart will outline the steps involved in the program's execution, from start to finish.
The following are some additional details about the assembly language programming for the project:
The program will be written in 32-bit assembly language, using the x86-64 instruction set architecture.
The program will use the NASM (Net wide Assembler) assembler to convert the assembly code into
machine code.
The program will use the Linux operating system, and will be compiled using the GCC (GNU Compiler
Collection) compiler.
The program will use the standard C library, which provides a set of functions for performing common tasks
such as input/output operations and memory management.
Assembly language unlocks the secret of your computer's hardware and software. It teaches you about
the way the computer's hardware and operating system work together and how, the application
programs communicate with the operating system. Assembly language, unlike high level languages, is
machine dependent. Each microprocessor has its own set of instructions, that it can support. Here we
will discuss, only the IBM-PC assembly language. It consists of the Intel 8086/8088 instruction set.
The instructions for the Intel 8088 may be used without modification on all its enhancements -
80186,80286,80386,80486 and Pentium.
Assembly Language Syntax and Program Structure
A processor can directly execute a machine language program. Though it is possible to program directly in
machine language, assembly language uses mnemonics to make programming easier. An assembly
language program uses mnemonics to represent symbolic instructions and the raw data that represent
variables and constants. A machine language program consists of: a list of numbers representing the bytes
of machine instructions to be executed and data constants to be used by the program.
Assembly Language Syntax
An assembly language program consists of statements. The syntax of an assembly language program
Page 21 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
statement obeys the following rules:
Only one statement is written per line.
Each statement is either an instruction or an assembler directive.
Each instruction has an opcode and possibly one or more operands.
An opcode is known as a mnemonic.
Each mnemonic represents a single machine instruction.
Operands provide the data to work with.
Assembler Directives
Pseudo instructions or assembler directives are instructions that are directed to the assembler.
Assembler directives affect the generated machine code, but are not translated directly into machine
code. Directives can be used to declare variables, constants, segments, macros, and procedures as
well as supporting conditional assembly.
In general, a directive contains pseudo-operation code, tells the assembler to do a specific thing, and is
not translated into machine code.
Segment directives
Segments are declared using directives. The following directives are used to specify the following
segments:
stack
data
code
Stack Segment
Used to set aside storage for the stack.
Stack addresses are computed as offsets into this segment.
Use: .stack followed by a value that indicates the size of the stack.
Data Segment
Used to set aside storage for variables.
Constants are defined within this segment in the program source.
Variable addresses are computed as offsets from the start of this segment.
Use: .data followed by declarations of variables or definitions of constants.
Code Segment
The code segment contains executable instructions macros and calls to procedures. Use: .code followed by a
sequence of program statements.
The 8086 microprocessor is a 16-bit microprocessor that was introduced by Intel in 1978. It is part of the
x 86 families of processors and is widely used in various applications, including personal computers,
embedded systems, and industrial automation.
Assembly language is a low-level programming language that is specific to particular processor
architecture. It provides a direct correspondence between the instructions executed by the processor and the
operations performed by the hardware. The 8086 assembly language is designed to work with the 8086
microprocessor and its successors, such as the 80186, 80286, and later generations.
Assembly language programming for the 8086 microprocessor involves writing code using mnemonic
instructions that represent specific machine operations. These instructions are then assembled into machine
code, which can be directly executed by the processor. Assembly language programs are typically written
using a text editor and then assembled using an assembler.
The 8086 assembly language supports a wide range of instructions for performing arithmetic and
logical operations, data movement, control flow, and input/output operations. These instructions can
operate on various data types, including integers, floating-point numbers, and strings.
Commonly used instructions in 8086 assembly language programming include:
1. Data Movement Instructions: These instructions are used to move data between registers, memory
locations, and immediate values. Examples include MOV (move), PUSH (push onto stack), POP (pop from
stack), XCHG (exchange), LEA (load effective address), etc.
2. Arithmetic and Logical Instructions: These instructions perform arithmetic and logical operations on
data. They include ADD (addition), SUB (subtraction), MUL (multiplication), DIV (division), AND (bitwise
AND), OR (bitwise OR), XOR (bitwise XOR), etc.
3. Control Flow Instructions: These instructions control the flow of execution in a program. They include
JMP (jump unconditional), JZ (jump if zero), JNZ (jump if not zero), JC (jump if carry), JNC (jump if not
carry), CALL (call a subroutine), RET (return from subroutine), etc.
4. String Instructions: The 8086 microprocessor also provides a set of instructions specifically designed for
Page 23 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
working with strings of data. These instructions include MOVSB (move byte from string to string),
MOVSW (move word from string to string), CMPSB (compare byte strings), SCASB (scan byte string), etc.
Assembly language programming for the 8086 microprocessor requires a good understanding of the
processor's architecture, instruction set, and memory organization. It also requires careful management of
registers and memory locations to ensure efficient and correct execution of the program.
In addition to the basic instructions, the 8086 microprocessor also supports various addressing modes, which
allow programmers to access data in different ways. These addressing modes include immediate addressing,
register addressing, direct addressing, indirect addressing, indexed addressing, based addressing, and relative
addressing.
Assembly language programming for the 8086 microprocessor can be challenging due to its low-level nature
and the need for manual memory management. However, it offers a high level of control over the hardware
and can result in highly optimized code.
1. "The 8086 Microprocessor: Programming and Interfacing the PC" by Kenneth Ayala - This book
provides a comprehensive guide to programming the 8086 microprocessor using assembly language. It
covers topics such as instruction set architecture, memory organization, I/O operations, and interrupts
handling.
2. Intel 8086/8088 Assembly Language Programming Manual - This manual published by Intel
Corporation provides detailed information about assembly language programming for the 8086
microprocessor. It includes a complete instruction set reference, examples, and programming techniques.
3. "Assembly Language for x86 Processors" by Kip R. Irvine - This book is a widely used textbook for
learning assembly language programming for x86 processors, including the 8086. It covers topics such as
data representation, memory addressing, arithmetic and logical operations, control flow, and string
manipulation.
These authoritative references provide in-depth information and guidance on assembly language
programming for the 8086 microprocessor, making them valuable resources for both beginners and
experienced programmers in this domain.
function.
Arduino is an open-source electronics PCB containing a microcontroller and the things needed to
support it: Power Supply Communications, Reset Button, Clock, and Connectors for adding Sensors and
Actuators in the physical world.
Using an Arduino you can develop interactive objects, taking inputs from a variety of switches or
sensors, and controlling a variety of lights, motors, and other physical outputs.
The Arduino consists of two parts; the hardware and the software.
Our Robot Board is based on the Arduino Leonardo which contains an ATmega32U4
8 bit microcontroller. We will be using AVR Studio to develop the software for the
W HAT IS A P ROGRAM ?
• The Program is a “very specific list of instructions” to the computer.
• The process of “creating the program” is where much of an electrical engineer‟s
time is spent.
• The program is often referred to as
Software, while the physical system
components are called Hardware. Software
held within non-volatile memory is called
Firmware.
• Software design is all about creating
patterns of 0‟s and 1‟s in order to get the
computer to do what we want. These 0's
and 1's are known as Machine Code.
0010 0111 0000 0000 → 1110 1111 0001 1111 → 1011 1001 0000 0111 → 1011 1001
0001 1000
1011 1001 0000 0100 → 1011 0000 0111 0110 → 1011 1000 0111 0101 → 1100 1111
1111 1101
Corollary
• Specific to a single computer or class of computers (non-portable)
Understanding logic instructions for registers, stack operations, and interfacing input and output devices is
essential in the field of computer architecture and digital systems design. This knowledge is crucial for
E. A stack operation: A stack is a data structure that follows the Last-In-First-Out (LIFO) principle. It is
commonly used in computer systems for managing subroutine calls, storing local variables, and handling
interrupts. Stack operations involve pushing (adding) or popping (removing) data onto or from the stack.
The stack typically resides in the computer's main memory and grows or shrinks dynamically as data is
pushed or popped. It is often implemented using a region of memory called the stack segment, with a stack
pointer indicating the current top of the stack.
The two fundamental operations performed on a stack are:
I. Push : This operation adds data to the top of the stack. It involves decrementing the stack pointer and
storing the data at the new top position.
II. Pop: This operation removes data from the top of the stack. It involves retrieving the data from the
current top position and incrementing the stack pointer.
Page 30 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
Stack operations are crucial for managing program flow and preserving data integrity during subroutine
calls. When a subroutine is called, its return address and local variables are typically pushed onto the stack.
Upon completion, these values are popped back to restore the previous execution state.
The following rules have to be strictly followed in order to write correct code.
A. Both operands have to be of the same size:
Instruction Correct Reason
MOV AX, BL No Operands of different sizes
MOV AL, BL Yes Operands of same sizes
MOV AH, BL Yes Operands of same sizes
MOV BL, CX No Operands of different sizes
The first operand in all the cases could be either in register or in memory. The second operand
could be either in register/memory or an immediate (constant) value. However, memory to
memory operations are not possible.
These instructions compare or match bits of the operands and set the CF, OF, PF, S and ZF flags.
A. The AND Instruction
The AND instruction is used for supporting logical expressions by performing bitwise AND
operation. The bitwise
AND operation returns 1, if the matching bits from both the operands are 1, otherwise it returns 0. For
example
Operand1: 0101
Operand2: 0011
----------------------------
After AND -> Operand1: 0001
The AND operation can be used for clearing one or more bits. For example, say, the BL register
contains 0011
1010. If you need to clear the high order bits to zero, you AND it with 0FH.
When the above code is compiled and executed, it produces following result:
Even Number!
Odd Number!
Operand1: 0101
Operand2: 0011
----------------------------
The OR operation can be used for setting one or more bits. For example, let us assume the AL
register contains
0011 1010, you need to set the four low order bits, you can OR it with a value 0000 1111, i.e., FH.
Example:
Page 34 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
The following example demonstrates the OR instruction. Let us store the value 5 and 3 in the AL
and the BL register
respectively. Then the instruction,
OR AL, BL
section .text
global main ;must be declared for using gcc
main: ;tell linker entry point
mov al, 5 ;getting 5 in the al
mov bl, 3 ;getting 3 in the bl
or al, bl ;or al and bl registers, result should be 7
add al, byte '0' ;converting decimal to ascii
mov [result], al
mov eax, 4
mov ebx, 1
mov ecx, result
mov edx, 1
int 0x80
outprog:
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .bss
result resb 1
When the above code is compiled and executed, it produces following result:
C. The XOR Instruction
The XOR instruction implements the bitwise XOR operation. The XOR operation sets the
resultant bit to 1, if and
only if the bits from the operands are different. If the bits from the operands are same (both 0
Page 35 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
or both 1), the
resultant bit is cleared to 0.
For example,
Operand1: 0101
Operand2: 0011
----------------------------
After XOR -> Operand1: 0110
XORing an operand with itself changes the operand to 0. This is used to clear a register.
A. Conditional Instructions
1
Page 36 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
2
B. Unconditional jump
This is performed by the JMP instruction. Conditional execution often involves a transfer of control
to the address of an instruction that does not follow the currently executing instruction. Transfer of
control may be forward to execute a new set of instructions, or backward to re-execute the same
steps.
Conditional jump
This is performed by a set of jump instructions j<condition> depending upon the condition. The
conditional instructions transfer the control by breaking the sequential flow and they do it by
changing the offset value in
Let us discuss the CMP instruction before discussing the conditional instructions.
B. The CMP Instruction
The CMP instruction compares two operands. It is generally used in conditional execution.
This instruction basically subtracts one operand from the other for comparing whether the
operands are equal or not. It does not disturb the destination or source operands. It is used along
with the conditional jump instruction for decision
making.
SYNTAX
CMP destination, source
CMP compares two numeric data fields. The destination operand could be either in register or in memory.
The source operand could be a constant (immediate) data, register or memory.
EXAMPLE:
CMP DX, 00 ; Compare the DX value with zero
JE L7 ; If yes, then jump to label L7
CMP is often used for comparing whether a counter value has reached the number of time a loop
needs to be run. Consider the following typical condition:
INC EDX
CMP EDX, 10 ; Compares whether the counter has reached 10
JLE LP1 ; If it is less than or equal to 10, then jump to LP1
Unconditional Jump
As mentioned earlier this is performed by the JMP instruction. Conditional execution often
involves a transfer of control to the address of an instruction that does not follow the currently
executing instruction. Transfer of control may be forward to execute a new set of instructions, or
JMP label
EXAMPLE:
The following code snippet illustrates the JMP instruction:
Conditional Jump
If some specified condition is satisfied in conditional jump, the control flow is transferred to a
target instruction.
There are numerous conditional jump instructions, depending upon the condition and data.
Following are the conditional jump instructions used on signed data used for arithmetic operations:
C. Linker
For modularity of your program, it is better to break your programs, into several subroutines. It is
even better, to put the common routine, like reading a hexadecimal number, writing a hexadecimal
number etc., which could he used by a lot of your other programs also, into a separate file. These files
are assembled separately. After each ,has been successfully assembled, they can be linked together to
form a large file, which constitutes your complete program. The file containing the common
routines can be linked to your other programs also. The program that links your programs is called
the linker.
The linker produces a link file which contains the binary codes for all compound modules. The linker also
produces a link map which contains the address information about the linked files. The linker, however,
does not assign absolute addresses to your program. It only assigns continuous relative addresses to all
the modules linked, starting from zero. This form of program is said to be reloadable, because it
Page 40 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
can be put anywhere in memory to be run. This form of code can be even be carried to other machines,
of the same kind, or compatible to the present machine, to be run successfully. The linker available
on your PC is LINK ,TURBO has a built in linker.
D. Loader
Loader is a program, which assigns absolute addresses to the program. These addresses are
generated, by adding to all the offsets, the address from where the program is loaded into the
memory. Loader comes into action, when you execute your program. This program is brought from the
secondary memory, like disk, or floppy diskette, into the main memory at a specific address. Let us
assume the program was loaded at address 1000h, then 1000h is added to all the offsets to get the
absolute address. Once the program has been loaded, it is now ready to run.
E. Debugger
If your program requires no external hardware or requires hardware directly accessible from your
system, then you can use a debugger to debug your program. Debugger allows you to load your
program into just like a loader, and, troubleshoot your program. While debugging, you can run your
program in single step, set breakpoints, and view the contents of registers or memory locations. You can
even change the contents of the register or memory location, and run your program with new value. This
helps you to isolate the problems in your programs. The problems can be
Corrected with the help of an editor, and the whole procedure of assembling, linking and executing your
program can be repeated. Debugger helps you detect the logical errors that could not be detected by the
assembler.
The following steps showed the process of translating an assembly program into
Executable file:
The assembler produces an object file from the assembly language source.
The object file contains machine language code with some external and re-locatable
addresses that will be resolved by the linker. Their values are undetermined at that stage.
The linker extract object modules (compiled procedures) from a library and links
them with the object file to produce the executable file.
The addresses in the executable file are all resolved but they are still virtual addresses.
Input and output (I/O) devices allow computers to interact with the external world by receiving input from
users and providing output to display information or control external devices. Interfacing these devices with
a computer system involves establishing communication channels and protocols to exchange data. There are
various methods for interfacing I/O devices, including:
A. Memory mapped device :
In this method, I/O devices are assigned specific memory addresses. Reading from or writing to these
addresses triggers corresponding actions on the devices. The CPU communicates with I/O devices by
reading from or writing to specific memory locations.
B.Port mapped I/O :In this method, separate input/output ports are dedicated to each device. The CPU
communicates with I/O devices by reading from or writing to specific port addresses.
C. Direct memory access (DMA) : DMA allows certain devices to transfer data directly between their own
memory and main memory without CPU intervention. This method is particularly useful for high-speed data
transfers, such as disk I/O or network communication.
Interfacing input devices involves reading data from sources such as keyboards, mice, sensors, or network
interfaces. Output devices, on the other hand, receive data from the computer system and display it on
screens, printers, speakers, or other output mediums.
Effective interfacing requires understanding the protocols and communication standards specific to each
Page 42 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
device. These standards can include serial or parallel communication, USB, Ethernet, HDMI, or wireless
protocols like Bluetooth or Wi-Fi.
In conclusion, understanding logic instructions for registers, stack operations, and interfacing input and
output devices is crucial for comprehending computer architecture and digital systems design. Registers
provide fast storage within the CPU for efficient data processing. Stack operations enable proper
management of subroutine calls and local variables. Interfacing input and output devices allows computers
to interact with the external world effectively.
Assembly language is a low level programming language. you need to get some
knowledge about computer structure in order to understand anything. The simple
computer model as I seeit: the system bus (shown in yellow) connects the various components
of a computer. the CPU is the heart of the computer, most of computations occur inside the CPU.
8086 CPU has 8 general purpose registers; each register has its own name:
• BP - base pointer.
• SP - stack pointer.
despite the name of a register, it's the programmer who determines the usage for each general purpose
register. the main purpose of a register is to keep a number (variable). the size of the above registers is 16
bit, it's something like: 0011000000111001b (in binary form), or 12345 in decimal (human) form. 4
general purpose registers (AX, BX, CX, DX) are made of two separate 8 bit registers, for example if
AX= 0011000000111001b, then AH=00110000b and AL=00111001b. therefore, when you modify any of
the 8 bit registers 16 bit register is also updated, and vice-versa. the same is for other 3 registers, "H" is for
high and "L" is for low part.
because registers are located inside the CPU, they are much faster than memory. Accessing a memory
location requires the use of a system bus, so it very small and most registers have special purposes which
limit their use as variables, but they are still an excellent place to store temporary data of calculations.
Segment Registers
• SS - points at the segment containing the stack. although it is possible to store any data in the
Page 45 of 77 Author/Copyright Assemble, enter and verify Training module Version -1
operating instructions in
Ministry of Labor and microprocessor equipped
Skills devices Ocb, 2023
segment registers, this is never a good idea. the segment registers have a very special purpose - pointing at
accessible blocks of memory. segment registers work together with general purpose register to access any
memory value. For example if we would like to access memory at the physical address 12345h
(hexadecimal), we should set the DS = 1230h and SI = 0045h. This is good, since this way we can access
much more memory than with a single register that is limited to 16 bit values. CPU makes a calculation of
physical address by multiplying the segment register by 10h and adding general purpose register to it
(1230h * 10h + 45h
= 12345h):
The address formed with 2 registers is called an effective address. by default BX, SI and DI registers work
with DS segment register; BP and SP work with SS segment register. other general purpose registers
cannot form an effective address! also, although BX can form an effective address, BH and BL cannot.
IP register always works together with CS segment register and it points to currently executing instruction.
Flags register is modified automatically by CPU after mathematical operations, this allows to determine
the type of the result, and to determine conditions to transfer control to other parts of the program.
Generally you cannot access these registers directly, the way you can access AX and other general registers,
but it is possible to change values of system registers using some tricks that you will learn a little bit later.
Optimization: After testing and debugging, you can optimize the assembly code to improve its performance or
reduce its size. This can involve techniques such as loop unrolling, code rearrangement, or using specific
instructions provided by the microprocessor for efficient execution. Optimization should be done carefully,
considering the trade-offs between code size, execution speed, and maintainability.
Documentation: Finally, it is important to document the assembly language code for future reference and
maintenance. This includes providing a clear description of the program's functionality, any assumptions made
during development, and any specific hardware dependencies or configurations required. Documentation helps
other developers understand and modify the code in the future.
B. Preparing assembly language code for microprocessor-based equipment
To prepare assembly language instructions for microprocessor-based equipment verification and entering them into a
PDF or DOC file, you will need to follow a series of steps. Assembly language is a low-level programming language
that is specific to the architecture of a particular microprocessor. It allows direct control over the hardware and
provides a more efficient way to write programs compared to higher-level languages.
Here is a comprehensive guide on how to prepare assembly language instructions for microprocessor-based
equipment verification and enter them into file:
Understand the Microprocessor Architecture: The first step is to familiarize yourself with the architecture of
the microprocessor you are working with. Each microprocessor has its own instruction set, registers, memory
organization, and addressing modes. You need to understand these details to write efficient and correct assembly
code.
Choose an Assembly Language Development Environment: There are several assembly language
development environments available, such as Microsoft Macro Assembler (MASM), GNU Assembler (GAS),
Test and Debug: Before finalizing your assembly language instructions, thoroughly test them on the target
microprocessor-based equipment. Use appropriate test cases to ensure that the program behaves as expected. If
any issues arise, debug the code using the debugger provided by your chosen development environment.
Finalize and Distribute: Once you are confident in the correctness of your assembly language instructions,
finalize the document by proofreading it for any errors or typos. Ensure that all necessary information is
included, such as contact details, version numbers, and revision history. Finally, distribute the PDF or DOC file
to relevant stakeholders or users.
"Software package" is a commonly used term; however, its general, widespread usage has resulted in different
meanings. The origins of software packages can be traced to the 1960s. The Program Application Library on the
IBM 1400 series computer, the MARK IV package by Informatics, and the Auto flow package by Applied Data
Research were some of the first software packages developed. What made them unique was that one of the goals of
each of these packages was to be usable (or transportable) on a number of different types of computers [WELK80].
One of the most significant events in the evolution of software packages was IBM's decision in 1969 to "unbundle",
or offer software separately from hardware, training and documentation. Software products became recognized as
distinct entities, separately priced from computer hardware. Most of the initially unbundled software products or
packages were system software packages. These packages were intended primarily to enhance the performance of
the ADP system and included, for example, compilers, sort utilities, and data base management systems.
Prompted at least in part by the increasingly widespread use of microcomputers, the recent explosion in both the
number and popularity of software packages has resulted in a number of distinct classes of packages. Software tools
aid in the development of computer programs; systems packages analyze or improve the performance of a
component of the system; data base management systems organize, interrogate, and update data files. Application
software packages are the class of software packages considered in this document. They both directly and indirectly
support functional managers, concerned with such areas as personnel and project management, administration,
inventory control, budget and financial management, word processing and office automation, and support functions
typically performed in most organizations, whether Government or private sector. Specialized functions such as
process control, airline reservation systems and military embedded weapon systems are not included in this
definition. Systems - 9 - software packages and software tools are also not included. Another key in this definition of
1.6.2. Set up of STO, HALT, and FLAG to set or reset for given data
To set or reset STO, HALT, and FLAG for a given data PDF or DOC file, you would need to understand the
specific context in which these terms are being used. Without further clarification, it is difficult to provide a
precise answer. However, I can explain the general concepts of STO, HALT, and FLAG.
STO (Set/Store): STO typically refers to the "store" operation in computer programming or digital systems.
It is used to save or store data into a specific memory location or register. In the context of a PDF or DOC
file, STO could be used to indicate saving or storing certain information within the file itself. However, it is
important to note that PDF and DOC files are binary formats with their own internal structures, so directly
manipulating individual bits or bytes may not be straightforward.
FLAG: FLAG is a term commonly used in computer programming to represent a binary value that indicates
a certain condition or state. Flags are often used for control flow decisions and conditional branching within
programs. In the context of a PDF or DOC file, FLAG could be used to represent various states or conditions
related to the file's content or metadata. For example, a FLAG could be set to indicate whether a particular
section of the document has been reviewed or not.
ADDRESSING MODES
MC6802 Microprocessor has 7 addressing modes that can be used by the programmer:
1. Accumulator
2. Immediate
3. Direct
4. Extended
5. Indexed
6. Implied (Inherent)
7. Relative
MC6802 instructions may be used with one or more of these addressing modes. The
instruction set and their addressing modes are given in Appendix A.
Accumulator Addressing
In accumulator addressing, either accumulator A or accumulator B is specified. These are 1 - byte
instructions. Ex: ABA adds the contents of accumulators and stores the result in accumulator A
Immediate Addressing
In immediate addressing, operand is located immediately after the opcode in the second byte of
the instruction in program memory (except LDS and LDX where the operand is in the second
and third bytes of the instruction). These are 2-byte or 3-byte instructions.
Direct Addressing
5. Data transfer instructions move data between registers, memory locations, and input/output devices.
Checking and isolating circuits, machines, or plants with microprocessor equipment is necessary for several reasons:
Troubleshooting: When a microprocessor-based system malfunctions or exhibits unexpected behavior,
checking and isolating circuits can help identify the root cause of the issue. By systematically examining
different components and their connections, faulty elements can be identified and repaired or replaced.
Maintenance: Regular maintenance is crucial for ensuring the optimal performance and longevity of
microprocessor equipment. Checking circuits allows technicians to detect any potential issues before they
escalate into major problems. It also helps in identifying areas that require preventive maintenance or component
replacement.
Safety: Isolating circuits or machines is essential for safety purposes during maintenance or repair work. By
disconnecting power sources and isolating specific circuits, technicians can prevent accidental electrical shocks
or damage to the equipment.
To effectively check and isolate circuits, machines, or plants with microprocessor equipment, the following steps can
be followed:
Reviewing Documentation: Start by reviewing the documentation provided by the equipment manufacturer.
This includes user manuals, technical specifications, circuit diagrams, and any other relevant documentation.
Understanding the system architecture and component interconnections is crucial before proceeding with
checking and isolating circuits.
Identify Power Sources: Identify all power sources supplying electricity to the microprocessor equipment. This
includes both primary power sources (e.g., main power supply) and secondary power sources (e.g., batteries or
backup power supplies). Ensure that all power sources are disconnected or switched off before proceeding
further.
The following is a comprehensive guide on how to assemble and enter operating instructions for a
microprocessor application.
A. Begin by gathering all the necessary components for the microprocessor application. This may include the
microprocessor chip, memory modules, input/output devices, power supply, and any other required peripherals.
B. Carefully read the documentation provided with each component to understand their specifications, installation
requirements, and compatibility with the microprocessor.
C. Follow the manufacturer's instructions to assemble the hardware components. This typically involves connecting the
microprocessor chip to the motherboard or development board, inserting memory modules into their respective slots,
and connecting input/output devices such as keyboards, mice, or displays.
Microprocessors come in different architectures and designs. The most common architecture is the x86 architecture,
which is used in most personal computers. Other popular architectures include ARM (Advanced RISC Machines),
PowerPC, and MIPS (Microprocessor without Interlocked Pipeline Stages). Each architecture has its own set of
instructions and features.
The performance of a microprocessor is determined by factors such as clock speed, number of cores, cache size, and
instruction set architecture. Clock speed refers to the number of cycles per second that a processor can execute.
Higher clock speeds generally result in faster processing. Multiple cores allow for parallel processing, enabling the
microprocessor to handle multiple tasks simultaneously. Cache memory is a small but fast memory that stores
frequently accessed data for quick retrieval.
Microprocessors are classified into different generations based on their technological advancements. The first
generation of microprocessors was introduced in the 1970s and featured 4-bit processors with limited capabilities.
Subsequent generations saw significant improvements in performance and functionality. The current generation
includes advanced processors with multiple cores, high clock speeds, and advanced features like virtualization
support and hardware-level security.
The applications of microprocessors are vast and diverse. They are used in personal computers for tasks such as
word processing, web browsing, gaming, and multimedia playback. Microprocessors are also found in smart phones
and tablets, enabling various functionalities like communication, internet access, and app execution. Additionally,
microprocessors are used in embedded systems, which are specialized computer systems designed for specific
applications. Examples of embedded systems include automotive electronics, industrial control systems, medical
devices, and consumer electronics.
In conclusion, microprocessors are integral components of modern electronic devices, serving as the central
processing unit that executes instructions and performs calculations. They come in different architectures and
designs, with performance factors such as clock speed, number of cores, cache size, and instruction set architecture
influencing their capabilities. Microprocessors have evolved over generations to offer higher performance and
advanced features. They find applications in personal computers, smartphones, tablets, and various embedded
systems
3. Regular maintenance is crucial for ensuring the optimal performance and longevity of
microprocessor equipment
4. Machine languages are low-level programming languages that are directly understood and executed
by a computer's software‟s.
4.1. Testing device operation using tools, materials and test instruments
To test device operation and generate a report in PDF format, you can follow a systematic approach that
includes several steps. These steps involve checking the device's hardware and software components,
conducting functional tests, and generating a comprehensive report. Here is a detailed explanation of each
step:
Hardware Check: Start by examining the physical components of the device to ensure they are in proper
working condition. Check for any visible damage or loose connections. Verify that all necessary peripherals
and accessories are connected correctly.
Functional Tests: Perform a series of functional tests to evaluate the device's performance and capabilities.
These tests may vary depending on the type of device being tested, but some common examples include:
Power Test: Verify that the device powers on/off properly and that the battery (if applicable) charges as
expected.
Connectivity Test: Test all available connectivity options (e.g., Wi-Fi, Bluetooth, USB) to ensure they are
functioning correctly.
Display Test: Check the display for any dead pixels, color accuracy, brightness levels, and touch
responsiveness (if applicable).
Performance Test: Run benchmarking tools or perform tasks that stress the device's CPU, GPU, memory,
and storage to evaluate its performance.
Input/output Test: Test all input/output ports (e.g., USB ports, audio jacks) to ensure they are working
correctly.
Sensor Test: If applicable, test various sensors (e.g., accelerometer, gyroscope) to ensure they provide
accurate readings.
Camera Test: Assess the quality and functionality of both front and rear cameras (if present) by capturing
photos/videos in different conditions.
Audio Test: Check the device's speakers, microphone, and headphone jack for sound quality and proper
functioning.
Software Test: Test various software applications and features to ensure they work as intended without any
crashes or glitches.
Report Generation: After completing the functional tests, compile all the findings into a comprehensive
report. The report should include detailed information about the device, such as its make, model, and serial
number. It should also provide a summary of the hardware and software checks performed. Additionally,
To generate the report in PDF format, you can use various tools and software applications available. Some
popular options include Microsoft Word (which allows saving documents as PDF), Adobe Acrobat
(specifically designed for creating PDFs), or online converters that can convert your document into PDF
format.
When it comes to testing the operation of a microprocessor, there are several test instruments that can be
used to ensure its proper functioning. These instruments help in verifying the performance, functionality, and
reliability of the microprocessor. In this comprehensive answer, we will discuss some of the commonly used
test instruments for the operation of a microprocessor.
Logic Analyzer: A logic analyzer is a powerful tool used for capturing and analyzing digital signals. It
allows engineers to observe and analyze the behavior of a microprocessor by capturing and displaying digital
waveforms. Logic analyzers can capture multiple channels simultaneously, providing a detailed view of the
microprocessor's operation. They are capable of decoding various protocols such as I2C, SPI, UART, and
CAN, which are commonly used for communication with peripherals. With their advanced triggering
capabilities, logic analyzers can help identify timing issues, protocol errors, and other anomalies in the
microprocessor's operation.
Oscilloscope: An oscilloscope is another essential instrument for testing microprocessors. It is used to
visualize and measure analog signals such as voltage and current waveforms. Oscilloscopes can be used to
monitor the power supply voltages and clock signals of a microprocessor, ensuring that they meet the
required specifications. They can also help in debugging issues related to signal integrity, noise, and timing
violations. Additionally, some modern oscilloscopes come with advanced features like serial bus decoding
and protocol analysis, which can be useful for testing microprocessors that communicate using serial
protocols.
In-Circuit Emulator (ICE): An in-circuit emulator is a hardware device that allows engineers to debug and
test microprocessors in real-time. It replaces the actual microprocessor on the target board with a specialized
emulator chip that emulates the behavior of the original microprocessor. This enables engineers to execute
instructions step-by-step, set breakpoints, and examine internal registers and memory contents during
program execution. In-circuit emulators provide a powerful debugging environment, allowing engineers to
Identifying and correcting operating anomalies for microprocessors is a complex task that requires a
deep understanding of the architecture and design principles of these electronic devices. Microprocessors are
the central processing units (CPUs) of computers and other digital devices, responsible for executing
instructions and performing calculations. Like any other electronic component, microprocessors can
experience anomalies or errors during their operation, which can lead to system instability or incorrect
results.
To identify and correct operating anomalies in microprocessors, several techniques and methodologies are
employed. These include:
Testing and Validation: Microprocessor manufacturers perform extensive testing and validation procedures
during the design and manufacturing stages to ensure the proper functioning of their products. This involves
running various test programs and benchmarks to verify the correctness of the microprocessor's behavior
under different conditions. Manufacturers also use simulation tools to model the microprocessor's behavior
and identify potential issues before fabrication.
Debugging Tools: When an operating anomaly is encountered in a microprocessor, debugging tools play a
crucial role in identifying the root cause of the problem. These tools allow engineers to monitor the internal
state of the microprocessor, trace the execution of instructions, and analyze memory accesses. By examining
these details, engineers can pinpoint the specific instruction or condition that triggers the anomaly.
Firmware Updates: In some cases, operating anomalies in microprocessors can be addressed through
firmware updates. Firmware is software that is embedded in the microprocessor itself and controls its
operation. Manufacturers release firmware updates periodically to fix bugs or improve performance. These
updates can be installed by end-users or system administrators to mitigate known issues.
Microcode Updates: Microcode is a layer of software that translates higher-level instructions into low-level
operations that can be executed by the microprocessor's hardware. In certain cases, operating anomalies may
be caused by errors or inefficiencies in the microcode implementation. Microcode updates can be released by
manufacturers to address these issues and improve the overall performance and stability of the
microprocessor.
Housekeeping is not limited to keeping the place clean; it is also concerned with keeping equipment and materials in
good repair and in their proper place. Good housekeeping is essential to preventing losses or injuries. Every injury
caused by housekeeping can be prevented if everyone helps to keep the work area clean.
Cleanliness gives rise to a good character by keeping body, mind, and soul clean and peaceful. Maintaining
cleanliness is the essential part of healthy living because it is the cleanliness only which helps to improve our
personality by keeping clean externally and internally
Another option is to use a DOC (Microsoft Word Document) file to document work completion for microprocessors.
DOC files are editable documents that allow you to create and format text, images, tables, and other content. They
offer flexibility in terms of editing and revising the document as needed. With a DOC file, you can easily add or
remove sections, update information, and make changes to the overall structure of the document.
When documenting work completion for microprocessors in either PDF or DOC format, it is important to include
relevant information such as
Provide an overview of the project or task related to the microprocessor. Explain the purpose and objectives of the
work completed.
Design: Describe the design process involved in developing the microprocessor. Include details about the
architecture, instruction set, memory organization, and other design considerations.
Development: Outline the steps taken to develop the microprocessor. This may include coding in hardware
description languages (HDLs), simulation, synthesis, and verification.
1. Disposing waste materials from microprocessors is a critical concern in the field of electronics
2. Testing methodologies employed to ensure the functionality and performance of the microprocessor.
3. Microcode is a layer of software that translates higher-level instructions into low-level operations
4. Logic analyzers can capture multiple channels simultaneously
TEST II : Chose the best answer
1. _______ Describes the details about the architecture, instruction set, memory organization, and other design
considerations.
2. ______is a standard interface used for testing and debugging integrated circuits, including microprocessors.
1. Tesfahun Ayalew Denidine MSc Electronics and comm BGRS Assosa poly TVET 012132308/0921212
tesfugps4545@gmail.com
Eng. 1
3. Petros Gelana Megersa BSC Electrical comm.T Oromia Ambo poly TVET 0921183975 petrosgelana6@gimal.com
4. Mezgebu Alemseged BSC Electrical & comm.T A.A G/M/B/ Poly TVET 0943933255