generated from rnentjes/kotlin-server-web-undertow
Refactor rewind functionality with circular buffer, update BufferedImageData handling in DisplayView, enhance ConsoleView rendering updates, and integrate SnakeCode data.
This commit is contained in:
@@ -57,7 +57,7 @@ abstract class Instruction(
|
||||
if (ls != null) {
|
||||
return ls
|
||||
}
|
||||
val jumpReg = JumpInstruction.disassemble(instruction)
|
||||
val jumpReg = JumpRegisterInstruction.disassemble(instruction)
|
||||
if (jumpReg != null) {
|
||||
return jumpReg
|
||||
}
|
||||
@@ -65,7 +65,7 @@ abstract class Instruction(
|
||||
if (jump != null) {
|
||||
return jump
|
||||
}
|
||||
return "<unknown>"
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,16 @@ class JumpRegisterInstruction(
|
||||
|
||||
companion object {
|
||||
fun disassemble(instruction: Short): String? {
|
||||
if (BinaryUtils.getBits(16, 5, instruction).toInt() == 9) {
|
||||
if (BinaryUtils.getBits(16, 4, instruction).toInt() == 9) {
|
||||
val reg = BinaryUtils.getBits(4, 4, instruction)
|
||||
val sb = StringBuilder("jr")
|
||||
sb.append(fromInteger(reg.toInt()))
|
||||
if (reg.toInt() == 11) {
|
||||
return "ret"
|
||||
} else {
|
||||
val sb = StringBuilder("jr")
|
||||
sb.append(" ")
|
||||
sb.append(fromInteger(reg.toInt()))
|
||||
return sb.toString()
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user