The crankshaft on a 4 cycle motor in never 180 degrees off between compression and exhaust when the numnber 1 piston is at TDC. There are 360 degrees of crankshaft rotation between TDC compression stroke (which is firing position) and TDC exhaust stroke. Because of this; the timing mark on the crankshaft pulley will be in exactly the same position at both TDC compression stroke and TDC exhaust stroke. So it isn't necessary to know that distinction when setting ignition timing. You can set it at either TDC point. But since the distributor or crank position sensor rotates at half crankshaft speed; that part can be 180 degrees off between TDCs; but the crankshaft cannot. And because of the play in the cam drive system; you cannot accurately static time the ignition on an engine with breakerless electronic ignition. It must be done with a strobe light while the engine is idling. It might require making new marks on the crank pulley, but there's no other accurate method.
If you for any other reason want to determine whether a particular cylinder is at TDC compression or TDC exhaust; it can be done by one of two different methods. The first, and simplest method is to start with crankshaft in a position where the piston in that cylinder is headed upward; cover the spark plug hole in that cylinder with a thumb, or insert a closely fitting length of rubber fuel line into the opening, and press a finger over the other end of the hose. Then tap the starter motor very briefly (or preferably push a manual transmission car slowly forward a foot or two in second or third gear). If you feel a blast of compression at your finger or the hose; the cylinder is on compression stroke. If there is no pressure in the cylinder while the piston comes up; it is on exhaust stroke. Just stop turning the crank before the piston reaches TDC, and you'll know what stroke it is on.
The other method of determining the difference between the two TDC positions is to set the piston in that cylinder at TDC, and look at the intake or exhaust camshaft lobe or the intake or exhaust valve spring for that particular cylinder. Be sure to first find out which direction that cam is turning. If the exhaust valve spring is about to become fully relaxed, while the intake valve spring begins to be compressed when the cam rotates any further; the cylinder is at TDC exhaust. If both valve springs are not moving, but the exhaust valve spring is the next spring to be compressed at that point; the cylinder is on compression stroke.