Docsity

Instruction Types-Assembly Language Programming-Lab Slides, Slides of Assembly Language Programming

Toggle sidebar
bg1
Instruction Types
• Data Transfer Instructions
– operations that move data from one place to another
– These instructions don’t actually modify the data, they just copy it
to the destination
• Data Operation Instructions
– Unlike the data transfer instructions, the data operation instructions
do modify their data values
– They typically perform some operation using one or two data
values (operands) and store the result
• Program Control Instructions
– Jump or branch instructions used to go in another part of the
program; the jumps can be absolute (always taken) or conditional
(taken only if some condition is met)
– Specific instructions that can generate interrupts (software
interrupts)
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Instruction Types-Assembly Language Programming-Lab Slides and more Slides Assembly Language Programming in PDF only on Docsity!

Instruction Types

-^

Data Transfer Instructions– operations that move data from one place to another– These instructions don’t actually modify the data, they just copy it

to the destination

-^

Data Operation Instructions– Unlike the data transfer instructions, the data operation instructions

do modify their data values

  • They typically perform some operation using one or two data

values (operands) and store the result

-^

Program Control Instructions– Jump or branch instructions used to go in another part of the

program; the jumps can be absolute (always taken) or conditional(taken only if some condition is met)

  • Specific instructions that can generate interrupts (software

interrupts)

Instruction formats

  • An instruction is represented as a binary value with

specific format, called the

instruction code

  • It is made out of different groups of bits, with

different significations:–

Opcode

  • represents the operation to be performed (it is

the instruction identifier)

Operands

  • one, two represent the operands of the

operation to be performed

  • A microprocessor can have one format for all the

instructions or can have several different formats

  • An instruction is represented by a single instruction

code

Register Addressing

  • It transfers a copy of a byte or word from the source

register to the destination register.

  • Example:

• MOV AX,BX• MOV DX,AX

Immediate Addressing

  • It transfers a source immediate byte or word of data

in to the destination register.

  • Example:
    • MOV AX,1ah• MOV DX,22h

Register Indirect Addressing

  • Transfers a byte or word between a register & a

memory location addressed by an index or baseregister.

  • Example:

• MOV [AX],BX• MOV [AH],BL

Base-Plus-Index Addressing

  • Transfers a byte or word between a register and a

memory location addressed by a base register plusan index register.

  • Example:

• MOV [AX + DI],BX• MOV [DX + SI],CX

Base Relative-Plus-Index Addressing

  • Transfers a byte or word between a register and a

memory location addressed by a base and an indexregister plus a displacement.

  • Example:

• MOV ARRAY[BX+SI],DX• MOV CX,ARRAY2[AX+DI]

ADD Instruction

  • We have three forms of addition

• ADD

Addition

• ADC

Addition with Carry

• INC

Increment

  • Examples of ADD

• ADD AL,BL• ADD CX,DI• ADD EBP,EAX• ADD CL,44H• ADD [BX],AL• ADD CL,TEMP

ADD Instruction

• INC

  • This instruction add a 1 to a register or a memory

location except segment register.

  • Examples of INC

• INC BL• INC AX• INC SP• INC EAX• INC TEMP

SUB Instruction

  • We have three forms of subtrtaction

• SUB

Subtraction

• DEC

Decrement

• SBB

Subtract with Borrow

  • Examples of SUB

• SUB CL,BL• SUB AX,SP• SUB DH,6FH• SUB [DI],CH

SUB Instruction

• DEC

  • This instruction subtract a 1 from a register or a

memory location except segment register.

  • Examples of DEC

• DEC BH• DEC CX• DEC EDX• DEC TEMP