Hi Aladin
A little tutorial.
Your initial question was about toggling individual pins, but the second example solution provided by Andrej toggled all 8 bits at the same time. In this case it is the most elegant and fastest solution, but doesn't work if, say, you were only using 6 of the 8 port pins, because you would reset the other 2 pins that might be used for something else.
AVRCo Pascal a very rich and powerful language and there are solutions to most problems. Here is a solution based on your original code that will work on a smaller number of pins.
Code
DDRD := 255;
for x:=0 to 7 do
incl( PortD,x ); // or, more slowly SetBit( PortD, x, 1 );
MDelay(100);
//Incl( DDRD,x );
excl( PortD, x); // or more slowly (SetBit( PortD, x, 0 );
MDelay(100);
endfor;
Some other things that might interest you - it is possible to give your port pins names, and so make your code more readble. Also, as well as using 1 and 0 you can treat them as boolean and use TRUE and FALSE. So, for example, you could do this
Code
var
LED1 [@PortD, 0 ] : bit;
begin
incl( DDRD, 0);
LED1 := TRUE;
loop
mdelay(100);
LED1 := not LED1; // blink
end_loop;
end;
Enjoy!
Merlin.