Thanks to the great insight provided by @wisnia20012 above (thx mate), I have the following findings:
- Sleeping by 'slp' (I think other blocking functions too) seems to hang the fcpu indefinitely
- Halting and resuming seems to work fine across surfaces
The key takeaway being to have the fcpu in the halted state during the switching of surfaces. Rig a timer with two decider combinators (as the one on display on the Factorio wiki) that outputs a 'Run' signal to the fcpu every 120 ticks or so.
After you give a 'Launch' signal to the console, halt in the next instruction. When in flight, set the Anchor signals only when you read the Distance signal to be smaller than 0, then halt in the next instruction. This way, it is as good as guaranteed that the fcpu will be in the halted state whilst switching between surfaces.
Example of a spaceship between Nauvis' Orbit and an oil planet's orbit:
; INPUT
; M1[1]: ANCHOR
; M1[2]: DISTANCE
; M1[3]: DESTINATION
; M1[4]: DENSITY OF ASTROIDS
; M1[5]: SPEED
; OUTPUT
; M2[1]: DESTINATION
; M2[2]: CLAMP SHIP
; M2[3]: CLAMP SHORE
; M2[4]: LAUNCH
JMP :START
; R1: RETURN ADDRESS
:BLK_BATTERY_CHARGED ; WAIT FOR BATTERIES TO BE CHARGED
CLR R2
FIG R2 [virtual-signal=signal-battery-percent]
TEQ R2 100
JMP R1
HLT
JMP :BLK_BATTERY_CHARGED
; R1: RETURN ADDRESS
; R2: DESTINATION
:SET_DESTINATION ; OUTPUT DESTINATION AND CLAMPS
MOV M2[1] R2
XMOV OUT1 M2
JMP R1 ; END OF SET_DESTINATION
; R1: RETURN ADDRESS
; R2: ANCHOR_SHIP
; R3: ANCHOR_SHORE
:SET_ANCHORS ; SET ANCHORS TO DOCK SHIP
MOV M2[2] R2 ; SET CLAMP ON SHIP
MOV M2[3] R3 ; SET CLAMP ON DESTINATION
XMOV OUT1 M2
JMP R1 ; END OF SET_ANCHORS
:START
HLT
CLR
; READ INPUTS
FIG R1 [virtual-signal=signal-A]
SST R1 [virtual-signal=signal-A]
MOV M1[1] R1 ; if A is not available, set A 0
FIG M1[2] [virtual-signal=signal-distance]
FIG M1[3] [virtual-signal=se-planet-orbit]
TNE M1[3] 0
JMP :FOUND_DESTINATION
FIG M1[3] [virtual-signal=se-moon]
TNE M1[3] 0
JMP :FOUND_DESTINATION
FIG M1[3] [virtual-signal=se-moon-orbit]
TNE M1[3] 0
JMP :FOUND_DESTINATION
FIG M1[3] [virtual-signal=se-planet]
TNE M1[3] 0
JMP :FOUND_DESTINATION
FIG M1[3] [virtual-signal=se-star]
TEQ M1[3] 0
HLT
:FOUND_DESTINATION
FIG M1[4] [virtual-signal=signal-D]
FIG M1[5] [virtual-signal=signal-speed]
TEQ M1[1] 45 ;
JMP :AT_NAUVIS_ORBIT
TEQ M1[1] 1232
JMP :AT_MANNANAN_ORBIT
JMP :IN_SPACE
:AT_NAUVIS_ORBIT ; AT NAUVIS ORBIT, LAUNCH TO MANNANAN
LEA R1 :FUEL_LOADING
MOV R2 1232[virtual-signal=se-moon-orbit]
JMP :SET_DESTINATION
:FUEL_LOADING ; WAIT FOR FUEL TO LOAD
HLT
FIR R1 [fluid=se-ion-stream]
TLE R1 50000
JMP :FUEL_LOADING
:OIL_UNLOADING ; WAIT FOR OIL TO UNLOAD
HLT
FIR R1 [fluid=crude-oil]
TGE R1 500
JMP :OIL_UNLOADING
LEA R1 :LAUNCH ; WAIT FOR BATTERIES TO BE CHARGED
JMP :BLK_BATTERY_CHARGED
:AT_MANNANAN_ORBIT ; AT MANNANAN, LAUNCH TO NAUVIS ORBIT
LEA R1 :OIL_LOADING
MOV R2 45[virtual-signal=se-planet-orbit] ; SET DESTINATION TO NAUVIS ORBIT
JMP :SET_DESTINATION
:OIL_LOADING ; WAIT FOR OIL TO LOAD
FIR R1 [fluid=crude-oil]
TLT R1 399000
JMP :OIL_LOADING
LEA R1 :LAUNCH ; WAIT FOR BATTERIES TO BE CHARGED
JMP :BLK_BATTERY_CHARGED
:LAUNCH ; SEND LAUNCH SIGNAL
MOV M2[4] 1[virtual-signal=se-spaceship-launch]
XMOV OUT1 M2
HLT
HLT
JMP :START
:IN_SPACE
LEA R1 :AUTOPILOT
MOV R2 M1[3] ; FROM INPUT
JMP :SET_DESTINATION
:AUTOPILOT
FIG R1 [virtual-signal=signal-distance]
BLT R1 0 :DOCK ; WHEN ARRIVED, DOCK
HLT
JMP :AUTOPILOT
:DOCK
LEA R1 :START
MOV R2 10[virtual-signal=se-anchor-using-left-clamp]
MOV R3 350[virtual-signal=se-anchor-to-right-clamp]
JMP :SET_ANCHORS
This seems to be working rock solid, so I wanted to share!