1 parent 57a70e1 commit 7dab1a5Copy full SHA for 7dab1a5
1 file changed
src/Z80/Assembler.hs
@@ -65,8 +65,9 @@ reserveLoc x st = st{ loc = loc st + x }
65
66
tellBytes :: [Word8] -> Z80ASM
67
tellBytes bytes = do
68
+ loc <- incrementLoc . fromIntegral $ length bytes
69
Z80 $ tell $ BS.pack bytes
- incrementLoc . fromIntegral $ length bytes
70
+ pure loc
71
-- The new location has to be computed lazily in the actual
72
-- content of the bytes, so that we can emit byte values
73
-- referring to later labels.
@@ -91,8 +92,9 @@ resb n = Z80 $ do
91
92
93
defByteString :: ByteString -> Z80ASM
94
defByteString bs = do
95
+ loc <- incrementLoc . fromIntegral $ BS.length bs
96
Z80 $ tell bs
- incrementLoc . fromIntegral $ BS.length bs
97
98
99
label :: Z80 Location
100
label = loc <$> Z80 get
0 commit comments