mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 16:29:21 +00:00
vm: get rid of jumpi traces, fix IR value issue with STOREIX
This commit is contained in:
parent
0aa0ec5abd
commit
78d3d9d27d
@ -259,10 +259,7 @@ internal class AstChecker(private val program: Program,
|
||||
)
|
||||
count++
|
||||
} else {
|
||||
if(" return" in assembly || "\treturn" in assembly
|
||||
|| " jump" in assembly || "\tjump" in assembly
|
||||
|| " jumpi" in assembly || "\tjumpi" in assembly
|
||||
)
|
||||
if(" return" in assembly || "\treturn" in assembly || " jump" in assembly || "\tjump" in assembly)
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ internal fun IdentifierReference.isSubroutineParameter(program: Program): Boolea
|
||||
internal fun Subroutine.hasRtsInAsm(compTarget: ICompilationTarget): Boolean {
|
||||
val instructions =
|
||||
if(compTarget.name == VMTarget.NAME)
|
||||
listOf(" return", "\treturn", " jump", "\tjump", " jumpi", "\tjumpi")
|
||||
listOf(" return", "\treturn", " jump", "\tjump")
|
||||
else
|
||||
listOf(" rti", "\trti", " rts", "\trts", " jmp", "\tjmp", " bra", "\tbra")
|
||||
return statements
|
||||
|
@ -44,7 +44,6 @@ But you can decide whatever you want because here we just care about jumping and
|
||||
Saving/restoring registers is possible with PUSH and POP instructions.
|
||||
|
||||
jump location - continue running at instruction number given by location
|
||||
jumpi reg1 - continue running at instruction number in reg1
|
||||
call location - save current instruction location+1, continue execution at instruction nr given by location
|
||||
calli reg1 - save current instruction location+1, continue execution at instruction number in reg1
|
||||
syscall value - do a systemcall identified by call number
|
||||
@ -345,8 +344,11 @@ val OpcodesWithAddress = setOf(
|
||||
Opcode.LOADIX,
|
||||
Opcode.STOREM,
|
||||
Opcode.STOREX,
|
||||
Opcode.STOREIX,
|
||||
Opcode.STOREZM,
|
||||
Opcode.STOREZX,
|
||||
Opcode.JUMP,
|
||||
Opcode.CALL,
|
||||
Opcode.INCM,
|
||||
Opcode.DECM,
|
||||
Opcode.NEGM,
|
||||
|
Loading…
Reference in New Issue
Block a user