example problems from the Mazidi's textbook

Discussion in 'Embedded Systems and Microcontrollers' started by PG1995, Apr 21, 2012.

  1. PG1995

    Thread Starter Active Member

    Apr 15, 2011
    753
    5
    Hi

    Please have a look on the attachment and kindly help me with the queries. Thank you.

    Regards
    PG
     
  2. PG1995

    Thread Starter Active Member

    Apr 15, 2011
    753
    5
    Hi :)

    Thanks for giving it a look. But I have solved it. I will continue this thread with related problems.

    Regards
    PG
     
  3. PG1995

    Thread Starter Active Member

    Apr 15, 2011
    753
    5
    Hi

    Please have a look on the attachment and kindly help me. Thank you.

    Regards
    PG
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,435
    3,360
    I am not familiar with the 8051 instruction set.
    But maybe here is the answer.
    There are three types of addressing for CALL and JMP:

    Short - 1 byte address (relative) -128 +127 addressing range
    Absolute - 1 byte address -> 11-bit address
    Long - 2 byte address - > 16-bit address


    So your question is answered in the AJMP instruction.
     
    PG1995 likes this.
  5. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Some bits of the instruction are used for the instruction itself, eg ACALL is the first 5 bits of the first byte, which leaves 3 free bits to use with the second byte for the address.
    <ed> Not quite read your question properly, I don't know why SCALL doesn't use the extra bits </ed>.
     
  6. PG1995

    Thread Starter Active Member

    Apr 15, 2011
    753
    5
    Thank you, MrChips, Markd77.

    I understand it now.

    Regards
    PG
     
Loading...