Liam Devine avatar 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.

Comments (0)

Files changed (1)

 		}
 		
 		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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.