1. Liam Devine
  2. Lua52_bytecode_dump

Commits

Liam Devine  committed 2f9a0a9

Adds an Unknown operator
Adds OP_SETLIST specialisation
Changed end of buffer to be first line which ends in ">>" as opposed to the first line that does not end in ">>" which was the old behaviour.

  • Participants
  • Parent commits 8c862d9
  • Branches default

Comments (0)

Files changed (1)

File luadump52.lua

View file
 		}
 		
 		local reg_str = ''
-		local op = lua_ops[instruction_values.op]
+		local op = lua_ops[instruction_values.op] or {name ='??UNKNOWN??',regs={},desc ='If this is not understood by the vm running the code then it will be a NOP'}
 		local description = op.desc
 		local jmp = ''
 
 				end
 			end
 			reg_str = 'A='.. instruction_values.A .. ' B=' .. fb2int(instruction_values.B) ..' C=' .. fb2int(instruction_values.C)
+		elseif op.name == 'OP_SETLIST' then
+			local a = instruction_values.A
+			local n = instruction_values.B
+			local c = instruction_values.C
+			if(n ==0) then reg_str = reg_str .. 'B=0 variable from A+1 to top of stack' end
+			if(c==0) then reg_str = reg_str .. 'B is next instruction Ax value' end
+		
+			description = description:gsub('FPF',50)	
 		end
 		
 		if replace_reg_indexes then
 	
 local interactive_mode = function()
 	print 'interactive mode'
-	print"The first line which does not end in '>>' is the end of buffer"
+	print"The first line which ends in '>>' is the end of buffer"
 	print'"-iend" ends interactive mode'
 	local buffered_input = ''
 	local last_complete_buffer = ''
 			end
 		elseif input:match('^-rerun*') then
 			run_code_and_debug(last_complete_buffer)
+		
 		elseif input:match('.*>>$') then
-			buffered_input = buffered_input .. input:sub(1,#input-2) ..'\n'
+				buffered_input = buffered_input .. input:sub(1,#input-2) ..'\n'
+				local result = run_code_and_debug(buffered_input )
+				if result == true then last_complete_buffer = buffered_input end
+				buffered_input = ''
 		else
-			local result = run_code_and_debug(buffered_input .. input)
-			if result == true then last_complete_buffer = buffered_input .. input end
-			buffered_input = ''		
+			buffered_input = buffered_input .. input ..'\n'
 		end
 		input = io.read()
 	end