Jumat, 03 Februari 2012

REGISTER

REGISTER DEFINITION:
assemly in programming language, we inevitably have to deal with what is called a register. then what is called a register to register?
register is a partial memory of the microprocessor the which can be accessed with a very high speed. In doing his job microprocessor registers are always used as the intermediary, so the register can be likened to the feet and hands microprocessor.



TYPE OF REGISTER:
Registers used by the microprocessor is divided into 5 sections with different duties as well, namely:
Segment Register.
  1. Registers are included in this group consists of registers CSDSES and SS are respectively the 16-bitregistersRegisters in this group are generally used to indicate the address of a segment.

  • Register CS (Code Segmentis used to indicate the place of the current segmentwhile the SS register(Stack Segment) shows the location of the segments used by the stackBoth of these registers should not be any change because it would cause chaos in your program later.
  • Register DS (Data Segmentis usually used to show where the segment where the data is stored in theprogramGenerally the contents of these registers do not need to be changed unless the resident program.
  • Register ES (Extra Segment), as the name suggests is a bonus registers that do not have a specific task.ES registers are usually used to indicate an address in memory, eg video memory address.
On the 80386 processor segment registers are 16-bit additionthe FS<Extra Segment> and GS<Extra Segment>.

     2. Pointer and Index Register.

Registers are included in this group are the registers SPBPSI and DI, each of which consists of 16 bits.Registers in this group are generally used as a pointer or a pointer to a location in memory.
Register SP (Stack Pointeris paired with SS segment register (SS: SPis used to mununjukkan address of the stackwhile the register BP (Base Pointerregister is paired with SS (SS: BP) recorded an address inmemory where data.
Register SI (Source Index) and register DI (Destination Index) is usually used in a string operation with directaccess to the address in memory indicated by the two registersOn the 80386 processor there is an additional 32-bit registersnamely ESPEBPESI and EDI.



     3. General Purpose Register.

Registers are included in this group are the registers AXBXCX and DX, each of which consists of 16 bits.16-bit registers of this group have a characteristicwhich can be separated into two parts where each partconsists of 8 bits.

                                         + A X +         + B X +      + C X +         + D X +

 +-+--+--+-+ +-+--+--+-+ +-+--+--+-+ +-+--+--+-+

| AH | AL | | BH | BL | | CH | CL | | DH | DL |

+---- +---- + +---- +---- + +-----+----+ +-----+-----+

Suffix H indicates High while the suffix L indicates Low.



In general the registers in this group can be used for various purposes, however some specific usage of each of these registers are:
Register AX, specifically used in arithmetic operations, especially in the operations division and subtraction.
Register BX, usually used to indicate an offset address of a segment.
Registers CX, used exclusively in the operation of looping where this register determines how many loops that will happen.
Registers DX , used to hold the rest of the division of 16 bits. On the 80386 processor there is an additional 32-bit registers, namely EAX, EBX, ECX and EDX

     4. Index Pointer  Register
Register IP paired with the CS (CS: IPindicates the address of the memory where the instruction(commandto be executed nextRegister IP is also a 16-bit registersOn the 80386 processor used EIPregister that are 32 bit registers.

    5. Flags Register.
This register indicates the condition of a state <yes or no>. Since each state can use 1 bit only, then the appropriate number of bitsFlags register is capable of recording up to 16 stateThe flag contained in themicroprocessor 8088 and above are:

  •  OF <OverFlow Flag>
    If there is overflow in arithmetic operations, bit it will be worth 1
  • SF <Sign Flag>
    If this bit is marked with numbers used to be worth 1
    • ZF <Zero Flag>
      If the results of operations produce zerothis bit will be worth 1
        • CF <Carry Flag>
          If there is a reduction borrow or carry on operations in the summationit would be worth a bit.
    •    0F    0E    0D    0C   0B   0A    09   08   07   06   05  04   03   02  01   00
      +-----+-----+------+------+----+-----+-----+-----+----+----+----+----+----+----+----+----+
      |        | NT |        |OPL|OF | DF | IF | TF | SF | ZF|      | AF|     |PF |      |CF |
      +-----+-----+------+------+----+-----+-----+-----+-----+---+----+----+----+----+----+----+
                                   arrangement of flag register 8088

    • PF <Parity Flag>.
      Used to indicate the parity number. This bit will be worth 1 if the resulting number is an even number.
      • DF <Direction Flag>
        Used in the operation of string to indicate the direction of the process.
      • IF <Interrupt Enable Flag>
        CPU will ignore interrupt to occur if the bit is 0.
    • TF <Trap Flag>
    • Used primarily for debugging, the operation step by step.
      • AF <Auxiliary Flag>
        Used by BCD operationssuch as the AAA commands.
    • NT <Nested Task>
      Used in the processor 80286 and 80 386 for keeping the interruptions that occur in a row
    • IOPL <I/O Protection level>
      • This flag consists of 2 bits and is used in the processor 80286 and 80386 for the protection mode.

        The composition of each flag in the flags register you can see in the image above. At 80 286 and 80 386processor and above, there are some additional flags register, namely:
        - PE <Protection Enable>
        Used to activate the protection mode. This flag will be worth 1 in protection mode and 0 in real mode.
        - MP <Monitor Coprosesor>
        Used with the TS flag to handle the WAIT instruction.
        - EM <Emulate Coprosesor>
        This flag is used to simulate 80 287 or 80 387 coprosesor.
        - TS <Task Switched>
        This flag is available in 80 286 above.
        - ET <Extension Type>
        This flag is used to determine the type coprosesor 80 287 or 80 387.
        - RF <Resume Flag>
        Register is only available on the 80386 processor and above.
        - VF <Virtual 8086 Mode>

        When the flag is equal to 1 at the time of the protection mode, the microprocessor will allow the exercise ofreal mode applications in protection mode. Register is only available on 80386 or more.


Tidak ada komentar:

Posting Komentar