0% found this document useful (0 votes)
193 views18 pages

Students Copy CTE 241 Intro To Microprocessor and Assembl 055542

Uploaded by

Otobong Okpon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
193 views18 pages

Students Copy CTE 241 Intro To Microprocessor and Assembl 055542

Uploaded by

Otobong Okpon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

CTE 241

INTRODUCTION TO MICROPROCESORS & ASSEMBLY


LANGUAGE
GENERAL OBJECTIVES:
On completion of this module, the student should be able to:
1. Understand the concepts of microprogramming and Microprocessors
2. Know the basic terms in assembly language.
3. Understand the different instruction formats.
4. Know the representative groups of instruction in the instruction set
5. Understand the process of running assembly language programs.

Engr. Otobong
Onwunali

CONCEPTS OF MICROPROGRAMMING AND


MICROPROCESSORS

MICROPROGRAMMING AND MICROPROCESSORS


MICROPROGRAMMING
Microprogramming is the process of writing microcode for a microprocessor.
Microcode is low-level code that defines how a microprocessor should function when it
executes machine-language instructions. Typically, one machine-language instruction
translates into several microcode instructions. On some computers, the microcode is
stored in ROM (read-only memory) and cannot be modified; on some larger
computers, it is stored in EPROM (Erasable Programmable Read-Only Memory) and
therefore can be replaced with newer versions.
To execute an instruction, there are two types of control units - Hardwired Control unit
and Micro-programmed control unit.
1. Hardwired control units are generally faster than microprogrammed designs. In
hardwired control, we saw how all the control signals required inside the CPU
can be generated using a state counter and a PLA circuit.

To
interpret
the

instructions & generate control signals for them, this control unit uses fixed logic
circuits. To generate signals, the fixed logic circuits use the contents of the
control step counter, Instruction Register (IR) & code flag, and some external
input signals such as interrupt signals. The figure below shows the architecture
view of the Hardwired control unit as follows.
The fixed logic circuit in the diagram is a combinational circuit made from
decoders & encoders. It generates the output based on the state of its input(s).
The decoder decodes the instruction loaded in IR (Instruction Register) &
generates the signal that serves as an input to the encoder. Also, external input
& conditional codes act as an input to the encoder. The encoder then
accordingly generates the control signals based on the inputs. After the
execution of each instruction, another signal: the end signal is generated which
resets the state of control step counter & makes it ready for the next instruction.
Advantages of Hardwired Control Unit:
Here, we will discuss the advantages of the Hardwired Control Unit as follows.
 Because of the use of combinational circuits to generate signals, Hardwired
Control Unit is fast.
 It depends on number of gates; how much delay can occur in generation of
control signals.
 It can be optimized to produce the fast mode of operation.
 Faster than micro- programmed control unit.
 It does not require control memory.
Disadvantages of Hardwired Control Unit:
Here, we will discuss the disadvantages of the Hardwired Control Unit as follows.
 The complexity of the design increases as we require more control signals to
be generated (need of more encoders & decoders)
 Modifications in the control signals are very difficult because it requires
rearranging of wires in the hardware circuit.
 Adding a new feature is difficult & complex.
 Difficult to test & correct mistakes in the original design.
 It is Expensive.

2. A Microprogrammed Control Unit is a relatively simple logic circuit that


is capable of:
(1) sequencing through microinstructions and
(2) generating control signals to execute each microinstruction.

Hardwired Control Unit Microprogrammed Control Unit

Microprogrammed control unit


Hardwired control unit generates the generates the control signals with
control signals needed for the processor the help of micro instructions stored
using logic circuits in control memory

Hardwired control unit is faster when


compared to microprogrammed control unit This is slower than the other as micro
as the required control signals are instructions are used for generating
generated with the help of hardwares signals here

Easy to modify as the modification


Difficult to modify as the control signals need to be done only at the
that need to be generated are hard wired instruction level

Less costlier than hardwired control


More costlier as everything has to be as only micro instructions are used
realized in terms of logic gates for generating control signals

It cannot handle complex instructions as


the circuit design for it becomes complex It can handle complex instructions

Only limited number of instructions are Control signals for many instructions
Hardwired Control Unit Microprogrammed Control Unit

used due to the hardware implementation can be generated

Used in computer that makes use of


Used in computer that makes use of Complex Instruction Set Computers
Reduced Instruction Set Computers (RISC) (CISC)

FUNCTIONS OF A MICROPROCESSOR IN A COMPUTER


A Microprocessor is an important part of a computer architecture without which you
will not be able to perform anything on your computer. It is a programmable device
that takes in input performs some arithmetic and logical operations over it and
produces the desired output.

Basics of Microprocessor
A Microprocessor takes a bunch of instructions in machine language and executes
them, telling the processor what it has to do. Microprocessor performs three basic
things while executing the instruction:
It performs some basic operations like addition, subtraction, multiplication, division,
and some logical operations using its Arithmetic and Logical Unit (ALU). New
Microprocessors also perform operations on floating-point numbers also.
1. Data in microprocessors can move from one location to another.
2. It has a Program Counter (PC) register that stores the address of the next
instruction based on the value of the PC, Microprocessor jumps from one location
to another and takes decisions.

Comparison between a Microprocessor and Hardwired System


MICROPROCESSOR HARDWIRED SYSTEM
A silicon chip representing a central A micro controller is a highly integrated
processing unit (CPU), which is capable chip that contains a CPU, scratch pad
of performing arithmetic as well as ram, special and general purpose
logical operation according to a pre register arrays on chip ROM/flash
defined set of instructions memory for program storage, timer and
interrupted and control units and
dedicated I/O ports.
It is a dependent unit. It requires the It is a self contain unit And it does not
combination of other chips like timers, require external interrupt controller,
program and data memory chips, timer, UART, etc. for its functioning.
interrupt controls, etc. for functioning
Most of the time general purpose in Mostly application oriented or domain
design and operation specific

Does not contain a built in I/o port Most of the processor contains multiple
functionally needs to be implemented build in I/o ports which can be operated
with the help external programmable as a single 8 or 16 or 32 bit port or as
peripheral inter phase chips like 8255. individual port pins.

Targeted for high end market where Targeted for embedded market where
performance is important. performance is not so critical ( at present
this demarcation is invalid).
Limited power saving options compare to Includes lot of power savings features
micro controllers

Block Diagram of a Microcomputer


A microprocessor consists of an ALU, control unit and register array.
Where ALU performs
arithmetic and logical
operations on the data
received from an input device
or memory. Control unit
controls the instructions and
flow of data within the
computer. And, register
array consists of registers
identified by letters like B, C,
D, E, H, L, and accumulator.

Features of Microprocessor
 Low Cost - Due to integrated circuit technology microprocessors are available
at very low cost. It will reduce the cost of a computer system.
 High Speed - Due to the technology involved in it, the microprocessor can work
at very high speed. It can execute millions of instructions per second.
 Small Size - A microprocessor is fabricated in a very less footprint due to very
large scale and ultra large scale integration technology. Because of this, the size
of the computer system is reduced.
 Versatile - The same chip can be used for several applications, therefore,
microprocessors are versatile.
 Low Power Consumption - Microprocessors are using metal oxide
semiconductor technology, which consumes less power.
 Less Heat Generation - Microprocessors uses semiconductor technology
which will not emit much heat as compared to vacuum tube devices.
 Reliable - Since microprocessors use semiconductor technology, therefore, the
failure rate is very less. Hence it is very reliable.
 Portable - Due to the small size and low power consumption microprocessors
are portable.

BASIC TERMS IN ASSEMBLY LANGUAGE


OPERATION CODE AND OPERAND
An opcode (operation code) is the portion of a machine language instruction that
specifies the operation to be performed. Their specification and format are laid out in
the instruction set architecture of the processor in question (which may be a general
CPU or a more specialized processing unit).
An operand is a quantity on which an operation is performed.

The instruction set is a collection of pre-defined machine codes, which the CPU is
designed to expect and be able to act upon when detected. Different processors have
different instruction sets, to allow for greater features, easier coding, and to cope with
changes in the actual architecture of the processor itself. Each machine code of an
instruction set consists of two separate fields: Opcode and Operand.
The exact format of the machine codes is CPU-dependent.

Opcodes are also given mnemonics (short names) so that they can be easily referred
to in code listings and similar documentation. For example, an instruction to store the
contents of the accumulator in a given memory address could be given the binary
opcode 000001, which may then be referred to using the mnemonic STA (short for
STore Accumulator).
The most common fields found in instruction format are: -
1. An operation code field that specified the operation to be performed
2. An address field that designates a memory address or a processor registers.
3. A mode field that specifies the way the operand or the effective address is
determined.

MACHINE INSTRUCTIONS
Machine Instructions are commands or programs written in machine code of a
machine (computer) that it can recognize and execute.
 A machine instruction consists of several bytes in memory that tells the
processor to perform one machine operation.
 The processor looks at machine instructions in main memory one after another,
and performs one machine operation for each machine instruction.
 The collection of machine instructions in main memory is called a machine
language program.
Machine code or machine language is a set of instructions executed directly by a
computer’s central processing unit (CPU). Each instruction performs a very specific
task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or
memory. Every program directly executed by a CPU is made up of a series of such
instructions.
The general format of a machine instruction is

[Label:] Mnemonic [Operand, Operand] [; Comments]

 Brackets indicate that a field is optional


 Label is an identifier that is assigned the address of the first byte of the
instruction in which it appears. It must be followed by “:”
 Inclusion of spaces is arbitrary, except that at least one space must be inserted;
no space would lead to an ambiguity.
 Comment field begins with a semicolon.

DIFFERENCE BETWEEN MACHINE LANGUAGE AND ASSEMBLY LANGUAGE

Machine language is the low-level programming language. Machine language can


only be represented by 0s and 1s.
Assembly language is the more than low level and less than high-level
language so it is intermediary language. Assembly languages use numbers,
symbols, and abbreviations instead of 0s and 1s. For example: For addition,
subtraction and multiplications it uses symbols likes ADD, SUB and MUL, etc.
Below is a table of differences between Machine Language and Assembly Language:

Machine Language Assembly Language

Assembly language is only understood


Machine language is only understood by by human beings not by the
the computers. computers.

In machine language, data only In assembly language, data can be


represented with the help of binary represented with the help of
format (0s and 1s), hexadecimal and mnemonics such as Mov, Add, Sub,
octadecimal. End etc.

Assembly language is easy to be


Machine language is very difficult to be understood by the human being as
understood by the human beings. compare to machine language.

Modifications and error fixing cannot be Modifications and error fixing can be
done in machine language. done in assembly language.

Machine language is very difficult to Easy to memorize the assembly


memorize so it is not possible to learn the language because some alphabets and
machine language. mnemonics are used.

Execution is fast in machine language


because all data is already present in Execution is slow as compared to
binary format. machine language.

There is no need of translator. The Assembler is used as translator to


machine-understandable form is the convert mnemonics into machine-
machine language. understandable form.
Machine Language Assembly Language

Machine language is hardware- Assembly language is the machine-


dependent. dependent and it is not portable.

INSTRUCTION FORMATS
Instruction includes a set of operation codes and operands that manage with the
operation codes. Instruction format supports the design of bits in an instruction. It
contains fields including opcode, operands, and addressing mode.
An instruction is a command to the microprocessor to perform a given task on a
specified data. Each instruction has two parts: one is task to be performed, called the
operation code (opcode), and the second is the data to be operated on, called the
operand. The operand (or data) can be specified in various ways.
The instruction length is generally preserved in multiples of the character length,
which is 8 bits. When the instruction length is permanent, several bits are assigned to
opcode, operands, and addressing modes.
The function of allocating bits in the instruction can be interpreted by considering the
following elements −
 Number of addressing modes
 Number of operands
 Number of CPU registers
 Number of register sets
 Number of address lines

TYPES AND FUNCTIONS OF REGISTERS


Computer Registers
Registers are a type of computer memory used to quickly accept, store, and transfer
data and instructions that are being used immediately by the CPU. The registers used
by the CPU are often termed as Processor registers.
A processor register may hold an instruction, a storage address, or any data (such as
bit sequence or individual characters).
In Computer Organisation, the register is utilized to acknowledge, store, move
information and directions that are being utilized quickly by the CPU.
The computer needs processor registers for manipulating data and a register for
holding a memory address. The register holding the memory location is used to
calculate the address of the next instruction after the execution of the current
instruction is completed.
Following is the list of some of the most common registers used in a basic computer:

Register Symbo Number of bits Function


l

Data register DR 16 Holds memory operand

Address register AR 12 Holds address for the memory

Accumulator AC 16 Processor register

Instruction register IR 16 Holds instruction code

Program counter PC 12 Holds address of the instruction

Temporary register TR 16 Holds temporary data

Input register INPR 8 Carries input character

Output register OUTR 8 Carries output character

These registers are utilized for playing out the different operations. When we perform
some operations, the CPU utilizes these registers to perform the operations. When we
provide input to the system for a certain operation, the provided information or the
input gets stored in the registers. Once the ALU arithmetic and logical unit process the
output, the processed data is again provided to us by the registers.
The sole reason for having a register is the quick recovery of information that the CPU
will later process. The CPU can use RAM over the hard disk to retrieve the memory,
which is comparatively a much faster option, but the speed retrieved from RAM is still
not enough. Therefore, we have Cache memory, which is faster than registers. These
registers work with CPU memory like catch and RAM to complete the task quickly.

Operation Performed by Registers


Following major operations performed by registers, such as:
 Fetch: The fetch operation is utilized for taking the directions by the client.
The instructions that are stored away into the main memory for later
processing are fetched by registers.
 Decode: This operation is utilized for deciphering the instructions implies the
instructions are decoded the CPU will discover which operation is to be
performed on the instructions.
 Execute: The CPU performs this operation. Also, results delivered by the CPU
are then stored in the memory, and after that, they are shown on the client
Screen.
ADDRESSING MODE
The addressing mode is the method to specify the operand of an instruction. The job
of a microprocessor is to execute a set of instructions stored in memory to perform a
specific task. Operations require the following:
1. The operator or opcode which determines what will be done
2. The operands which define the data to be used in the operation
In a microprocessor, the machine needs to be told how to get the operands to perform
the operation. The effective address is a term that describes the address of an
operand that is stored in memory. There are several methods to designate the
effective address of those operands or get them directly from the register. These
methods are known as addressing modes.
In this lesson, we're going to define several addressing modes that can be used to
indicate how to retrieve operands. We'll also illustrate examples of h ow each addressing
mode is used and point out some characteristics of these addressing modes.

Types of Addressing Modes


Types of Addressing Modes
1. Register Addressing Mode
2. Direct Addressing Mode
3. Immediate Addressing Mode
4. Register Indirect Addressing Mode
5. Index Addressing Mode
6. Auto Increment Mode
7. Auto Decrement Mode
8. Relative Addressing Mode

1. Register Addressing Mode: Every instruction includes operands; the operands


can be a memory location, a processor register or an I/O device. The instruction which
uses processor registers to represent operands is the instruction in register
addressing mode.

2. Direct Addressing Mode: The direct addressing mode is also known


as Absolute Addressing mode. Here, the instruction contains the address of
the location in memory where the value of the operand is stored.
Advantage: Direct addressing mode is the simplest of all addressing mode.
Disadvantage: Direct addressing mode provides a limited address space.
3. Immediate Addressing Mode: In immediate addressing mode, the value of
the operand is explicitly mentioned in the instruction. Here, effective address is not
required as the operand is explicitly defined in instruction.
Advantage: In the immediate addressing mode the memory reference is not required
as the value is explicitly present in the instruction
Disadvantage: The instruction format provides a limited size for the operand. So, the
immediate addressing mode has limited space for immediate value.

4. Register Indirect Addressing mode: A processor register is used to hold


the address of a memory location where the operand is placed. This addressing
mode allows executing the same set of instructions for the different memory location.
This can be done by incrementing the content of register thereby pointing the new
location each time.
In higher-level language, it is referred to as pointers. The indirect mode is denoted by
placing the register inside the parenthesis.
Advantage: In the register indirect addressing mode the same set of instructions can
be used multiple times.
Disadvantage: In the register indirect addressing mode the number of memory
reference is more.

5. Index Addressing Mode: Index addressing mode is helpful when the


instructions in the program are accessing the array or the large range of memory
addresses. In this mode, the effective address is generated by adding a constant
to the register’s content. The content of the register does not change.
Advantage: The index addressing mode provides flexibility to specify memory
locations.
Disadvantage: The index addressing mode is complex to implement.

6. Auto Increment Addressing Mode: In auto-increment addressing mode once


the content of the register is accessed by the instruction the register’s content
is incremented to refer the next operand.

7. Auto Decrement Addressing Mode: It is just opposite of auto-increment


mode. In auto decrement mode the content of the register is decremented
initially and then the decremented content of the register is used as effective
address.

8. Relative Addressing Mode: In the content above we have discussed the index
addressing mode. There we were adding a constant to the register content to refer
the next operand address. In some computer instead of a register, the program
counter is used.
Advantage: Relative addressing mode doesn’t require memory references.
Disadvantage: Relative addressing mode doesn’t have any disadvantage as such.

THE INSTRUCTION SET


An instruction is a set of codes that the computer processor can understand. The code
is usually in 1s and 0s, or machine language. It contains instructions or tasks that
control the movement of bits and bytes within the processor.
Instruction set
The instruction set, also called ISA (instruction set architecture), is part of a
computer that pertains to programming, which is more or less machine language. The
instruction set provides commands to the processor, to tell it what it needs to do. The
instruction set consists of addressing modes, instructions, native data types, registers,
memory architecture, interrupt, and exception handling, and external I/O.
Examples of instruction set
 ADD - Add two numbers together.
 COMPARE - Compare numbers.
 IN - Input information from a device, e.g., keyboard.
 JUMP - Jump to designated RAM address.
 JUMP IF - Conditional statement that jumps to a designated RAM address.
 LOAD - Load information from RAM to the CPU.
 OUT - Output information to device, e.g., monitor.
 STORE - Store information to RAM.

ARITHMETIC INSTRUCTIONS
ADD INSTRUCTION
Purpose: Addition of the operators.
Syntax: ADD destiny, source
It adds the two operators and stores the result on the destiny operator.

SUB INSTRUCTION
Purpose: Subtraction.
Syntax: SUB destiny, source
It subtracts the source operator from the destiny.
MUL INSTRUCTION
Purpose: Multiplication with sign.
Syntax: MUL source

DIV INSTRUCTION
Purpose: Division without sign.
Syntax: DIV source

LOGIC INSTRUCTIONS
They are used to perform logic operations on the operators. Those instructions are:
AND, NEG, NOT, OR, & XOR

AND INSTRUCTION
Purpose: It performs the conjunction of the operators’ bit by bit.
Syntax: AND destiny, source
With this instruction the "y" logic operation for both operators is carried out:
Source Destiny
Destiny
11 1
10 0
01 0
00 0
The result of this operation is stored on the destiny operator.
NEG INSTRUCTION
Purpose: It generates the complement to 2.
Syntax: NEG destiny
This instruction generates the complement to 2 of the destiny operators and stores it
on the same operator.

NOT INSTRUCTION
Purpose: It carries out the negation of the destiny operator bit by bit.
Syntax: NOT destiny
The result is stored on the same destiny operator.

OR INSTRUCTION
Purpose: Logic inclusive OR
Syntax: OR destiny, source
The OR instruction carries out, bit by bit, the logic inclusive disjunction of the two
operators:
Source- Destiny
Destiny

1-1 1
1-0 1
0-1 1
0-0 0

TEST INSTRUCTION
Purpose: It logically compares the operators
Syntax: TEST destiny, source
It performs a conjunction, bit by bit, of the operators, but differing from AND, this
instruction does not place the result on the destiny operator, it only has effect on the
state of the flags.

XOR INSTRUCTION
Purpose: OR exclusive
Syntax: XOR destiny, source Its function is to perform the logic exclusive disjunction
of the two operators’ bit by bit.
Source- Destiny
Destiny

1-0 0
0-0 1
1-1 0
0-1 1
Program control instructions

JUMP INSTRUCTIONS
They are used to transfer the flow of the process to the indicated operator. Some of
these instructions are:
JMP, JA (JNBE), JAE (JNBE), JB (JNAE), JBE (JNA), JE (JZ) and JNE (JNZ)

JMP INSTRUCTION
Purpose: Unconditional jump.
Syntax: JMP destiny
This instruction is used to deviate the flow of a program without taking into account
the actual conditions of the flags or of the data.

JA (JNBE) INSTRUCTION
Purpose: Conditional jump.
Syntax: JA Label

JAE (JNB) INSTRUCTION


Purpose: Conditional jump.
Syntax: JAE label

JB (JNAE) INSTRUCTION
Purpose: Conditional jump.
Syntax: JB label
It jumps if it is down, if it is not or if it is the equal. The jump is done if CF is activated.

JBE (JNA) INSTRUCTION


Purpose: Conditional jump.
Syntax: JBE label
It jumps if it is down, the equal, or if it is not. The jump is done if CF is activated or if
ZF is activated, that any of them be equal to 1.

JE (JZ) INSTRUCTION
Purpose: Conditional jump.
Syntax: JE label
It jumps if it is the equal or if it is zero. The jump is done if ZF is activated.

JNE (JNZ) INSTRUCTION


Purpose: Conditional jump.
Syntax: JNE label
It jumps if it is not equal or zero. The jump will be done if ZF is deactivated.

INSTRUCTIONS FOR CYCLES: LOOP


They transfer the process flow, conditionally or unconditionally, to a destiny, repeating
this action until the counter is zero. Some of these instructions are: LOOP, LOOPE &
LOOPNE.
LOOP INSTRUCTION
Purpose: To generate a cycle in the program.
Syntax: LOOP label

LOOPE INSTRUCTION
Purpose: To generate a cycle in the program considering the state of ZF.
Syntax: LOOPE label

LOOPNE INSTRUCTION
Purpose: To generate a cycle in the program, considering the state of ZF.
Syntax: LOOPNE label

COUNTING INSTRUCTIONS
They are used to decrease or increase the content of the counters. Those instructions
are: DEC & INC.
DEC INSTRUCTION
Purpose: To decrease the operator.
Syntax: DEC destiny
This operation subtracts 1 from the destiny operator and stores the new value in the
same operator.

INC INSTRUCTION
Purpose: To increase the operator.
Syntax: INC destiny the instruction adds 1 to the destiny operator and keeps the
result in the same destiny operator.

COMPARISON INSTRUCTIONS
They are used to compare operators, and they affect the content of the flags. This
instruction is like CMP instruction.
CMP INSTRUCTION
Purpose: To compare the operators.
Syntax: CMP destiny, source
This instruction subtracts the source operator from the destiny operator but without
this one storing the result of the operation, and it only affects the state of the flags.

FLAG INSTRUCTIONS
They directly affect the content of the flags. Those instructions are: CLC, CLD, CLI,
CMC, STC, STD ans STI.
CLC INSTRUCTION
Purpose: To clean the cartage flag.
Syntax: CLC
This instruction turns off the bit corresponding to the cartage flag, or in other words it
puts it on zero.

CLD INSTRUCTION
Purpose: To clean the address flag.
Syntax: CLD
This instruction turns off the corresponding bit to the address flag.

CLI INSTRUCTION
Purpose: To clean the interruption flag.
Syntax: CLI
This instruction turns off the interruptions flag, disabling this way those mask arable
interruptions. A mask arable interruption is that one whose functions are deactivated
when IF=0.

CMC INSTRUCTION
Purpose: To complement the cartage flag.
Syntax: CMC
This instruction complements the state of the CF flag, if CF = 0 the instructions equals
it to 1, and if the instruction is 1 it equals it to 0. We could say that it only "inverts"
the value of the flag.

STC INSTRUCTION
Purpose: To activate the cartage flag.
Syntax: STC
This instruction puts the CF flag in 1.

STD INSTRUCTION
Purpose: To activate the address flag.
Syntax: STD
The STD instruction puts the DF flag in 1.

STI INSTRUCTION
Purpose: To activate the interruption flag.
Syntax: STI
The instruction activates the IF flag, and this enables the mask arable external
interruptions (the ones which only function when IF = 1).

MOVS (MOVSB) (MOVSW) Instruction


Purpose: To move byte or word chains from the source, addressed by SI, to the
destiny addressed by DI.
Syntax: MOVS
This command does not need parameters since it takes as source address the content
of the SI register and as destination the content of DI. The following sequence of
instructions illustrates this:
MOV SI, OFFSET VAR1
MOV DI, OFFSET VAR2
MOVS
First, we initialize the values of SI and DI with the addresses of the VAR1 and VAR2
variables respectively, then after executing MOVS the content of VAR1 is copied onto
VAR2.
The MOVSB and MOVSW are used in the same way as MOVS, the first one moves one
byte and the second one moves a word.

You might also like