Lecture 10
Lecture 10
Prefix - repeat prefixes (REP, REPE, REPNE), segment override (CS, SS, DS, ES),
operand-size or address-size override.
Opcode - in this field the type of instruction and its operands are coded.
SIB - Scale, Index, Base: used in 32-bit mode with instruction requiring addressing with
scaled registers, e.g. [EBX*4].
Immediate value - immediate scalar 1, 2 or 4 byte long value used as an operand for
instruction.
26h – ES,
8Bh – instruction opcode
mov r16, r/m16
mov r32, r/m32
87h – Mod R/M field:
r16=ax
m16=bx+16-bit displacement
0010h – displacement*
Instruction pipeline was introduced in Intel family starting from I8088 and I8086
microprocessors. This approach can significantly accelerate the process of program
execution. However some gaps in pipeline may occur as result of jump/call instructions
and inter-instruction dependences.
- unconditional jump (JUMP), procedure calling instruction (CALL), return from procedure
(RET);
- stack operations (PUSH, POP, PUSHF, POPF, PUSHA, POPA);
IFE Course In Computer Architecture Slide 9
Architecture and components of Computer System
Example:
a) decrement CX by 1;
b) if CX is not equal to zero jump to label. In case of LOOPE and LOOPNE instructions
there is also proper condition checked: ZF=1 for LOOPE and ZF=0 for LOOPNE. If that
additional condition is not fulfilled then proceed to next program instruction regardless to
CX value.
- string operations:
a) check whether CX is equal to zero, if so stop iterations and proceed to next program
instruction;
b) execute string instruction;
c) decrement CX by 1;
d) in case of REPE and REPNE prefixes test ZF flag. If proper condition is fulfilled: ZF=1
for REPE and ZF=0 for REPNE than jump to a). For REP prefix jump to a) unconditionally.
a) send byte (B), word (W, 16-bits) or double word (D, 32-bits) from localization ES:SI to
address DS:DI;
b) If DF=0 then: SI=SI+1{2, 4}, DI=DI+1{2, 4}. Otherwise: SI=SI-1{2, 4}, DI=DI-1{2, 4}.
Sample code:
Sample code:
Sample code:
Sample code: