Output from PortB & PortD at the same time on Uno r3

noInterrupts();
PORTB = bval ;
PORTD = dval ;
interrupts();

bval and dval must be local / automatic uint8_t or byte variables.