adds multiplication
without overflow testing, like the others
This commit is contained in:
@ -184,7 +184,7 @@ module Risc
|
||||
end
|
||||
|
||||
obj = space.get_class_by_name(:Integer)
|
||||
[ :putint, :mod4, :div10, :+ , :-].each do |f| #mod4 is just a forward declaration
|
||||
[ :putint, :mod4, :div10, :+ , :- , :*].each do |f| #mod4 is just a forward declaration
|
||||
obj.instance_type.add_method Builtin::Integer.send(f , nil)
|
||||
end
|
||||
end
|
||||
|
@ -23,6 +23,9 @@ module Risc
|
||||
compiler.add_mom( Mom::ReturnSequence.new)
|
||||
return compiler.method
|
||||
end
|
||||
def *( context )
|
||||
operator_method( "mult" , :*)
|
||||
end
|
||||
def +( context )
|
||||
operator_method( "plus" , :+)
|
||||
end
|
||||
|
Reference in New Issue
Block a user