Hufl,
Squawks are issued on a regional basis. Certain routes attract certain squawks. I think there's an ORCAM (Originator Region Code Allocation Something or Other) in the AIP somewhere
www.ais.org.uk Page ENR 1-6-2-4 to be exact
If you are coming through Swanwick's airspace, you may get a squawk change due to an AU message (your A/C doesn't enter via the expected entry fix). When the AU is given a proper route NAS will automatically issue another code from London FIR's batch.
Also, if you change to another unit (Swanwick Mil, for instance), the unit handing over will change the squawk before handing you over.
In answer to your 12 hour statement. If you fly across the Atlantic. The squawk issued over there is transmitted via the ATC network with the estimates for various FIRs
Hope this helps.
Regards
CF