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

Back to Subject List

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


 
#59832 - RE: skip -vs- jump
Responding to: ???'s previous message
patrick de groote said:
if you combine [a conditional skip] with the GOTO instruction as instruction #2, you actually have a conditional branch instruction....


Hatem Zakaria said:
Except the code will be long.


Not necessarily!
Used effectively, the conditional-skip style of the 16F84 (and 75P008, and...) does not produce code that is inherently any larger or smaller than using the conditional-jump style of the 8051 et al

Consider the following:

By combining a Skip instruction and a Goto, you effectively have an if...then...else structure; to implement the same thing on an 8052, you would also have to combine a conditional jump and an unconditional jump.

All of the 8051 conditional jumps are at least 2 bytes - so that's at least 2 8051 instruction words per conditional branch;
All of the 16f84 instructions are 1 word, so you can always achieve a conditional jump in 2 16f84 instruction words.

Sometimes, just skipping an instruction will be exactly what you want to do - so a 16f84 single-word skip instruction will use less code than an 8051's conditional jump over an instruction.



Before I get my 8052.com registration revoked, please note that I am not trying to say that a 16F84 is better than an 8052.
I am just pointing out that the statement "the code will be long [because you have to use skips instead of conditional jumps]" is a complete non-sequitur

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