This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

challenging Questions...

here are few questions which are troubling me.. kindly help...

1) Why should we always start 8051 program with the following piece of code?
(starting code)
org 0h
ljmp 8000h
org 8000h

2) since the address location 0000h is eprom.. we cant save data on that address.. then where is the starting code(above said code) saved??

3)what happens if we remove starting code and end statement in the end of program??

4) why only direct addressing is alllowed for push and pop instruction....

waiting for answers....

Parents
  • "ORG 0 is ROM reset location"

    See Drew's post - it is not necessarily ROM!

    "In some simulators its not necessary to write org"

    It has nothing to do with simulators - it is an Assembler directive!

    "ljmp is to jump over the IVT"

    Not necessarily

    "For the control to go to 'main', we can write 'ljmp main' instead of mentioning the address where the program starts."

    Assuming that a valid definition of 'main' already exists, and is the address where the program starts.

    "In assembly program, there is no 'main' as such."

    This is meaningless - if you write your assembly program with a 'main', then it has a 'main'; if you don't, then it doesn't!

Reply
  • "ORG 0 is ROM reset location"

    See Drew's post - it is not necessarily ROM!

    "In some simulators its not necessary to write org"

    It has nothing to do with simulators - it is an Assembler directive!

    "ljmp is to jump over the IVT"

    Not necessarily

    "For the control to go to 'main', we can write 'ljmp main' instead of mentioning the address where the program starts."

    Assuming that a valid definition of 'main' already exists, and is the address where the program starts.

    "In assembly program, there is no 'main' as such."

    This is meaningless - if you write your assembly program with a 'main', then it has a 'main'; if you don't, then it doesn't!

Children