SMx.x bits are available on the S7-200 platform only. For S5 and S7-300/400 CPUs you have access to Organisation blocks that process logic before the cyclic OB1.
Specifically, for the S5 program, look for OB21 and OB22
Whatever logic you program in these 2 blocks will be executed once, before cyclic logic is called in OB1: e.g. first scan.