sim: add runtime check if r0 is zero