OBJECTIVE : GLOW LEDS CONNECTED TO PORTB ONE AFTER ANOTHER IN A DEFINITE PATTERN.
PROBLEM: ASSEMBLY CODE IS FULL OF WARNINGS , IS IT NECESARY TO TELL THE ASSEMBLER THE ADDRESS OF PORTB ??
NOTE: WILL THE CODE CHANGE FOR PIC18F48 AND PIC16877A
SOURCE CODE :
MYREG EQU 0X08;
ORG 0;
CLRF TRISB; set port b as output port
START CLRF PORTB; port b = 0000000 so all leds are off
BSF PORTB,0; put on led connected to port rb0
CALL DELAY
CLRF PORTB; all leds are again off
BSF PORTB,1; put on led connected to port rb1
CALL DELAY
CLRF PORTB;
BSF PORTB,2;
CALL DELAY
CLRF PORTB;
BSF PORTB,3;
CALL DELAY
CLRF PORTB;
BSF PORTB,4;
CALL DELAY
CLRF PORTB;
BSF PORTB,5;
CALL DELAY
CLRF PORTB;
BSF PORTB,6;
CALL DELAY
CLRF PORTB;
BSF PORTB,7;
CALL DELAY
GOTO START;
;
DELAY MOVLW 0XFF; delay subroutine
MOVWF MYREG;
AGAIN NOP;
NOP
DECF MYREG ,F
BNZ AGAIN;
RETURN;
END;
Added after 43 seconds:
PLEASE LET ME KNOW WHICH TOOL SUITE I SHOULD SELECT IN MPLAB IDE PROJECT WIZARD TO ASSEMBLE THE CODE .