Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Z80/Assembler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ class Bytes a where
instance Bytes ByteString where
defb = defByteString
instance (b ~ Word8) => Bytes [b] where
defb = defByteString . BS.pack
defb bs = Z80 $ do
tell $ BS.pack bs
modify (incrementLoc . fromIntegral $ length bs)
-- The new location has to be computed lazily in the actual
-- content of the bytes, so that we can emit byte values
-- referring to later labels.

db :: Bytes a => a -> Z80ASM
db = defb
Expand Down