function luaP.GET_OPCODE(q,K)return q.ROpCode[K.OP]end function luaP.SET_OPCODE(H,K,q)K.OP=H.OpCode[q]end function luaP.GETARG_A(q,K)return K.A end function luaP.SETARG_A(H,K,q)K.A=q end function luaP.GETARG_B(q,K)return K.B end function luaP.SETARG_B(H,K,q)K.B=q end function luaP.GETARG_C(q,K)return K.C end function luaP.SETARG_C(H,K,q)K.C=q end function luaP.GETARG_Bx(q,K)return K.Bx end function luaP.SETARG_Bx(H,K,q)K.Bx=q end function luaP.GETARG_sBx(q,K)return K.Bx-q.MAXARG_sBx end function luaP.SETARG_sBx(H,K,q)K.Bx=q+H.MAXARG_sBx end function luaP.CREATE_ABC(G,K,q,H,r)return{OP=G.OpCode[K];A=q,B=H,C=r}end function luaP.CREATE_ABx(r,K,q,H)return{OP=r.OpCode[K],A=q,Bx=H}end
-- these accept or return opcodes in the form of string names
function luaP:GET_OPCODE(i)
	return self.ROpCode[i.OP]
end
function luaP:SET_OPCODE(i, o)
	i.OP = self.OpCode[o]
end

function luaP:GETARG_A(i)
	return i.A
end
function luaP:SETARG_A(i, u)
	i.A = u
end

function luaP:GETARG_B(i)
	return i.B
end
function luaP:SETARG_B(i, b)
	i.B = b
end

function luaP:GETARG_C(i)
	return i.C
end
function luaP:SETARG_C(i, b)
	i.C = b
end

function luaP:GETARG_Bx(i)
	return i.Bx
end
function luaP:SETARG_Bx(i, b)
	i.Bx = b
end

function luaP:GETARG_sBx(i)
	return i.Bx - self.MAXARG_sBx
end
function luaP:SETARG_sBx(i, b)
	i.Bx = b + self.MAXARG_sBx
end

function luaP:CREATE_ABC(o, a, b, c)
	return { OP = self.OpCode[o], A = a, B = b, C = c }
end

function luaP:CREATE_ABx(o, a, bc)
	return { OP = self.OpCode[o], A = a, Bx = bc }
end
