Assembly on the Arduino: IO registers
The datasheets for the AVR microcontrollers are reasonably good to read. Just Google for the exact controller on your Arduino (eg. ATmege328) and find the "Complete" datasheet on the atmel.com website. Don't download the "Summary", it doesn't include a lot of information. Download the datasheet from atmel.com, that is the only location with the most recent documentation.

There are three registers used in basic IO (check the chapter called "I/O-Ports"):

Where n is a port identifier, a letter ranging from A, B, C, ... depending on the number of IO pins your controller has. Each bit in each register represents a single GPIO pin (yes, you need some basic knowledge on binary to fully understand this).


DDRn, Data Direction Register: This basically configures a pin for either input (0) or output (1). 
PORTn, Port n Data Register: When a pin is set as output, the related bit toggles the output pin high (1) or low (0). When configured as input, this enables a weak pull up resistor on the output pin.
PINn,  Port n Input Register: Use this register to read the current level on a pin that is configured as input.