Content originally posted in LPCWare by IanB on Mon Apr 04 14:27:17 MST 2016
If you need to manipulate one bit at a time, you'll get the smallest code by using the PBYTE registers. There are 18 of them, one for each pin. Writing 0x01 to them sets the output high, writing zero sets it low. Reading gives 0x01 or 0 depending whether the pin is high or low.