Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/02/03 10:18
Read: times


 
#59767 - RE: RISC
Responding to: ???'s previous message
Hatem Zakaria wrote:
-------------------------------

If the condition is satisfied, then the next instruc-tion is discarded and a NOP is exe-cuted
instead,not like 8051 conditional jump at some different lolcation.



Actually the manual says:

DECFSZ Decrement f, Skip if 0

The contents of register ’f’ are
decremented. 
If the result is 1, the next instruction
is executed. If the result is 0,
then a NOP is executed instead,
making it a 2TCY instruction.


This means that if your skip instruction is instruction #1 then
1) Decrement f
2) if result is one, increment program counter and continue program execution (executing instruction #2)
3) if result is zero, increment program counter but execute a NOP instruction (thus effectively bypassing instruction #2) and continue program execution with instruction #3.

So if you combine this with the GOTO instruction as instruction #2, you actually have a conditional branch instruction....

Well that's how I read the document...

rgds
Patrick

List of 37 messages in thread
TopicAuthorDate
6 Decimal Digits Counter            01/01/70 00:00      
   RE: 6 Decimal Digits Counter            01/01/70 00:00      
   RE: 6 Decimal Digits Counter            01/01/70 00:00      
      RE: 6 Decimal Digits Counter            01/01/70 00:00      
         RE: 6 Decimal Digits Counter            01/01/70 00:00      
            RE: 6 Decimal Digits Counter            01/01/70 00:00      
               RE: 6 Decimal Digits Counter            01/01/70 00:00      
               RE: Explanation - Hatem            01/01/70 00:00      
                  RE: Explanation - Hatem            01/01/70 00:00      
            RE: 6 Decimal Digits Counter            01/01/70 00:00      
   RE: PIC16F84            01/01/70 00:00      
      RE: PIC16F84            01/01/70 00:00      
         RE: PIC16F84            01/01/70 00:00      
      RE: PIC16F84            01/01/70 00:00      
   RE: 6 Decimal Digits Counter            01/01/70 00:00      
      RE: 6 Decimal Digits Counter            01/01/70 00:00      
   RE: 6 Decimal Digits Counter            01/01/70 00:00      
      ...and all in just a dozen instructions!            01/01/70 00:00      
      RE: 6 Decimal Digits Counter            01/01/70 00:00      
   Who needs 8 bits, anyhow?            01/01/70 00:00      
   RE: 6 Decimal Digits Counter            01/01/70 00:00      
      RE: Conditional Jump            01/01/70 00:00      
      RE: RISC            01/01/70 00:00      
         RE: RISC            01/01/70 00:00      
            RE: RISC            01/01/70 00:00      
               RE: RISC            01/01/70 00:00      
                  RE: RISC            01/01/70 00:00      
                  RE: RISC            01/01/70 00:00      
                  RE: skip -vs- jump            01/01/70 00:00      
               RE: Skip            01/01/70 00:00      
            RE: RISC            01/01/70 00:00      
      RE: 6 Decimal Digits Counter            01/01/70 00:00      
   RE: 6 Decimal Digits Counter            01/01/70 00:00      
      RE: 6 Decimal Digits Counter            01/01/70 00:00      
         RE: 6 Decimal Digits Counter            01/01/70 00:00      
            RE: 6 Decimal Digits Counter            01/01/70 00:00      
               RE: 6 Decimal Digits Counter            01/01/70 00:00      

Back to Subject List