- cio' off (x:xs) = (off,x):(cio' newoffset xs)
- where newoffset = off + (fromIntegral $ B.length $ encodeInstructions [x])
+ -- TODO(bernhard): add more instruction with offset (IF_ACMP, JSR, ...)
+ -- TODO(bernhard): beautiful code please (BCP)
+ cio' (off,_) (x@(IF _ w16):xs) = ((off, Just $ fromIntegral w16), x):(cio' (newoffset x off) xs)
+ cio' (off,_) (x@(IF_ICMP _ w16):xs) = ((off, Just $ fromIntegral w16), x):(cio' (newoffset x off) xs)
+ cio' (off,_) (x@(GOTO w16):xs) = ((off, Just $ fromIntegral w16), x):(cio' (newoffset x off) xs)
+ cio' (off,_) (x:xs) = ((off, Nothing), x):(cio' (newoffset x off) xs)