MP Lab
MP Lab
Objectives:
1. Introduction to Microsoft Turbo Assembler (TASM)
Overview:
In general, programming of microprocessor usually takes several iterations before the
right sequence of machine code instruction is written. The process, however is facilitated
using a special program called an “Assembler”. The Assembler allows the user to write
alphanumeric instructions. The Assembler, in turn, generates the desired machine
instructions from the assembly language instructions.
STEP PRODUCES
Start
Run
Type CMD
Ok
Display shows
C :\>D:
Press ENTER
D :\>CD TASM
Press ENTER
D: \TASM>EDIT FILENAME.ASM
Press ENTER
Then the save the program (Use Alt+F keys to appear the option window)
Example
D: \TASM>TASM sarada.asm
Then Display shows Errors, (0) Warnings (0)
Example
D: \TASM>TLINK sarada.obj
↓
Example
D: \TASM>TD sarada.exe
↓
Then the display shows
Choose OK
ADDTITON
ALGORITHM:
1. Initialize the Data and code segment.
1. ADD destination,source
(ADD register/memory, register/memory/immediate data):
• This is an instruction used to perform addition of binary values from source contents with
destination contents, and store result in the specified destination register.
Destination=Source + Destination
(Source may be immediate data value or register or direct or indirect memory location where the data
is stored.)
• Values may be byte,word.
Flags affected: AF, CF, OF, PF, SF and ZF
Some examples are:
Instruction Description
ADD AL,45H Immediate addressing mode instruction that adds immediate number with
AL and stores result in AL(AL=AL+45)
ADD AX,BX Register addressing mode instruction that adds the contents of BX from
AX and stores result in AX
ADD AL,[1234,H] Direct addressing mode instruction that adds the 8bit contents of memory
location 1234H with AL and stores result in AL
ADD AL,[SI] Register indirect addressing mode instruction that adds the contents of
memory location printed by SI (Index register) with AL and stores result in
AL. assueme SI=5000H and content od SI=25H, then AL=AL+25H(which
is [SI]).
2. ADC destination,source
(ADD register/memory, register/memory/immediate data):
• This is an instruction used to perform multi-word addition of binary values
ADC adds the contetents of the carry Flag(CF 0/1) to operand1 and then adds operands2 to operand1,
like ADD instruction.
Destination=Source + Destination+CF
(Source may be immediate data value or register or direct or indirect memory location where the data
is stored.)
Flags affected: AF, CF, OF, PF, SF and ZF
Some examples are:
Instruction Description
ADC AX,4500H Immediate addressing mode instruction that adds immediate number with
4500H to AX with carry and stores result in AX(AX=AX+4500+CF(0/1))
ADC AX,BX Register addressing mode instruction that adds the contents of BX with
AX with carry flag (CF) and stores result in AX
Conclusion:
EXPERIMENT NO: 2
Conclusion:
EXPERIMENT NO: 3
Aim: Write an Assembly Language Program to find for Sorting in Ascending /Decending order
using Bubble Sort Algorithm.
Theory:
Instruction XCHG
• It exchanges data between two registers
i.e XCHG AH,BL
OR between a register and memory location
i.e XCHG CX,[SI]
• The first three are the foundations for faster and more efficient algorithms.
Selection sort algorithm:
• The list is divided into two sub lists,sorted and unsorted which are separated by an imaginary
wall.
• First go through the unsorted list and find the smallest/largest element.
• Then swap that element with the elememnt at the beginning of the unsorted ( or end of sorted
list) data.
• After each selection and swap the imaginary wall between the two sub lists moves one element
ahead.
Insertion Sort:
• It is a simple sorting algorithm that is appropriate for small inputs.
• Most common sorting technique used by card players.
• The list divided into two parts: sorted and unsorted.
• In each pass the first element of the unsorted part is picked up, transferred to the sorted sub list,
and inserted at the appropriate place.
• A list of n elements will take at most n-1 passes to sort the data.
• It is one of the most common sorting techniques, and it is often used by card players. Each card
player picks up is inserted into the proper place in their hand of cards to maintain a particular
sequence.
Bubble Sort:
• The list is divided into two sub lists: sorted and unsorted.
• The smallest element is bubbled form the unsorted list and moved to the sorted sub list.
• After that the wall moves one element ahead increasing the number of sorted elements and
decreasing the number of unsorted ones.
• Each time an element moves from the unsorted part to tge sorted part one sort pass is completed.
• Given a list of n elements bubble sort requires up to n-1 passes to sort the data.
ALGORITHM:
Program 1(A)
Algorithm to arrange numbers in an array of N numbers in Ascending order.
1.Initialize data segment, byte counter and memory pointer SI to read members from array.
2. Move number pointed by SI into accumulator and increment SI
3. Compare accumulator element with data element pointed by SI (next data element).
4. If accumulator data is greater, and carry flag=0 go to step 7.
5. Else exchange the two compared numbers and increment data pointer SI.
6. Decrement the comparision counter and go to step 2 until it becomes zero.
7. Decrement the iteration counter perform next iteration until it becomes zero.
8. Display the result, Sorted array.
9. End
Program 1(B)
Algorithm to arrange numbers in an array of N numbers in descending order.
1. Initialize data segment, byte counter and memory pointer SI to read members from array.
2. Move number pointed by SI into accumulator and increment SI
3. Compare accumulator element with data element pointed by SI (next data element).
4. If accumulator data is smaller, and carry flag=0 go to step 7.
5. Else exchange the two compared numbers and increment data pointer SI.
6. Decrement the comparison counter and go to step 2 until it becomes zero.
7. Decrement the iteration counter perform next iteration until it becomes zero.
8. Display the result, Sorted array.
9. End
EXPERIMENT NO: 4
Theory:
In computing, a device driver is a computer program that operates or controls a particular type of device
that is attached to a computer. A driver provides a software interface to hardware devices, enabling
operating systems and other computer programs to access hardware functions without needing to know
precise details about the hardware being used.
A driver communicates with the device through the computer bus or communications subsystem to which
the hardware connects. When a calling program invokes a routine in the driver, the driver issues
commands to the device. Once the device sends data back to the driver, the driver may invoke routines in
the original calling program. Drivers are hardware dependent and operating-system-specific. They usually
provide the interrupt handling required for any necessary asynchronous time-dependent hardware
interface.
The main purpose of device drivers is to provide abstraction by acting as a translator between a hardware
device and the applications or operating systems that use it. Programmers can write the higher-level
application code independently of whatever specific hardware the end-user is using.
Keyboard Drivers
Keyboard drivers are files and programs that allow the operating system to recognize and/or process the
input data sent by the keyboard and return commands from the computer. A keyboard is an input device
that provides data to the computer and its operating system. Even though a keyboard is an input device it
also receives commands from the computer (like turning on lights that mean different things). Keyboards
have their own processor, memory, and circuits that carry information to and from the keys to its on-
board processor. The keyboard keys are basically switches. The keyboard processor interprets the opening
or closing of a switch (key) and transfers that information into digital information (hexadecimal data) that
is used by the computer. Keyboard drivers tell computer’s keyboard controller chip how to handle and/or
interpret that data. One way keyboard drivers help handle the data is by setting the clock pulse of the
keyboard in synch with the computer operating system.
Printer Driver
A printer driver is simply a program that allows a computer to communicate with a printer and
send print requests to it. It has two main components or functions: the first is to serve as a bridge
between the computer and the printer, allowing the computer to understand the details and
hardware specifications of the printer, and the second is the ability to transform print job data
into a language that the printer can understand. Examples of languages or formats that printers
use are Postscript, originally used in the first Xerox laser printers, and XPS, developed by
Microsoft.
Each printer has a unique driver written for its profile for each operating system and must be
installed on the computer. If configured incorrectly or if the wrong driver is installed, a printer
will not even be detected properly by a computer.
Mouse Driver
A mouse driver is a device driver that enables a computer to communicate with a mouse. The
mouse driver is commonly included with the operating system. Today's operating systems no
longer require drivers for standard mouse interoperability. If your computer has a standard one or
two button mouse and you are using a current version of your operating system, you do not need
to install any special drivers to use your mouse.
Program 1
Initialize the stack memory. Accept the input from keyboard using interrupt 21h function. Check if
the input is ‘0’ (ASCII equivalent 30H).If ‘0’ is entered the program is terminated, otherwise the
input is accepted.
Algorithm
Program 2
Write a program to display character A-Z
DOS interrupt function 02 displays the content of DL(ASCII code) on the screen. By loading the
ASCII code of ‘A’ in the DL register, loading AH register with 02H and calling INT 21h it is
possible to display characters from A-Z on the screen.
In the main program by incrementing contents of AL, the ASCII odes of B to Z are displayed using
Macro.
Algorithm
1. Initialize macro for display.
2. Load AH=02h and call INT 21h
3. DL=character to be displayed.
4. End Macro.
5. Load AL=’A’, which is the first character to be displayed.
6. Load CL with count=26
7. Call macro to display characters.
8. Increment Al, to next character.
9. Decrement counter.
10.Check if count is zero, if not go to step 7
11. Stop.
Conclusion:
EXPERIMENT NO: 5
1. Write an assembly language program to move a block of N bytes of data from source to
destination and display the result.
2. Write assembly language program to calculate string length.
Theory:
Block Transfer
The block transfer instruction move multiword structures from a source address to a destination
address, or they com pare two multiword structures for equality. They include word block
transfers, word block comparisons, byte block transfer, bit block transfer and text block transfer.
The last two operations are designed specifically for manipulate rectangles and test on a bitmap
display.
Because of potentially long execution times, all of the block transfer instructions check for
pending interrupts. When a wakeup is detected, they save their indeterminate state on the stack
and back up the PC so that, when the instruction is restarted, it will continue transferring from
the point of interruption. The check for interrupts is made once per interaction of the main loop
the Interrupt Pending routing is defined in. The word block transfer instruction pop a count along
with (short or long) source and destination pointers from the stack. They move words from the
source to the destination. If the source and destination address are the same, there will still be a
transfer.
Block Transfer and Block Transfer Long move words from the source to the destination in the forward
direction (from low to high addresses). If the source and destination blocks overlap, and the destination
address is greater than the source address, words must be transferred on at a time from the source into the
overlap area.
String length
The length of a null-terminated string is defined as the number of characters it contains not counting the
null. To calculate length, start the count at zero. Then increment the count for each successive non-null
byte. When you hit the null, stop counting. The structured flow chart shows this procedure. It describes
the algorithm in general terms. Assembly language details are left to the coding stage. Here is an outline
of the program:
Program 1
Write an ALP to move a block of N bytes of data from source to destination and display the result.
Explanation:
• Consider that a block of data of N bytes is present at source location. Now this block of N bytes is
to be moved from source location to a destination location.
• Let the number of bytes N=10.
• We will have to initialize this as count in the CX register.
• We know that source address is in the SI register and destination address is in the DI register.
• Clear the direction flag.
• Using the string instruction move the data from source location to the destination location. It is
assumed that data is moved within the same segment. Hence the Ds and ES are initialized to the
same value.
• Display the contents using display routine.
Algorithm:
Step 1 : Initialize the data in the source memory and destination memory.
Step 7 : Check for count in CX, if not zero go to step 5 else go to step 8.
Step 8 : Stop
Conclusion:
EXPERIMENT NO: 6
Theory:
A binary-coded decimal (BCD) is a type of binary representation for decimal values where each
digit is represented by a fixed number of binary bits, usually between four and eight.
The norm is four bits, which effectively represent decimal values 0 to 9. This writing format
system is used because there is no limit to the size of a number. Four bits can simply be added as
another decimal digit, versus real binary representation, which is limited to the usual powers of
two, such as 16, 32 or 64 bits.
Binary-coded decimals are an easy way to represent decimal values, as each digit is represented
by its own 4-bit binary sequence which only has 10 different combinations. By comparison,
converting real binary representation to decimal requires arithmetic operations like multiplication
and addition. It is easier for conversion to decimal digits for display or printing, but the resulting
circuit required to implement this system is more complex. For example, the binary coded
decimal "1001 0101 0110," which has three groups of 4 bits, means there are three decimal
digits. In order, from left to right, the resulting decimal value is 956.
In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings
of decimal numbers where each decimal digit is represented by a fixed number of bits, usually
four or eight. Special bit patterns are sometimes used for a sign or for other indications.
HEX (Hexadecimal)
Hexadecimal describes a base-16 number system. That is, it describes a numbering system
containing 16 sequential numbers as base units (including 0) before adding a new position for the
next number. (Note that we're using "16" here as a decimal number to explain a number that
would be "10" in hexadecimal.) The hexadecimal numbers are 0-9 and then use the letters A-F.
We show the equivalence of binary, decimal, and hexadecimal numbers in the table below.
Program 1
We are given a five digit BCD number whose HEX equivalent is to be found i.e.65535 whose HEX
equivalent to be found. First we will find the HEX equivalent of 60,000.We will compare 60,000H with
10,000H.Each time we compare a counter is decremented by 10,000 and we add 10,000 decimal
(2710H).Then we will find the equivalent of 5000.Now we will compare 5000H with 1000H.Each time
we compare the counter decrements by 1000 and we add 1000 decimal (3E8 H).Then we will find the
equivalent of 500H by comparing it with 100H.Each time counter decrements by 100 and we add decimal
100(64H).Then we find equivalent of 30H by comparing it with 10H.Each time counter decrements by 10
and we add 10 decimal (0A H).Then equivalent of 5 is 5H.
Finally, all the equivalent obtained are added to get the equivalent of 65535.s
Algorithm:
Step III : Compare it with 0,if zero goto step VII else goto step IV.
Step VIII : Compare it with 1000,if below goto step XII else goto step IX.
Step XII : Compare number in AX now with 100H,if below goto step XVI, else goto step
XIII.
Step XVI : Compare number in AX with 10H, if below goto step XX, else goto step XVII.
Program 2
We have a 4digit Hex number whose equivalent binary number is to be found i.e. FFFFH initially we
compare FFFFH with decimal 10000(2710 H in Hex) if number is greater than 100000 we add it to DH
register also we subtract decimal from FFFFH is made . then we compare the number obtain in AX by
1000 decimal to BX. Then we compare the number obtain in AX by 199 decimal. Each time we subtract
100 decimal from AX and add 100 decimal to BX to obtain BCD equivalent then we compare the
number obtain in AX 10 decimal. Each time we subtract 10 decimal to AX and add 10 decimal to BX.
Finally we add the result in BX with reminder in AX . The final result is present in register DH (which
contains the 5th digit if present) and register AX.
ALGORITHM:
Step 4 : compare the number with 10000 decimal. If below go to step VII else go to step V.
Step 11 : Subtract 100 Decimal from AX and add 100 Decimal to BX.
Step 18 : Stop.
Conclusion:
EXPERIMENT NO: 7
Aim: Write an Assembly language program to display contents of 16 bit flag register.
Theory:
Flag register is a part of EU (Execution Unit). It is a 16 bit register with each bit corresponding to a flip-
flop.A flag is a flip-flop. It indicates some condition produced by the execution of an instruction. For
example the zero flag (ZF) will set if the result of execution of an instruction is zero.
Figure below shows the details of the 16 bit flag register of 8086 CPU.
It consists of 9 active flags out of 16. The remaining 7 flags marked ‘U’ are undefined flags.
• 6 Status flags
• 3 Control flags
Status flags:
1. Carry flag (CY)
• It is set whenever there is a carry or borrow out of the MSB (most significant bit) of a result. D7
bit for an 8 bit operation and D15 bit for a 16 bit operation.
• It is set if the MSB of the result is 1. For signed operations such a number is treated as negative.
6.Overflow flag (OF)
• It will be set if the result of a signed operation is too large to fit in the number of bits available to
represent it.
• It can be checked using the instruction INTO (Interrupt on Overflow).
Control flags:
• It is used to set the trace mode i.e. start single stepping mode.
• Here the microprocessor is interrupted after every instruction so that the program can be
debugged.
2. Interrupt enable flag (IF)
Program
Algorithm
1. Start
2. Initialize data segment through AX register in the DS register.
3. Display the flag bit names as “X X X X O D I T SF ZF x AF X PF X CF ”
4. Push the contents of flag register to a stack
5. Pop the contents of stack to register to any 16 bit register (say BX =0000 0100 1000 1001)
6. Move the contents of BX to temporary variable say t
7. Move the 8000h number to AX.(AX 8000h)
8. Move the count as 16(in decimal) to CX register (as 16 bit flag register)
9. Move the contents of temporary variable t to BX.
10. And the contents of BX and AX.
11. If zero flag is set then goto the step no 14 otherwise goto step no. 12
12. Move the 31h to DL register.
13. Make the unconditional jump to a step no. 15
14. Move the 30h to DL register.
15. Preserve the (8000h ) number from AX in t1 temporary variable. (As while displaying 30h or 31
h AH register get modified as 02h function is moved of INT 21h).
16. Display the contents of DL register.
17. Move the contents of t1 to AX register back (As while displaying 30h or 31 h AH register get
modified as 02h function is moved of INT 21h).
18. Rotate the contents of AX by 1 positions in right direction.
19. Repeat step no 5 to 17 till count CX reaches to 0.
20. Stop.
Conclusion:
EXPERIMENT NO: 8
Theory:
In computer architecture, 32-bit integers, memory addresses, or other data units are those that are
32 bits (4 octets) wide. Also, 32-bit CPU and ALU architectures are those that are based
on registers, address buses, or data buses of that size. 32-bit microcomputers are computers in which 32-
bit microprocessors are the norm. A 32-bit register can store 232 different values. The range
of integer values that can be stored in 32 bits depends on the integer representation used. With the two
most common representations, the range is 0 through 4,294,967,295 (232 − 1) for representation as an
(unsigned) binary number, and −2,147,483,648 (−231) through 2,147,483,647 (231 − 1) for representation
as two's complement. A 32-bit file format is a binary file format for which each elementary information is
defined on 32 bits (or 4 bytes). An example of such a format is the Enhanced Metafile Format.
Flag Register
The flag register is the status register in Intel x86 microprocessors that contains the current state of the
processor.
31 21 16 15 8 7 0
12-
I/O Privilege Level (IOPL) Privilege level needed to do I/O instructions.
13
17 Virtual 8086 Mode (VM) When set, CPU operates in pseudo-real mode.
18 Alignment Check (AC) If set and CR0[AM] = 1, alignment checks are made.
P (parity)
Parity is a logic 0 for odd parity and a logic 1 for even parity. Parity is a count of ones in
a number expressed as even or odd.
If a number contains zero one bits, it has even parity. The parity flag finds little application in
modern programming and was implemented in early Intel microprocessors for checking data in
data communications environments. Today parity checking is often accomplished by the data
communications equipment instead of the microprocessor.
A (auxiliary carry)
The auxiliary carry holds the carry (half-carry) after addition or the borrow after subtraction
between bits positions 3 and 4 of the result. This highly specialized flag bit is tested by the DAA
and DAS instructions to adjust the value of AL after a BCD addition or subtraction. Otherwise,
the A flag bit is not used by the microprocessor or any other instructions.
Z (zero)
The zero flag shows that the result of an arithmetic or logic operation is zero. If Z=1, the result is
zero; if Z= 0, the result is not zero.
S (sign)
The sign flag holds the arithmetic sign of the result after arithmetic or logic instruction
executes. If S=1, the sign bit (leftmost hit of a number) is set or negative; if S=0, the sign bit is
cleared or positive.
T (trap)
The trap flag enables trapping through an on-chip debugging feature. (A program is debugged to
find an error or bug.) If the T flag is enabled (1), the microprocessor interrupts the flow of the
program on conditions as indicated by the debug registers and control registers. lf the T flag is a
logic 0, the trapping (debugging) feature is disabled.
I (interrupt)
The interrupt flag controls the operation of the INTR (interrupt request) input pin. If I=1. the
INTR pin is enabled: if I= 0, the INTR pin is disabled. The state of the I flag bit is controlled by
the STI (set I flag) and CLI (clear I flag) instructions.
D (direction)
The direction flag selects either the increment or decrement mode for the Dl and/or SI registers
during string instructions. If D=1, the registers are automatically decremented:
if D=1, the registers are automatically incremented. The D flag is set with the STD (set
direction) and cleared with the CLD (clear direction) instructions.
0 (overflow)
Overflows occur when signed numbers are added or subtracted. An overflow indicates that
the result has exceeded the capacity of the machine. For unsigned operations, the overflow
flag is ignored.
NT (nested task)
The nested task flag indicates that the current task is nested within another task in
protected mode operation. This line is set when the task is nested by software.
RF (resume)
The resume flag is used with debugging to control the resumption of execution after the next
instruction.
VM (virtual mode)
The VM flag bit selects virtual mode operation in a protected mode system. A virtual mode
system allows multiple DOS memory partitions that are 1M byte in length to coexist in
the memory system. Essentially, this allows the system program to execute multiple DOS
programs.
AC (alignment check)
The alignment check flag bit activates if a word or double word is addressed on a non-word or
non-double word boundary. Only the 80486SX microprocessor contains the alignment check hit
that is primarily used by its companion numeric coprocessor, the 80487SX, for synchronization.
ID (identification)
The ID flag indicates that the Pentium—Pentium II microprocessors support the CPUID
instruction. The CPUID instruction provides the system with information about the Pentium
microprocessor, such as its version number and manufacturer.
Segment Registers
Additional registers, called segment registers, generate memory addresses when combined with
other registers in the microprocessor. There are either four or six segment registers in various
versions of the microprocessor. A segment register functions differently in the real mode when
compared to the protected mode operation of the microprocessor. Following is a list of each
segment register, along with its function in the system:
CS (code)
The code segment is a section of memory that holds the code (programs and procedures) used by
the microprocessor. The code segment register defines the starting address of the section
of memory holding code. In real mode operation, it defines the start of a 64K-byte section
of memory; in protected mode, it selects a descriptor that describes the starting address and
length of a section of memory holding code. The code segment is limited to 64K bytes in the
8088-80286, and 4G bytes in the 80386 and above when these microprocessors operate in the
protected mode.
DS (data)
The data segment is a section of memory that contains most data used by a program. Data are
accessed in the data segment by an offset address or the contents of other registers that hold the
offset address. As with the code segment and other segments, the length is limited to 64K bytes
in the 8086-80286, and 4G bytes in the 80386 and above.
ES (extra)
The extra segment is an additional data segment that is used by some of the string instructions to
hold destination data.
SS (stack)
The stack segment defines the area of memory used for the stack. The stack entry point is
determined by the stack segment and stack pointer registers. The BP register also addresses data
within the stack segment.
FS and GS
The FS and GS segments are supplemental segment registers available in the 80386, 80486,
Pentium. and Pentium Pro microprocessors to allow two additional memory segments for access
by programs.
Program
Program for 32bit architecture
In this program first we have to declare two 32 bit number. After reading these two number add lower 16
bits of both numbers. Add higher bits of both numbers with carry of previous sum. Later display sum with
carry.
Algorithm:
Step IV : Add higher 16 bits of both numbers with carry of previous sum.
Conclusion:
EXPERIMENT NO: 09
Theory:
The microcontroller architecture that utilizes small and highly optimized set of instructions is termed as the Reduced
Instruction Set Computer or simply called as RISC. It is also called as LOAD/STORE architecture.
In the late 1970s and early 1980s, RISC projects were primarily developed from Stanford, UC-Berkley and IBM.
The John Coke of IBM research team developed RISC by reducing the number of instructions required for
processing computations faster than the CISC. The RISC architecture is faster and the chips required for the
manufacture of RISC architecture is also less expensive compared to the CISC architecture.
• Because of the small set of instructions of RISC, high-level language compilers can produce more efficient
code.
• RISC allows freedom of using the space on microprocessors because of its simplicity.
• Instead of using Stack, many RISC processors use the registers for passing arguments and holding the local
variables.
• RISC functions uses only a few parameters, and the RISC processors cannot use the call instructions, and
therefore, use a fixed length instructions which are easy to pipeline.
• The speed of the operation can be maximized and the execution time can be minimized.
• Very less number of instruction formats (less than four), a few number of instructions (around 150) and a
few addressing modes (less than four) are needed.
Drawbacks of RISC processor architecture
• With the increase in length of the instructions, the complexity increases for the RISC processors to execute
due to its character cycle per instruction.
• The performance of the RISC processors depends mostly on the compiler or programmer as the knowledge
of the compiler plays a major role while converting the CISC code to a RISC code; hence, the quality of the
generated code depends on the compiler.
• While rescheduling the CISC code to a RISC code, termed as a code expansion, will increase the size. And,
the quality of this code expansion will again depend on the compiler, and also on the machine’s instruction
set.
• The first level cache of the RISC processors is also a disadvantage of the RISC, in which these processors
have large memory caches on the chip itself. For feeding the instructions, they require very fast memory
systems.
Conclusion:
EXPERIMENT NO: 10
Theory :
The main intend of the CISC processor architecture is to complete task by using less number of assembly lines. For
this purpose, the processor is built to execute a series of operations. Complex instruction is also termed as MULT,
which operates memory banks of a computer directly without making the compiler to perform storing and loading
functions.
• Each machine language instruction is grouped into a microcode instruction and executed accordingly, and
then are stored inbuilt in the memory of the main processor, termed as microcode implementation.
• As the microcode memory is faster than the main memory, the microcode instruction set can be
implemented without considerable speed reduction over hard wired implementation.
• Entire new instruction set can be handled by modifying the micro program design.
• CISC, the number of instructions required to implement a program can be reduced by building rich
instruction sets and can also be made to use slow main memory more efficiently.
• Because of the superset of instructions that consists of all earlier instructions, this makes micro coding
easy.
Drawbacks of CISC
• The amount of clock time taken by different instructions will be different – due to this – the performance of
the machine slows down.
• The instruction set complexity and the chip hardware increases as every new version of the processor
consists of a subset of earlier generations.
• Only 20% of the existing instructions are used in a typical programming event, even though there are many
specialized instructions in existence which are not even used frequently.
• The conditional codes are set by the CISC instructions as a side effect of each instruction which takes time
for this setting – and, as the subsequent instruction changes the condition code bits – so, the compiler has to
examine the condition code bits before this happens.
Conclusion: