asserts to debug
This commit is contained in:
parent
218fafca05
commit
a24e96efbc
@ -22,6 +22,9 @@ module Register
|
|||||||
@register = register
|
@register = register
|
||||||
@array = array
|
@array = array
|
||||||
@index = index
|
@index = index
|
||||||
|
raise "not integer #{index}" unless index.is_a? Numeric
|
||||||
|
raise "Not register #{register}" unless Register::RegisterReference.look_like_reg(register)
|
||||||
|
raise "Not register #{array}" unless Register::RegisterReference.look_like_reg(array)
|
||||||
end
|
end
|
||||||
attr_accessor :register , :array , :index
|
attr_accessor :register , :array , :index
|
||||||
end
|
end
|
||||||
|
@ -16,11 +16,14 @@ module Register
|
|||||||
|
|
||||||
# If you had a c array and index offset
|
# If you had a c array and index offset
|
||||||
# the instruction would do array[index] = register
|
# the instruction would do array[index] = register
|
||||||
# So SGetSlot means the register (first argument) moves to the slot (array and index)
|
# So SetSlot means the register (first argument) moves to the slot (array and index)
|
||||||
def initialize register , array , index
|
def initialize register , array , index
|
||||||
@register = register
|
@register = register
|
||||||
@array = array
|
@array = array
|
||||||
@index = index
|
@index = index
|
||||||
|
raise "not integer #{index}" unless index.is_a? Numeric
|
||||||
|
raise "Not register #{register}" unless Register::RegisterReference.look_like_reg(register)
|
||||||
|
raise "Not register #{array}" unless Register::RegisterReference.look_like_reg(array)
|
||||||
end
|
end
|
||||||
attr_accessor :register , :array , :index
|
attr_accessor :register , :array , :index
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user