segmentation in context of 8086 microprocessor - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

segmentation in context of 8086 microprocessor

ManVickManVick Posts: 7Member


Heelo,

If nebody can help plss...


(a.) What is the segmentation in the context of 8086 microprocessor? How a 16 bit address is used to calculate the 20 bit memory address in this processor? Describe the instructions in 8086 microprocessor that can be used for BCD arithmetic, with the help of a suitable example.

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    :
    :
    : Heelo,
    :
    : If nebody can help plss...
    :
    :
    : (a.) What is the segmentation in the context of 8086 microprocessor? How a 16 bit address is used to calculate the 20 bit memory address in this processor?
    [blue]1Mb of accessible memory on 8086 is divided on paragraphs - every paragraph is 16 bytes long. The [b]only[/b] 16-bit of address cannot be used for a full address - and if someone tells you so - they are wrong! You need something else - and it is called [b]segment[/b] value. To make a full address CPU uses two values SEGMENT:OFFSET. Both of these values are held in 16-bit registers. The value of SEGMENT is an index of a paragraph (see below) where addressing begins. The OFFSET is a value to be added to the SEGMENT value (in bytes) to make a full physical address. With the single SEGMENT value only 64Kb can be accessed - to access more memory the SEGMENT have to be switched to another value. Here is an example to make it clearer:

    SEG:OFS = 5AC3:0209 (<- HEX values)

    The 5AC3 is an index of a paragraph, so to know the number of bytes we have to multiply it by 16 (paragraph room is 16 bytes) and to do that the SEG value must be shifted left 4 times:
    [code]
    5AC30 <- shifted left 4 bits
    + 0209
    -----
    5AE39 -> full physical address of a byte accessed with 5AC3:0209
    [/code]
    Usually to access data not exceeding 64Kb in room the only OFS value is manipulated, leaving SEG untouched. Only to access more than 64Kb you need to move SEG forward or backward, so the 64Kb window will cover the memory you need to access.[/blue]

    Describe the instructions in 8086 microprocessor that can be used for BCD arithmetic, with the help of a suitable example.
    :
    [blue]You need a manual for 80x86 CPU - I do not remember the exact specifications for BCD - I never deal with that kind of coding.[/blue]
  • BitdogBitdog Posts: 528Member
    [green]
    Asmguru62 perdy well got the addressing thing covered.
    I could add that 5 hex digits can hold a number large enough to
    address all the conventional memory like Asmguru62 said, and 5 digits is 20 bits.
    So the term "20 bit address" is just a TERM used to describe real mode addressing.

    BCD Binary Coded Decimal, if you have a hex ASCII printer it prints BCD numbers.
    Each hex nybble has a value of 0-15 &
    each BCD nybble has a value of 0-9
    So AL can hold a BCD value 0-99
    AAM & AAD are acouple of instructions to look up for BCD numbers.
    CMOS uses BCD numbers. Check port 70h & 71h info.
    Read some of the past posts here, Ralf Brown's int list links, etc.
    String search the posts for BCD, so gud folks here won't be retype the same message?

    Bitdog
    [/green]

Sign In or Register to comment.