just moving code around
This commit is contained in:
@ -21,10 +21,6 @@ module Vm
|
||||
block.cmp( self , right )
|
||||
Vm::BranchCondition.new :lt
|
||||
end
|
||||
def at_index block , left , right
|
||||
block.ldr( self , left , right )
|
||||
self
|
||||
end
|
||||
def plus block , first , right
|
||||
block.add( self , left , right )
|
||||
self
|
||||
@ -41,20 +37,6 @@ module Vm
|
||||
block.cmp( self , right )
|
||||
Vm::BranchCondition.new :eq
|
||||
end
|
||||
|
||||
def load block , right
|
||||
if(right.is_a? IntegerConstant)
|
||||
block.mov( self , right ) #move the value
|
||||
elsif right.is_a? StringConstant
|
||||
block.add( self , right , nil) #move the address, by "adding" to pc, ie pc relative
|
||||
block.mov( Integer.new(self.register.next_reg_use) , right.length ) #and the length HACK TODO
|
||||
elsif right.is_a?(Boot::BootClass) or right.is_a?(Boot::MetaClass)
|
||||
block.add( self , right , nil) #move the address, by "adding" to pc, ie pc relative
|
||||
else
|
||||
raise "unknown #{right.inspect}"
|
||||
end
|
||||
self
|
||||
end
|
||||
|
||||
def is_true? function
|
||||
function.cmp( self , 0 )
|
||||
|
@ -7,5 +7,24 @@ module Vm
|
||||
end
|
||||
attr_accessor :clazz
|
||||
|
||||
def load block , right
|
||||
if(right.is_a? IntegerConstant)
|
||||
block.mov( self , right ) #move the value
|
||||
elsif right.is_a? StringConstant
|
||||
block.add( self , right , nil) #move the address, by "adding" to pc, ie pc relative
|
||||
block.mov( Integer.new(self.register.next_reg_use) , right.length ) #and the length HACK TODO
|
||||
elsif right.is_a?(Boot::BootClass) or right.is_a?(Boot::MetaClass)
|
||||
block.add( self , right , nil) #move the address, by "adding" to pc, ie pc relative
|
||||
else
|
||||
raise "unknown #{right.inspect}"
|
||||
end
|
||||
self
|
||||
end
|
||||
|
||||
def at_index block , left , right
|
||||
block.ldr( self , left , right )
|
||||
self
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user