hello all
use PIC16f877a in this problem , the language is hi-tech , I did this problem in MPLAN and the simulation in proteus 8, why open two LED and next time two LED ,I write in programing 8 LEDs ,where the problem in program or in proteus?

please see my program same the question?
use PIC16f877a in this problem , the language is hi-tech , I did this problem in MPLAN and the simulation in proteus 8, why open two LED and next time two LED ,I write in programing 8 LEDs ,where the problem in program or in proteus?

please see my program same the question?
Code:
#include<htc.h>
__CONFIG (FOSC_HS & WDTE_OFF & PWRTE_ON & BOREN_OFF );
#define _XTAL_FREQ 20000000
#define sw1 RB0
void main(void)
{
unsigned char i;
unsigned char j;
TRISD=0b00000000;
PORTD=0b00000000;
TRISB0=1;
if (sw1=0){
while(1){
for(i=0 ;i<2 ;i++)
{
PORTD=0b11111111;
__delay_ms(250);
PORTD=0b00000000;
}
__delay_ms(250);
for(i=0 ;i<2 ;i++)
{
PORTD=0b11111111;
__delay_ms(250);
PORTD=0b00000000;
}
}
}
}