Escolar Documentos
Profissional Documentos
Cultura Documentos
html
Help | Contact Us
Lecture-9
Previous Main menu Next
MOV MOV dest., src MOV CX, 023Bh Initialize CX with immediate
MOV AX, BX number
MOV AX, [SI][BX] Transfers the content of BX
MOV BX, array into AX
1 of 4 1/11/2018, 10:23 AM
care4you http://www.care4you.in/Tutorials/8086mp/l9-instruction-set.html
LEA LEA dest., LEA SI, ARRAY Load the 16 bit offset of array in
src LEA BX, reg. SI
MyName Loads 16 bit offset of MyName in
reg. SI
This instruction is equivalent to
the instruction:
MOV SI, offset ARRAY
or
MOV BX, offset MyName
e. LDS / LES: These two instructions are used to load the Data
Segment(DS) or the Extra Segment (ES) registers and the register
specified in the instruction from memory.
LDS LDS dest., LDS SI, ARRAY Loads DS and SI from locations
src starting from offset ARRAY:
© Care4you.in | All rights Reserved Home | About Us | Contribite | Feedback | Contact Us
ARRAY+1 and then loads DS
from offset ARRAY+2 and
2 of 4 1/11/2018, 10:23 AM
care4you http://www.care4you.in/Tutorials/8086mp/l9-instruction-set.html
3 of 4 1/11/2018, 10:23 AM
care4you http://www.care4you.in/Tutorials/8086mp/l9-instruction-set.html
Figure (a) shows the stack before any operation. Here SP contains FFFFH
which is the top of the stack. The first PUSH AX instruction decrements
the pointer by two, at SP-1 it copies the AH register(High Byte) and the SP
is further decremented by one, now SP is at SP-2, the low byte (AL
content) is copied at this address. Now top of stack is at SP-2 i.e. at
3FFFDH as shown in figure (b).
Similarly the second instruction PUSH CX, decrements the SP by 2, i.e. at
SP-1 (3FFFC) it copies the CH register and at SP-2 (3FFFB) copies the CL
register and now top of the stack is 3FFFBH.
The POP instruction first reads the word from the stack starting at top of
stack and the increments the SP by two. The instruction first fetches the
byte from top of stack(where SP is currently pointing) and sets SP to SP+1,
then fetches the second byte from this address and increments SP further
by 1. Thus net effect is POP fetches a word from top of stack and
increments the SP by 2.
b. LAHF: loads the AH register with the low byte of the Flag. The
instruction does not require any operand.
c. SAHF: Stores the AH register content to the low byte of the flag register.
As it copies into the low byte of flag register the five flags are affected.
d. PUSHF: This instruction copies the flag register to top of stack.
e. POPF: This instruction copies the top of flag into the flag register, thus
this instruction affects all the flags.
4 of 4 1/11/2018, 10:23 AM