Steve - as I understand it, the squawk is allocated by ATC on a per-flight (or even per ATC sector) basis, and is transmitted as part of the Mode-C.
Selcal (selective call) code is assigned pretty much permanently to an aircraft, and is used in voice communications to direct calls from ATC to that particular aircraft, allowing other pilots to not be woken up (sorry - interrupted) by calls that aren't meant for them.
Rod