mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 23:29:55 +00:00
vm: actually fix EXT(S) in vm too
This commit is contained in:
parent
4e863ecdac
commit
60cbb02822
@ -1589,7 +1589,7 @@ class VirtualMachine(irProgram: IRProgram) {
|
|||||||
|
|
||||||
private fun InsEXT(i: IRInstruction) {
|
private fun InsEXT(i: IRInstruction) {
|
||||||
when(i.type!!){
|
when(i.type!!){
|
||||||
IRDataType.BYTE -> registers.setUW(i.reg1!!, registers.getUB(i.reg1!!).toUShort())
|
IRDataType.BYTE -> registers.setUW(i.reg1!!, registers.getUB(i.reg2!!).toUShort())
|
||||||
IRDataType.WORD -> throw IllegalArgumentException("ext.w not yet supported, requires 32 bits registers")
|
IRDataType.WORD -> throw IllegalArgumentException("ext.w not yet supported, requires 32 bits registers")
|
||||||
IRDataType.FLOAT -> throw IllegalArgumentException("invalid float type for this instruction $i")
|
IRDataType.FLOAT -> throw IllegalArgumentException("invalid float type for this instruction $i")
|
||||||
}
|
}
|
||||||
@ -1598,7 +1598,7 @@ class VirtualMachine(irProgram: IRProgram) {
|
|||||||
|
|
||||||
private fun InsEXTS(i: IRInstruction) {
|
private fun InsEXTS(i: IRInstruction) {
|
||||||
when(i.type!!){
|
when(i.type!!){
|
||||||
IRDataType.BYTE -> registers.setSW(i.reg1!!, registers.getSB(i.reg1!!).toShort())
|
IRDataType.BYTE -> registers.setSW(i.reg1!!, registers.getSB(i.reg2!!).toShort())
|
||||||
IRDataType.WORD -> throw IllegalArgumentException("exts.w not yet supported, requires 32 bits registers")
|
IRDataType.WORD -> throw IllegalArgumentException("exts.w not yet supported, requires 32 bits registers")
|
||||||
IRDataType.FLOAT -> throw IllegalArgumentException("invalid float type for this instruction $i")
|
IRDataType.FLOAT -> throw IllegalArgumentException("invalid float type for this instruction $i")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user