Presentation is loading. Please wait.

Presentation is loading. Please wait.

Addressing Modes MOV AX,BX Destination Source Data-Addressing Modes.

Similar presentations


Presentation on theme: "Addressing Modes MOV AX,BX Destination Source Data-Addressing Modes."— Presentation transcript:

1 Addressing Modes MOV AX,BX Destination Source Data-Addressing Modes.
Instruction is divided to two parts: Opcode ( operation code) tells the microprocessor which operation to perform. Operand, source and destination.

2 Register addressing. MOV BX,CX
Transfers a copy of a byte or word from the source register or contents of a memory location to the destination register or memory location. MOV CX,DX MOV ECX,EDX MOV ES,DS (segment to segment) MOV CS,AX (code segment) MOV BL,DX (mixed sizes) MOV BX,CX 11AC B1D6 76 12 34 FF 1234 EBX ECX

3 Immediate addressing. Transfers the source (immediate byte or word data), into the destination register or memory location. MOV AL,22H MOV EBX, H MOV EAX,1234H B1D6 76 FF EAX ECX

4 3. Direct addressing. Moves a byte or word between a memory location and a register. MOV CX,LIST MOV ESI,LIST Direct addressing (use AL, AX, and EAX), (three bytes long) MOV AX,NUMBER b. Displacement addressing ( almost any instruction in the instruction set), (four bytes long) MOV ES,DATA

5 MOV AL,DS:[123A] memory AL B4 123B B4 B4 EAX 123A B1D6 76 FF EBX 1239 ECX

6 4. Register indirect addressing.
Transfers a byte or word between a register and a memory location addressed by an index or base register. MOV AX,[BX] MOV AL,[ECX] in the and above, can address by any register (EAX,EBX,ECX,EDX,EBP,EDI, or ESI).

7 5. Base-plus-index addressing.
Transfers a byte or word between a register and the memory location addressed by a base register (BP or BX) plus an index register (DI or SI). MOV [BX+DI],CL MOV [EAX+EBX],CL in the and above, any two registers (EAX,EBX,ECX,EDX,EBP,EDI, or ESI). 6. Register relative addressing. Moves a byte or word between a register and the memory location addressed by an index or base register plus a displacement. MOV AX,[BX+4] MOV AX,ARRAY[BX] MOV AX,[ECX+4] in and above, use any 32-bit register except ESP. MOV AX,ARRAY[EBX]

8 7. Base relative – plus – index addressing.
Transfers a byte or word between a register and memory location addressed by a base and an index register plus a displacement. MOV AX,[BX+DI+4] MOV AX,ARRAY[BX+DI] MOV EAX,ARRAY[EBX+ECX] 8. Scaled-index addressing. Available only in the and above. The second register of a pair of registers is modified by the scale factor of 2x, 4x, or 8x to generate the operand memory address. MOV EDX,[EAX+4*EBX] Allows to access to word (2x), doubleword ( 4x), or quadword (8x) memory array data. MOV AL,[2*EBX]

9 PROGRAM MEMORY-ADDRESSING MODES
Direct Program Memory Addressing. JMP [10000H] Opcode Offset(low) Offset(high) Segment(low) Segment(high) EA 00 00 00 10 Relative Program Memory Addressing. JMP [2] EB 10004 JMP [2]

10 3. Indirect Program Memory addressing.
JMP AX JMP [BX] STACK MEMORY-ADDRESSING MODES. PUSH BX H-byte sp-1, L-byte sp-2 POP AX H-byte sp+1, L-byte sp


Download ppt "Addressing Modes MOV AX,BX Destination Source Data-Addressing Modes."

Similar presentations


Ads by Google