mirror of
https://github.com/irmen/prog8.git
synced 2025-01-16 00:31:26 +00:00
fix if-gosub
This commit is contained in:
parent
1c7c4fc3b0
commit
79405f47f6
@ -1098,8 +1098,9 @@ class AsmGen(private val program: Program,
|
|||||||
val booleanCondition = stmt.condition as BinaryExpression
|
val booleanCondition = stmt.condition as BinaryExpression
|
||||||
|
|
||||||
if (stmt.elsepart.isEmpty()) {
|
if (stmt.elsepart.isEmpty()) {
|
||||||
if(stmt.truepart.statements.singleOrNull() is Jump) {
|
val jump = stmt.truepart.statements.singleOrNull()
|
||||||
translateCompareAndJumpIfTrue(booleanCondition, stmt.truepart.statements[0] as Jump)
|
if(jump is Jump && !jump.isGosub) {
|
||||||
|
translateCompareAndJumpIfTrue(booleanCondition, jump)
|
||||||
} else {
|
} else {
|
||||||
val endLabel = makeLabel("if_end")
|
val endLabel = makeLabel("if_end")
|
||||||
translateCompareAndJumpIfFalse(booleanCondition, endLabel)
|
translateCompareAndJumpIfFalse(booleanCondition, endLabel)
|
||||||
@ -1612,6 +1613,8 @@ $label nop""")
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun translateCompareAndJumpIfTrue(expr: BinaryExpression, jump: Jump) {
|
private fun translateCompareAndJumpIfTrue(expr: BinaryExpression, jump: Jump) {
|
||||||
|
require(!jump.isGosub)
|
||||||
|
|
||||||
if(expr.operator !in ComparisonOperators)
|
if(expr.operator !in ComparisonOperators)
|
||||||
throw AssemblyError("must be comparison expression")
|
throw AssemblyError("must be comparison expression")
|
||||||
|
|
||||||
|
@ -3,10 +3,8 @@ TODO
|
|||||||
|
|
||||||
For next compiler release (7.6)
|
For next compiler release (7.6)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
fix imageviewer pcx decoding, broken since if/goto changes...
|
fix imageviewer crashes...
|
||||||
also wormfood: worm freezes when you press fire...
|
also textelite: after showing map, it continues to show the market without keyboard entry...
|
||||||
also petaxian: gameplay doesn't work at all anymore
|
|
||||||
also textelite: after showing map, it just exits
|
|
||||||
|
|
||||||
|
|
||||||
Blocked by an official Commander-x16 v39 release
|
Blocked by an official Commander-x16 v39 release
|
||||||
|
Loading…
x
Reference in New Issue
Block a user