Instruction Set
Instruction Set
03/13/25 1
1 2 3 4 5 6
MOV, ADD, DAA, AND, SHL, JMP,
XCHG, ADC, DAS, OR, SHR, JA/JNBE,
PUSH, SUB, AAA, XOR, SAL, JAE/JNB/
POP,IN, SBB, AAS, NOT, SAR, JNC,
OUT, CMP, AAM, TEST ROL, JB/LANE/
CBW, MUL, AAD ROR, JC, JBE/
CWD IMUL, RCL, JNA,
DIV, RCR JCXZ,
IDIV, JE/JZ,
INC, JO, JG/JNLE,
DEC, JP/JPE,J JGE/JNL,
NEG S,LOOP, JL/JNGE,
LOOPE/L JLE/JNG,
OOPZ, JNE/JNZ,
LOOPNE/ JNO,
LOOPNZ, JNA/JPO,
CALL,RE JNS
T,INT,
03/13/25 IRET 2
Data Transfer
Instructions
03/13/25 3
Data Transfer instructions essentially
copy the data and do not affect any flags
(except of course the POPF instruction
which modifies all the flags as per the
stack top word)
03/13/25 4
MOV
Stands for move, it is actually copy, that is, when
data is moved from one register source to a
destination register, source is not destroyed,
there will be a copy of this data in the destination
register
03/13/25 5
XCHG
Exchange instruction exchanges data between
registers or between register and memory
03/13/25 6
PUSH
Push causes the data in the source register to
be copied on to the stack top
03/13/25 7
POP
Pop causes the stack top moved to (that is,
removed from the stack and loaded onto) the
destination register or memory specified by the
instruction
03/13/25 8
IN: Copy data from a port
IN accumulator, port
The IN instruction reads from an input port into
AL or AX (only these two registers), to be
specified in the instruction
03/13/25 9
Ex:
IN AL,0C8H;Input a byte from port address 0C8H to AL
IN AX,34H; Input a word from port address 034H to AX
03/13/25 10
OUT: output a byte or word
to a port
OUT port, accumulator
The OUT instruction outputs the data in register
AX or AL (only) to be specified in the instruction
to the output port indicated directly in the
instruction if the port address is 8 bits or less, or
in the register DX (for addresses 16 bits or less)
03/13/25 11
Examples:
out 16h, ax; write to output port at address 16h from reg. ax
out 23h, al; write to output port at address 23h from reg al
03/13/25 12
CBW (Convert byte to word)
The source register AL and the destination AX
are both implied and not specifically mentioned
in this instruction
03/13/25 13
If the number in AL is positive, AH will be loaded
with 00 hex, else AH will be loaded with FF hex
Example: cbw
03/13/25 14
CWD (Convert Word to
Double Word)
Convert word in reg. AX (implied and not stated
in the instruction) to double word in regs. DX:AX
(also implied and not stated)
Example: cwd
03/13/25 15
Among all the data transfer instructions
popf is the only instruction that affects and
modifies the flags
03/13/25 16
Which of the following is not a data
copy/transfer instruction?
a) MOV
b) PUSH
c) DAS
d) POP
03/13/25 17
Binary Arithmetic
Instructions
03/13/25 18
All binary arithmetic instructions update
the flag register based on the result of the
operation performed
03/13/25 19
ADD
Adds the first operand (destination operand) and
the second operand (source operand) and
stores the result in the destination operand
03/13/25 20
When an immediate value is used as an operand, it is
sign-extended to the length of the destination operand
format
The OF, SF, ZF, AF, PF, and CF flags are set according
to the result
The OF, SF, ZF, AF, PF, and CF flags are set
according to the result
03/13/25 22
Example…
data segment
a db 0ABh
b db 0A5h
c dw ?
data ends
code segment
assume cs:code, ds:data
start:
mov ax, data
mov ds, ax
mov al, a
add al, b
mov ah, 00h
adc ah, 00h
mov c, ax
mov ah, 4ch
int 21h
code ends
end start
03/13/25 23
SUB
Subtraction
The OF, SF, ZF, AF, PF, and CF flags are set
according to the result
03/13/25 24
SBB
Subtract with borrow
The OF, SF, ZF, AF, PF, and CF flags are set
according to the result
03/13/25 25
CMP
Compare two operands
03/13/25 26
When an immediate value is used as an operand, it is
sign extended to the length of the first operand
Operation:
The CF, OF, SF, ZF, AF, and PF flags are set
according to the result
03/13/25 27
Examples:
CMP BX, SI
03/13/25 28
MUL
03/13/25 29
The source operand is located in a general-
purpose register or a memory location
Operation:
IF byte operation
THEN
AX ← AL ∗ SRC
ELSE (* word operation *)
DX:AX ← AX ∗ SRC
03/13/25 30
Flags Affected
Examples:
MUL BX
MUL WORDPTR [BX + DI]48 H
MUL BYTEPTR [SI]
MUL CL
03/13/25 31
IMUL : multiply signed numbers
IMUL source
Integer (signed) multiply
03/13/25 32
Examples:
IMUL BH ;Signed byte in AL times signed byte
in BH ; result in AX
;69x14
;AL=01000101=45h=69 decimal
;BH=0000 1110=0Eh=14 decimal
IMUL BH;AX=03C6H=+966 decimal
; MSB=0,positive result magnitude in true form.
;-28x59
;AL=11100100=E4H=-1CH=-28 decimal
;BH=00111011=3BH=+59 decimal
IMUL BH;AX=F98CH=-1652 decimal
;MSB=1,negative result magnitude in 2’s complement form.
03/13/25 33
DATA SEGMENT
C DW ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV AL,1CH
NEG AL
MOV BL,3BH
IMUL BL
MOV C,AX
MOV AH,4CH
INT 21H
CODE ENDS
END START
03/13/25 34
DIV:
03/13/25 35
If the divisor specified in the instruction is a byte
register or byte memory, then the accumulator
will be the word register AX
03/13/25 36
In case of word division, if the divisor word is not
greater than the part of the dividend word in DX,
then the quotient obviously will not fit into the
register AX
03/13/25 37
Examples of DIV instruction:
DIV BX;
DIV WORDPTR [DI];
DIV CL;
DIV BYTEPTR [SI];
03/13/25 38
IDIV : devide by signed byte or
word
IDIV source
Integer divide, same as DIV but the data and the
results are considered as signed integers
03/13/25 39
Examples:
IDIV BH ;Signed word in AX/ signed byte in BH;
03/13/25 40
INC
Increment register or memory
03/13/25 41
This instruction allows a loop counter to be updated
without disturbing the CF flag
Operation:
DEST ← DEST + 1;
03/13/25 42
Multiplication and Division
Multiplication and Division
DEC
Similar to INC, this instruction does the
operation:
DEST ← DEST – 1;
03/13/25 45
NEG: Form 2’s complement
NEG destination
Replaces the value of operand (the destination
operand) with its two’s complement
03/13/25 46
Flags Affected
03/13/25 47
Decimal (BCD,
ASCII) Arithmetic
Instructions
03/13/25 48
DAA: Decimal adjust accumulator
(AL) after BCD addition
Adjusts the sum of two packed BCD values to
create a packed BCD result
03/13/25 49
The DAA instruction then adjusts the contents of
the AL register to contain the correct 2-digit,
packed BCD result
03/13/25 50
If the result in the upper nibble of AL is now
greater then 9 or if the carry flag was set by the
addition or correction, then DAA instruction will
add 60H to AL
03/13/25 51
Example 1:
; AL = 0101 1001 = 59 BCD
; BL = 0011 0101 = 35 BCD
ADD AL, BL ; AL = 1000 1110 = 8EH
DAA ; Add 0110 Because 1110 > 9
; AL = 1001 0100 = 94 BCD
03/13/25 52
Example 2:
; AL = 1000 1000 = 88 BCD
; BL = 0100 1001 = 49 BCD
ADD AL, BL ; AL = 1101 0001=D1h, AF = 1
DAA ; Add 0110 because AF=1
; AL = 1101 0111 = D7H
; 1101 > 9 so add 0110 0000
; AL = 0011 0111 = 37 BCD, CF
=1
03/13/25 53
Flags affected
03/13/25 54
DAS: Decimal adjust after BCD
subtraction
Adjusts the result of the subtraction of two packed
BCD values to create a packed BCD result
03/13/25 55
The DAS instruction then adjusts the contents of the
AL register to contain the correct 2-digit, packed
BCD result
03/13/25 56
Examples:
;AL=1000 0110=86BCD
; BH=0101 0111=57BCD
SUB AL,BH ;AL=0010 1111=2FH,CF=0
DAS ;Lower nibble of result is 1111,so DAS automatically subtracts
0000 0110 to give AL=0010 1001=29BCD
;AL=0100 1001=49BCD
;BH=0111 0010=72BCD
SUB AL,BH ;AL=1101 0111=D7H,CF=1
DAS ;Subtracts 0110 0000(-60H) bcoz 1101 in upper nibble >9
;AL=01110111=77BCD,CF=1
;CF=1 means borrow was needed
03/13/25 57
AAA: ASCII adjust AL after
addition
Adjusts the sum of two unpacked BCD values to
create an unpacked BCD result
03/13/25 59
The AAA instruction then adjusts the contents of the
AL register to contain the correct 1-digit unpacked
BCD result
03/13/25 61
IF ((AL AND 0FH) > 9) OR (AF = 1)
THEN
AL ← AL + 6;
AH ← AH + 1;
AF ← 1;
CF ← 1;
ELSE
AF ← 0;
CF ← 0;
AL ← AL AND 0FH;
03/13/25 62
AAS: ASCII adjust AL after
subtraction
Adjusts the result of the subtraction of two
unpacked BCD values to create a unpacked BCD
result
03/13/25 64
Example:
;assume BL=0011 1001=39h=ASCII 9
AL=0011 0101=35h=ASCII5
ASCII9-ASCII5
SUB AL,BL ; Result: AL=0000 0100=BCD 04 and CF=0
AAS ; result:AL=0000 0100= BCD 04 and CF=0;no borrow required
03/13/25 65
IF ((AL AND 0FH) > 9) OR (AF = 1)
THEN
AL ← AL – 6;
AH ← AH – 1;
AF ← 1;
CF ← 1;
ELSE
CF ← 0;
AF ← 0;
AL ← AL AND 0FH;
03/13/25 66
AAM: ASCII adjust AX after
multiply
Adjusts the result of the multiplication of two
unpacked BCD values to create a pair of
unpacked (base 10) BCD values
Example:
;AL=0000 0101=unpacked BCD 5
; BH=0000 1001=unpacked BCD 9
MUL BH ;AL x BH; result in AX
;AX=00000000 00101101=002DH
AAM ;AX=00000100 00000101=0405H
;which is unpacked BCD for 45
03/13/25 68
AAD: ASCII adjust AX before
division
AAD converts two unpacked BCD digits in AH and AL to
the equivalent binary number in AL
03/13/25 69
The AAD instruction sets the value in the AL register
to (AL + (10 * AH)), and then clears the AH register
to 00H
03/13/25 70
Example:
;AX =0607H unpacked BCD for 67 decimal
;CH=09H
AAD; result: AX=0043=43H=67 decimal
DIV CH; devide AX by unpacked BCD in CH
;quotient:AL=07 unpacked BCD
;remainder : AH=04 unpacked BCD
;flags undefined after DIV
03/13/25 71
Logical Instructions
03/13/25 72
AND
Performs a bitwise AND operation on the
destination (first) and source (second) operands
and stores the result in the destination operand
location
03/13/25 73
Each bit of the result is set to 1 if both
corresponding bits of the first and second
operands are 1; otherwise, it is set to 0
Operation:
DEST ← DEST AND SRC;
Flags Affected:
The OF and CF flags are cleared; the SF, ZF,
03/13/25 74
OR
Performs a bitwise inclusive OR operation
between the destination (first) and source
(second) operands and stores the result in the
destination operand location
03/13/25 75
Each bit of the result of the OR instruction is set
to 0 if both corresponding bits of the first and
second are 0; otherwise it is set to 1
Operation:
DEST ← DEST OR SRC;
Flags Affected:
The OF and CF flags are cleared; the SF, ZF,
03/13/25 76
XOR
Performs a bitwise exclusive OR (XOR)
operation on the destination (first) and source
(second) operands and stores the result in the
destination operand location.
XOR gives a true output when the number of
true inputs is odd.
The source operand can be an immediate, a
register, or a memory location;
The destination operand can be a register or a
memory location.
03/13/25 77
Each bit of the result is 1 if the corresponding
bits of the operands are different; each bit is 0 if
the corresponding bits are the same.
Operation:
DEST ← DEST XOR SRC;
Flags Affected:
The OF and CF flags are cleared; the SF, ZF,
03/13/25 78
NOT
Performs a bitwise NOT operation (each 1 is set
to 0, and each 0 is set to 1) or does 1’s
complementing on the destination operand and
stores the result in the destination operand
location
03/13/25 79
Operation:
DEST ← NOT DEST;
Flags Affected:
None
03/13/25 80
Logical Instructions
Mnemonic Meaning Format Operation Flags Affected
AND Logical AND AND D,S (S) · (D) → (D) OF, SF, ZF, PF, CF
AF undefined
OR Logical Inclusive OR OR D,S (S)+(D) → (D) OF, SF, ZF, PF, CF
AF undefined
XOR Logical Exclusive OR XOR D,S (S) + (D)→(D) OF, SF, ZF, PF, CF
_ AF undefined
NOT LOGICAL NOT NOT D None
(D) → (D)
Shift and Rotate
Instructions
03/13/25 84
Shift and rotate instructions shift the data by one
or more bits towards either left or right, straight
or in a circular fashion
03/13/25 85
Shift Instructions…
03/13/25 86
The logical shifts move a 0 into the
rightmost bit position for a logical left shift and
a 0 into the leftmost bit position for a logical
right shift
03/13/25 87
The arithmetic and logical right shifts are
different because the arithmetic right shift
copies the sign-bit through the number,
while the logical right shift copies a 0
through the number
03/13/25 88
Logical shifts multiply or divide unsigned
data, and arithmetic shifts multiply or divide
signed data
03/13/25 89
The logical shift instructions are SHL, SHR
03/13/25 90
SHL – Shift Operand Bits Left, Put Zero in
LSBs
03/13/25 91
As a bit is shifted out of the LSB position, a
zero is put in the LSB position
CF MSB LSB 0
03/13/25 92
If the desired number of shifts is 1, this can be
specified by putting a 1 in the count position of the
instruction
Example:
MOV CL, 05H
SHL AX, CL
03/13/25 93
SHL/SAL Instruction :
This instruction stands for Shift Logical/Arithmetic
Left.
The SHL/SAL instruction performs shifting of each
bit in the operand (register or memory location)
to the left side and fills the least significant bit
(LSB) with zero and obtain the result in the
destination operand.
The MSB is shifted into the carry flag (CF). The
operation of SHL/SAL instruction with 2 times shift
is shown below.
03/13/25 94
03/13/25 95
SAL (Shift Arithmetic Left)
Instruction,
03/13/25 96
As a bit is shifted out of the LSB position, a
zero is put in the LSB position
CF MSB LSB 0
03/13/25 97
If the desired number of shifts is 1, this can be
specified by putting a 1 in the count position of the
instruction
Example:
MOV CL, 05H
SAL AX, CL
03/13/25 98
SHR Instruction :
This instruction stands for shift Logical
Right.
The SHR instruction performs shifting of
each bit in the operand (register or
memory location) to the right side and fills
the most significant bit (MSB) with zero.
The LSB is shifted into the carry flag (CF).
The operation of SHR instruction with 2
times shift is shown below.
03/13/25 99
03/13/25 100
Here also the number of shifts of the bits is given
as the count in the instruction and all the flags
are affected according to the result.
If the shift count is one, then it is directly
mentioned in the instruction.
For shifting the bits, two or more than two times,
CL register must be used at the count position
which is loaded with shift count value as shown in
the below examples.
03/13/25 101
Example for SHR Instruction
Instruction Explanation
03/13/25 102
SHR – Shift Operand Bits Right, New MSB = 0
03/13/25 103
This instruction shifts each bit in the specified
destination some number of bit positions to
the right
03/13/25 104
0 MSB LSB CF
03/13/25 105
If the desired number of shifts is 1, this can be
specified by putting a 1 in the count position of
the instruction
Example:
MOV CL, 03H
SHR AL, CL
03/13/25 106
SAR Instruction
This instruction stands for Shift Arithmetic
Right.
It does the same operation as SHR except it
fills the bit portion shifted right from the MSB
with a copy of old MSB i.e., the SAR
instruction performs the right shift on each
bit and fills the MSB portion with the copy of
old MSB.
The operation of SAR instruction with 2 times
shift is shown below.
03/13/25 107
03/13/25 108
Similar to SHR, in SAR instruction, LSB
is shifted to carry flag (CF).
In the case of multiple shifts, the CF
contains the most recent shift bit and
all the flags are affected according to
the result.
03/13/25 109
Example for SAR Instruction
Instruction Explanation
; shift bits in CX 1-bit right
SAR CX, 1 ; puts copy of old MSB in MSB
and LSB in CF
; Right shift bits in AX for 5 times
(assume CL = 05H)
SAR AX, CL
; puts 5 old MSB in 5 MSB’s
portion
03/13/25 110
SAR
03/13/25 111
This Arithmetic shift right instruction copies
the sign bit through the number
03/13/25 112
If the desired number of shifts is 1, this can be
specified by putting a 1 in the count position of the
instruction
Example:
MOV CL, 03H
SAR AL, CL
03/13/25 113
ROL – Rotate All Bits of Operand Left, MSB
to LSB
ROL Destination, Count
This instruction rotates all the bits in a
specified word or byte to the left some number
of bit positions
03/13/25 114
If the desired number of shifts is 1, this can
be specified by putting a 1 in the count
position of the instruction
Example:
MOV CL, 03H
ROL AL, CL
03/13/25 115
ROR – Rotate All Bits of Operand Right,
LSB to MSB
ROR Destination, Count
This instruction rotates all the bits in a
specified word or byte to the right some
number of bit positions
CF MSB LSB
03/13/25 116
If the desired number of shifts is 1, this can be
specified by putting a 1 in the count position of the
instruction
Example:
MOV CL, 03H
ROR AL, CL
03/13/25 117
For the ROL and ROR instructions, the original
value of the CF flag is not a part of the result,
but the CF flag receives a copy of the bit that
was shifted from one end to the other
03/13/25 118
RCL (Rotate Left including
carry)
The RCL instruction shifts the CF flag into the
least-significant bit and shifts the most
significant bit into the CF flag
03/13/25 119
RCR (Rotate Right including
carry)
The RCR instruction shifts the CF flag into the
most-significant bit and shifts the least-
significant bit into the CF flag
03/13/25 120
03/13/25 122
Shift Instructions
Mnemonic Meaning Format Operation Flags Affected
SAL/SHL Shift arithmetic SAL/SHL D,Count Shift the (D) left by the CF,PF,SF,ZF
Left/shift number of bit positions AF undefined
Logical left equal to count and fill OF undefined if count ≠1
the vacated bits
positions on the right
with zeros
SHR Shift logical SHR D,Count Shift the (D) right by the CF,PF,SF,ZF
right number of bit positions AF undefined
equal to count and fill OF undefined if count ≠1
the vacated bits
positions on the left
with zeros
SAR Shift arithmetic SAR D,Count Shift the (D) right by the CF,PF,SF,ZF
right number of bit positions AF undefined
equal to count and fill OF undefined if count ≠1
the vacated bits
positions on the left
with the original most
significant bit
Rotate Instructions
Mnemonic Meaning Format Operation Flags Affected
ROL Rotate left ROL D,Count Rotate the (D) left by the CF
number of bit positions OF undefined if count ≠ 1
equal to Count. Each bit
shifted out from the left
most bit goes back into the
rightmost bit position.
ROR Rotate right ROR D,Count Rotate the (D) right by the CF
number of bit positions OF undefined if count ≠ 1
equal to Count. Each bit
shifted out from the
rightmost bit goes back into
the leftmost bit position.
RCL Rotate left RCL D,Count Same as ROL except carry CF
through is attached to (D) for OF undefined if count ≠ 1
carry rotation.
RCR Rotate right RCR D,Count Same as ROR except carry CF
through is attached to (D) for OF undefined if count ≠ 1
carry rotation.
Ex. What is the result of ROL BTRE PTR [SI], 1
if SI is pointing to a memory location that contains 41H? (82H)
Ex. What is the result of ROL BYTEPTR [SI], 1
if SI is pointing to a memory location that
contains 41H? (82H)
03/13/25 126
Control Transfer
Instructions
03/13/25 127
The intelligence in any program lies in the ability
of the program to follow different courses of
action based on intermediate results produced
during the working of the program; that way, the
program is enabled to perform data sensitive
tasks
03/13/25 128
JMP: Jump instruction
03/13/25 129
Near jump—A jump to an instruction within the
current code segment (the segment currently
pointed to by the CS register), sometimes referred
to as an intra segment jump
03/13/25 131
MNEMONIC CONDITION TESTED
03/13/25 134
LOOP Instruction
LOOP LABEL
03/13/25 135
LOOP instruction combines 2 operations in each
instruction
03/13/25 136
LOOP(jump to specified label if Loop Until CX=0
cx≠0 after auto decrement)
03/13/25 137
ALP to move data from one location to another rusing
LOOP instrcution
DATA SEGMENT
ARRAY1 DB 10H, 20H, 30H, 40H, 50H
LEN DB $-ARRAY1
ARRAY2 DB 5 DUP(?)
DATA ENDS
03/13/25 138
CALL
Call instruction is a returnable jump to the destination or
the target address provided in the instruction
03/13/25 139
When executing a near call, the processor
pushes the value of the IP register (which
contains the offset of the instruction following the
CALL instruction) onto the stack (for use later as
a return-instruction pointer)
03/13/25 140
When executing a far call, the processor pushes
the current value of both the CS and IP registers
onto the stack for use as a return-instruction
pointer
03/13/25 141
RET
The RET (return) instruction returns control back
from the procedure to the program that has
called the procedure
03/13/25 142
The address is usually placed on the stack by a
CALL instruction, and the return is made to the
instruction that follows the CALL instruction
03/13/25 143
INT –interrupt program
execution
INT type
These instructions are software interrupt procedure
calls
03/13/25 144
When an 8086 executes an INT instruction it will
03/13/25 145
Get a new value of IP from an absolute memory address
of 4 times the type specified in the instruction
Ex: for INT 8 instruction, a new IP will be read from
address 00020H.
03/13/25 146
IRET: Return from interrupt
The IRET instruction performs a far return to the
interrupted program or procedure
03/13/25 147
Which of the following instruction is not
valid?
a) MOV AX, BX
b) MOV DS, 5000H
c) MOV AX, 5000H
d) PUSH AX
03/13/25 148
Ans: B
Explanation: Both the source and destination
operands cannot be memory locations except
for string instructions.
03/13/25 149
The instruction that pushes the
contents of the specified
register/memory location on to the
stack is
a) PUSHF
b) POPF
c) PUSH
d) POP
03/13/25 150
Answer: c
Explanation: Since PUSH operation
transfers data to stack from a register
or memory location
03/13/25 151
The instructions that are used for
reading an input port and writing an
output port respectively are
a) MOV, XCHG
b) MOV, IN
c) IN, MOV
d) IN, OUT
03/13/25 152
Answer: d
Explanation: The address of the input/output port
may be specified directly or indirectly.
Example for input port: IN AX, DX; This instruction
reads data from a 16-bit port whose address is in
DX and stores it in AX
Example for output port: OUT 03H, AL; This sends
data available in AL to a port whose address is
03H.
03/13/25 153
The instruction that pushes the flag
register on to the stack is
a) PUSH
b) POP
c) PUSHF
d) POPF
03/13/25 154
Answer: c
Explanation: The instruction
PUSHF(push flags to stack) pushes the
flag register on to the stack.
03/13/25 155
The flag that acts as Borrow flag in the
instruction, SBB is
a) direction flag
b) carry flag
c) parity flag
d) trap flag
03/13/25 156
Answer: b
Explanation: If borrow exists in the
subtraction operation performed then
carry flag is set.
03/13/25 157
The instruction, CMP to compare source
and destination operands it performs
a) addition
b) subtraction
c) division
d) multiplication
03/13/25 158
Answer: b
Explanation: For comparison, the
instruction CMP subtracts source
operand from destination operand.
03/13/25 159
In the RCL instruction, the contents of the
destination operand undergo fu
nction as
a) carry flag is pushed into LSB & MSB is pushed
into the carry flag
b) carry flag is pushed into MSB & LSB is pushed
into the carry flag
c) auxiliary flag is pushed into LSB & MSB is
pushed into the carry flag
d) parity flag is pushed into MSB & LSB is pushed
into the carry flag
03/13/25 160
Answer: a
Explanation: In RCL(Rotate right
through carry), for each operation, the
carry flag is pushed into LSB and the
MSB of the operand is pushed into carry
flag.
03/13/25 161
The instructions that are used to call a
subroutine from the main program and return
to the main program after execution of called
function are
a) CALL, JMP
b) JMP, IRET
c) CALL, RET
d) JMP, RET
03/13/25 162
Answer: c
Explanation: At each CALL instruction,
the IP and CS of the next instruction are
pushed onto the stack, before the
control is transferred to the procedure.
At the end of the procedure, the RET
instruction must be executed to
retrieve the stored contents of IP & CS
registers from a stack.
03/13/25 163