View Single Post
Old 12 April 2009, 09:03   #58
Loedown
Precious & fragile things
 
Join Date: Feb 2009
Location: Victoria, Australia
Posts: 1,946
Greetings,
I find it both useful and terribly processor specific. Coding for PIC is good, you can define labels for loop points within Microchip's coder,

Code:
           start2          org 0005        
                           clrf    temp0
                           clrf    temp1
                           clrf    temp2
                           clrf    temp3
                           clrf    temp4
                           clrf    temp5
                           clrf    temp6
                           clrf    temp7
                           clrf    temp8
                           clrf    temp9
                           clrf    intcon        ;clears intcon register
                           movlw    b'00000001'
                           movwf    temp7        ;sets temp7 as high bit check
                           movlw    b'00000101'    ;sets timer 1, no prescale
                           movwf    t1con
                           clrw
Was just a chunk of code from the start of one of my projects, I used to love trying to predict the old BEQ and BNE values for branching on 6502, this is where labels really come in handy, so instead of;

Code:
LDA $08
LDX $08
SBC
BNE $03
JMP $FFD2
LDA $40

You can use;

       LDA $08
       LDX $08
       SBC
       BNE JUMP:
JUMP:  JMP $FFD2
       LDA $40
Paul
Loedown is offline  
 
Page generated in 0.04273 seconds with 11 queries