Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOOPB now ends on 0 instead of -1 like other loops #59

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
LOOPB now ends on 0 instead of -1 like other loops
DerelictDrone committed Aug 12, 2024
commit 94c344956f3fcb91afd5dd20afe74efdcc758fdb
2 changes: 1 addition & 1 deletion lua/wire/zvm/zvm_opcodes.lua
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@
ZVM.OpcodeTable[26] = function(self) --LOOPB
self:Dyn_EmitForceRegisterLocal("EBX")
self:Dyn_Emit("EBX = EBX - 1")
self:Dyn_Emit("if VM.EBX ~= 0 then")
self:Dyn_Emit("if EBX ~= 0 then")
self:Dyn_Emit("VM:Jump($1)")
self:Dyn_EmitState()
self:Dyn_EmitBreak()
@@ -508,8 +508,8 @@
--------------------------------------------------------------------------------
ZVM.OpcodeTable[70] = function(self) --EXTINT
self:Dyn_EmitState()
self:Emit("VM.IP = %d",(self.PrecompileIP or 0))

Check warning on line 511 in lua/wire/zvm/zvm_opcodes.lua

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:Emit("VM.XEIP = %d",(self.PrecompileTrueXEIP or 0))

Check warning on line 512 in lua/wire/zvm/zvm_opcodes.lua

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:Dyn_Emit("VM:ExternalInterrupt(math.floor($1))")
self:Dyn_EmitBreak()
self.PrecompileBreak = true
@@ -765,7 +765,7 @@
self:Dyn_Emit("end")
end
ZVM.OpcodeTable[98] = function(self) --TIMER
self:Dyn_EmitOperand(string.format("(VM.TIMER+%d*VM.TimerDT)",(self.PrecompileInstruction or 0)))

Check warning on line 768 in lua/wire/zvm/zvm_opcodes.lua

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
end
ZVM.OpcodeTable[99] = function(self) --LIDTR
self:Dyn_Emit("VM.IDTR = $1")
@@ -1128,7 +1128,7 @@
ZVM.OpcodeTable[126] = function(self) --LEA
local emitText = self.OperandEffectiveAddress[self.EmitOperandRM[2]] or "0"
emitText = string.gsub(emitText,"$BYTE",self.EmitOperandByte[2] or "0")
emitText = string.format(string.gsub(emitText,"$SEG","VM[%q]",(self.EmitOperandSegment[2] or "DS")))

Check warning on line 1131 in lua/wire/zvm/zvm_opcodes.lua

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:Dyn_EmitOperand(emitText)
end
ZVM.OpcodeTable[127] = function(self) --BLOCK
@@ -1270,7 +1270,7 @@
self:Dyn_Emit("V = VM:Pop()") -- IRET EIP
self:Dyn_EmitInterruptCheck()

for i=0,31 do

Check warning on line 1273 in lua/wire/zvm/zvm_opcodes.lua

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.R%d = V")
end

@@ -1732,7 +1732,7 @@
self:Dyn_EmitInterruptCheck()
end
ZVM.OpcodeTable[269] = function(self) --VLEN
local seg1code = self.EmitOperandSegment[1] and "0" or "VM.DS"

Check warning on line 1735 in lua/wire/zvm/zvm_opcodes.lua

GitHub Actions / lint

"Unused variable"

Unused variable: seg1code
local seg2code = self.EmitOperandSegment[2] and "0" or "VM.DS"
self:Dyn_Emit("if VM.VMODE == 2 then")
self:Dyn_Emit("$L V = VM:ReadVector2f($2 + %s)",seg2code)