Arduino DUE direct port I/O operations

I have Atmel Studio and Visual Micro working perfectly together.
Could anybody help me set up the system so that I can manipulate I/O ports directly?
When I’m trying to do something like that, I’m getting an error of the type “PORTD in not declared in this scope”

PORTD &= B11110111;

for(i=0;i<N;i++){
PORTD |= B1000;
PORTD &= B11110111;
}

I just discovered that digitalWrite() instruction for Arduino takes 2.5 us. This is way too long for my application - I’m making a waveform generator, and resolution is very important. So this is the reason why I want to work with IO ports directly.
Please advise.
Thanks.

Did you try searching? This comes up regularly:

http://forum.arduino.cc/index.php?topic=260731.0