ARCHITECTURE AND INSTRUCTIONS
6)Indirect through base register plus index register:
MOV AX,(BX) (SI)
MOV AX,(BX) (01)
MOV AX,(BP) (SI)
MOV AX,(BP) (01)
7)Indirect through base or index register plus offset:
1000UP(?)
Mav AX,MAN'LBYTES(BX)
MaV AX,MANY_BYTES(BP)
MaV AX,MANY_BYTES(SI)
MaV AX,MANY_BYTES(OI)
8)Indirect through base register plus index register plus offset:
1000UP(?)
Mav AX,MANY_BYTES(BX) (SI)
MaV AX,MANY_BYTES(BX) (01)
MaV AX,MANY_BYTES(BP) (SI)
MaV AX,MANY_BYTES(BP) (01)
The assembler uses its knowledge about a memory location's type when generating instructions that reference that memory location. For example, the assembler gen- erates a
assembler to know the type of the memory location, as illustrated by:
MOV AL,(BX)
Even though the assembler does not know the type of the source operand in the above instruction, it does know that the type of the destination operand, AL, is BYTE. So the assembler assumes that (BX) is also of type BYTE and generates a
But now consider the statement:
INC (BX)
There is no second memory location here to help the assembler determine the type of (BX). So the assembler cannot decide whether to generate a
INC BYTE PTR (BX) ;a
or
INC WORD PTR (BX) ;a
STRING INSTRUCTIONS
The assembler can usually discern the type of an operand from its declaration, and hence know what kind of code to generate for accessing that operand.
However, we have just seen that, when using an
String Primitives
SUM OB | ? | ;type is BYTE |
INC SUM ;a byte increment
However, with indirect
String instructions also need such additional information. Consider the string instruction MOVS.
This instruction moves the con4:nts of the memory address whose offset is in SI into the memory address whose offset is in DI. We should not need to specify any operands, since the instruction has no choice as to which items to move and where.