1
0
mirror of https://github.com/KarolS/millfork.git synced 2025-01-26 20:33:02 +00:00

8080: support raw bytes in assembly statements

This commit is contained in:
Karol Stasiak 2019-05-31 14:29:54 +02:00
parent 0f52efbe20
commit b4a6c261de

View File

@ -169,6 +169,15 @@ object Z80StatementCompiler extends AbstractStatementCompiler[ZLine] {
}
case ExpressionStatement(e) =>
Z80ExpressionCompiler.compile(ctx, e, ZExpressionTarget.NOTHING) -> Nil
case RawBytesStatement(contents) =>
env.extractArrayContents(contents).map { expr =>
env.eval(expr) match {
case Some(c) => ZLine(BYTE, NoRegisters, c, elidability = Elidability.Fixed)
case None =>
ctx.log.error("Non-constant raw byte", position = statement.position)
ZLine(BYTE, NoRegisters, Constant.Zero, elidability = Elidability.Fixed)
}
} -> Nil
case Z80AssemblyStatement(op, reg, offset, expression, elidability) =>
val param: Constant = expression match {
// TODO: hmmm