Thank you Hasula,
It is small and nice answer.
I will want your help....
Assembly_7segment_counter
Re: Assembly_7segment_counter
Thank you,
nice answer...
I want some small explanation about C bit of STATUS register.
Thank you
nice answer...
I can understand.Nothing problem.SemiconductorCat wrote: Is these things so hard to read and understand ?
I want some small explanation about C bit of STATUS register.
At what time will this bit become 0(clear)?give me a small example.SemiconductorCat wrote: C means carry bit, if your arithmetic instruction will carry [for a example add 0xFF to 1,
exampleThen carry bit will be one.Code: Select all
movlw 0xff addlw 0x01
Thank you
- SemiconductorCat
- Major
- Posts: 455
- Joined: Mon Aug 22, 2011 8:42 pm
- Location: currently in hyperspace
Re: Assembly_7segment_counter
>> At what time will this bit become 0(clear)?give me a small example.
If your addition or subtraction operation like ( ADDLW , SUBLW etc ...) will product a result don't produce a carry.
ex:
Where we load the register with 1 and , add with another 1.
To understand carry, you have to go back to and find out how a ripple adder works.
http://en.wikipedia.org/wiki/Adder_(electronics)
So when your arithmetic operation does not produce a carry out from the register , that bit will be cleared out.
Every arithmetic instruction will update those flags , Z , C and DC. So if you need to use these bits
you have to do it right just after that arithmetic instruction.
The status of those bits ,just after you turn on microcontroller is defined in the manual clearly.
It may be 1, 0, undefined or high Z status. (where high Z referred to high impedance state).
Bellow figure describes the different values of bits in registers , just after power on, reset and
wake from sleep.
Now you could learn to read the manual.
If your addition or subtraction operation like ( ADDLW , SUBLW etc ...) will product a result don't produce a carry.
ex:
Code: Select all
MOVLW 0x01
ADDLW 0x01
To understand carry, you have to go back to and find out how a ripple adder works.
http://en.wikipedia.org/wiki/Adder_(electronics)
So when your arithmetic operation does not produce a carry out from the register , that bit will be cleared out.
Every arithmetic instruction will update those flags , Z , C and DC. So if you need to use these bits
you have to do it right just after that arithmetic instruction.
The status of those bits ,just after you turn on microcontroller is defined in the manual clearly.
It may be 1, 0, undefined or high Z status. (where high Z referred to high impedance state).
Bellow figure describes the different values of bits in registers , just after power on, reset and
wake from sleep.
Now you could learn to read the manual.