ARCHITECTURE AND INSTRUCTIONS
They might also be used to slow down a portion of the program where precise timing relationships are important.
Placeholder
NIL is the only instruction mnemonic that does not cause the assembler to generate any instructions. In contrast to NOP, which causes the assembler to generate an instruc- tion that does nothing when executed, NIL doesn't even cause an instruction to be generated.
NIL serves as a convenient placeholder for labels in the
CYCLE: NIL
INC AX
Although this is equivalent to
CYCLE: INC AX
the NIL makes it much easier to insert instructions ahead of the INC instruction in the source program, if the need arises later.
INSTRUCTION PREFIXES
The 8088 instruction set permits instructions to start off with one or more prefix bytes. The three possible prefixes are:
1)
2)repeat
3)lock
LOCK |
|
REP | (repeat) |
REPE | (repeat while equal) |
REPNE | (repeat while not equal) |
REPZ | (repeat while zero) |
REPNZ | (repeat wh iIe |
Asample instruction statement using a prefix
is:
CYCLE: LOCK DEC COUNT
The
First, it selects a segment register that will make the instruction execute properly. The assembler selects the segment register based on information it received from previous ASSUME statements. However, we can force the assembler to select a particular segment register by including that register in the instruction as in:
MOV BX,ES:SUM
Secondly, the assembler determines if a
The 8088 processor provides various operand- addressing modes.
1) Immediate:
MOV AX,15;15 is an immediate operand
2)Register:
MOV AX,15 | ;AX is a register operand |
3)Direct:
SUM DB ?
MOV SUM,15 ;SUM is a direct memory operand
4) Indirect through base register:
MOV AX,(BX)
MOV AX,(BP)
5) Indirect through index register:
MOV AX,(SI)
MOV AX,(DI)