Saturday, November 20, 2010

washing Machine Architecture

TMA 1271: IntroducCute College Girl - Tabithation to Machine Architecture Lecture 15: Instruction Sets: addressing modes for 8086 instruction set What you are going to study?  To study the addressing modes for 8086 instruction set 2 2 Instruction Set (--- Intel 8086)  The instruction set defines the basic operations that the microprocessor can perform  There are a total of 117 basic instructions for the 8086  The wide range of operands and addressing modes permitted for use with these instructions further expands the instruction set into many more executable instruction  For e.g., the basic MOV instruction expands into 28 different machine level instructions 3 The MOV Instruction  The MOV instruction is one of the data transfer instructions  The format of this instruction is written in general as: MOV destination, source  Its operation is described as: [source]  [destination]  The instruction transfers a byte or a word of data from a source location to a destination location  These data locations can be internal registers of the 8088/8086 and storage locations in memory  The large choice of source and destination 4 results in many different move instructions The MOV Instruction (cont.)  Table below shows the valid source and destination variations Destination Source Memory Accumulator Register Register Memory Register Memory Seg-reg Seg-reg Reg16 Memory Accumulator Memory Register Memory Register Immediate Immediate Reg16 Mem16 Seg-reg Seg-reg 5 Addressing Modes (-- Intel 8086)  Addressing mode tells where and how to locate data to be accessed  In essence, they are different ways used to specify the operands  There are 7 addressing modes divided into 3 categories in 8086 : i. Register operand addressing  Register addressing mode ii. Immediate operand addressing  Immediate addressing mode iii. Memory operand addressing  Direct addressing mode  Register indirect addressing mode  Based addressing mode  Indexed addressing mode 6  Based-indexed addressing mode Register Operand Addressing   With the register addressing mode, the operand to be accessed is inside an internal register of the 8088/8086 Internal registers that can be used as source / destination: Register Accumulator Base Count Data Stack pointer Base pointer Source index Destination index Code segment Data segment Stack segment Extra segment Operand sizes Byte (Reg 8) AL, AH BL, BH CL, CH DL, DH Word (Reg 16) AX BX CX DX SP BP SI DI CS DS SS ES 7 Register Operand Addressing (cont.)  An example of instruction using this addressing mode is MOV AX, BX  This stands for “move the contents of BX (source operand) to AX (destination operand)”  E.g. What is the destination operand in the following instruction? How large is this operand? MOV CH, AH  The destination operand is register CH and it specifies an 8-bit operand AH CH 8 Immediate Operand Addressing  If an operand is part of an instruction instead of the contents of a register or memory location, it is called an immediate operand  This operand is accessed using the immediate addressing mode  The operand can either be an 8-bit or 16-bit data  Immediate operands normally represent constant data  This addressing mode can only be used to specify a source operand  Consider the instruction: MOV AL, 15H  In this instruction, the source operand is 15H, while the destination operand is register AL  Thus this instruction uses both the immediate and 9 Immediate Operand Addressing (cont.)  E.g. Write an instruction that will move the immediate value 1234H into the CX register  Solution: The instruction must use immediate addressing mode for the source operand and register addressing mode for the destination operand, i.e. MOV CX, 1234H 10 Memory Operand Addressing  In this categories, the operands are inside the memory  To access an operand in memory, 8086 must calculate the physical address (PA) of the memory location before it can read or write the operand  The physical address is computed from a segment based address (SBA) and an effective address (EA)  SBA identifies the starting location of the segment in memory, and EA represents the offset of the operand from the beginning of this segment Cute College Girl - ZanaCute College Girl - Summer

No comments:

Post a Comment