Query
Sun Mar 29 2009, 09:58 pm
Hello
Hope everyone is ok.
I have a program in assembly and i will need to add comments to it, i have left coment line by line but i dono wat does te over all section does.
I'd appriciate if some1 could help plz.
thnx
Hope everyone is ok.
I have a program in assembly and i will need to add comments to it, i have left coment line by line but i dono wat does te over all section does.
I'd appriciate if some1 could help plz.
thnx
Mon Mar 30 2009, 05:10 am
The 8051 has several key characteristics.
Firstly,
After a reset signal, the microcontroller will start executing instructions from address 0000h - this notation is referred to as hexidecimal.
Your first statement is: ORG 0000h, which can be thought of as ORIGIN. You are telling the linker that the next line of code should be located at address 0000h, and this is often referred to as the "power on vector location"
so, what is the first instruction? It is SJMP OVER
SJMP is referred to as a "short jump", and you are telling the microcontroller to jump to the label "OVER". Now your example code above doesn't have this label shown, but it would occur somewhere later and look like this
OVER:
Hopefully this explains the first two lines of code...
Secondly, the 8051 has 5 standard interrupt vectors, and they are as follows:
Basically, this means that whenever an interrupt occurs, depending on which one it is, the microcontroller will start executing instructions from a specific address. Take for example, if the interrupt source is IE0. The microcontroller will "jump" to address 0003h and start executing the instructions there...
If you look at your source code, you can see that the instruction that will be executed at address 0003h is RETI.
Why? because you have the ORG 0003h instruction to the linker, which tells it that the next instruction is suppose to be located at address 0003h, and what is the next instruction? RETI
In fact, you have the same instruction for all of the 5 interrupt vector addresses, which simply means that if ever you get an interrupt, you will just return to whatever you were doing prior to the interrupt, essentially ignoring it...
If you'd like to learn more about the fundimentals of the 8051 microcontroller, I suggest you do some reading.
Here are some links to start with...
http://www.nxp.com/acrobat_download/various/80C51_FAM_HARDWARE_1.pdf
http://www.nxp.com/acrobat_download/various/80C51_FAM_ARCH_1.pdf
http://www.nxp.com/acrobat_download/various/80C51_FAM_PROG_GUIDE_1.pdf
I hope this helps,
Firstly,
After a reset signal, the microcontroller will start executing instructions from address 0000h - this notation is referred to as hexidecimal.
Your first statement is: ORG 0000h, which can be thought of as ORIGIN. You are telling the linker that the next line of code should be located at address 0000h, and this is often referred to as the "power on vector location"
so, what is the first instruction? It is SJMP OVER
SJMP is referred to as a "short jump", and you are telling the microcontroller to jump to the label "OVER". Now your example code above doesn't have this label shown, but it would occur somewhere later and look like this
OVER:
Hopefully this explains the first two lines of code...
Secondly, the 8051 has 5 standard interrupt vectors, and they are as follows:
Source Vector Address
IE0 0003H
TF0 000BH
IE1 0013H
TF1 001BH
RI+TI 0023H
Basically, this means that whenever an interrupt occurs, depending on which one it is, the microcontroller will start executing instructions from a specific address. Take for example, if the interrupt source is IE0. The microcontroller will "jump" to address 0003h and start executing the instructions there...
If you look at your source code, you can see that the instruction that will be executed at address 0003h is RETI.
Why? because you have the ORG 0003h instruction to the linker, which tells it that the next instruction is suppose to be located at address 0003h, and what is the next instruction? RETI
In fact, you have the same instruction for all of the 5 interrupt vector addresses, which simply means that if ever you get an interrupt, you will just return to whatever you were doing prior to the interrupt, essentially ignoring it...
If you'd like to learn more about the fundimentals of the 8051 microcontroller, I suggest you do some reading.
Here are some links to start with...
http://www.nxp.com/acrobat_download/various/80C51_FAM_HARDWARE_1.pdf
http://www.nxp.com/acrobat_download/various/80C51_FAM_ARCH_1.pdf
http://www.nxp.com/acrobat_download/various/80C51_FAM_PROG_GUIDE_1.pdf
I hope this helps,
Persian like this.
Tue Mar 31 2009, 01:23 am
Ok I have looked it up and it says:
Clear bit
Complement bit
So does this mean that it is trying to clear the 00h bit in the Data RAM ?
Clear bit
Complement bit
So does this mean that it is trying to clear the 00h bit in the Data RAM ?
Tue Mar 31 2009, 01:23 am
it means you haven't read the links I gave you, otherwise you would know...
In order to learn, one must be willing. In order to understand, one must study...
Try reading the last link from my previous post. If you don't understand what you have read, perhaps I can help you with that...
In order to learn, one must be willing. In order to understand, one must study...
Try reading the last link from my previous post. If you don't understand what you have read, perhaps I can help you with that...
Persian like this.
Powered by e107 Forum System