small function naming adjustments

This commit is contained in:
Torsten Ruger 2014-09-16 17:16:13 +03:00
parent db01529b67
commit cffa7f1953
5 changed files with 7 additions and 20 deletions

View File

@ -15,18 +15,13 @@ module Arm
class CallInstruction < ::Register::CallInstruction class CallInstruction < ::Register::CallInstruction
include Arm::Constants include Arm::Constants
# arm intrucioons are pretty sensible, and always 4 bytes (thumb not supported)
def length
4
end
def initialize(first, attributes) def initialize(first, attributes)
super(first , attributes) super(first , attributes)
@attributes[:update_status] = 0 @attributes[:update_status] = 0
@attributes[:condition_code] = :al if @attributes[:condition_code] == nil @attributes[:condition_code] = :al if @attributes[:condition_code] == nil
end end
def assemble(io, assembler) def assemble(io)
case @attributes[:opcode] case @attributes[:opcode]
when :b, :call when :b, :call
arg = @first arg = @first

View File

@ -11,10 +11,6 @@ module Arm
@rn = left @rn = left
@rd = :r0 @rd = :r0
end end
# arm instructions are pretty sensible, and always 4 bytes (thumb not supported)
def length
4
end
def assemble(io, assembler) def assemble(io, assembler)
# don't overwrite instance variables, to make assembly repeatable # don't overwrite instance variables, to make assembly repeatable

View File

@ -115,7 +115,7 @@ module Arm
end end
# arm intrucioons are pretty sensible, and always 4 bytes (thumb not supported) # arm intrucioons are pretty sensible, and always 4 bytes (thumb not supported)
def length def mem_length
4 4
end end

View File

@ -13,11 +13,6 @@ module Arm
@immediate = 0 @immediate = 0
end end
# arm intrucioons are pretty sensible, and always 4 bytes (thumb not supported)
def length
4
end
def assemble(io, assembler) def assemble(io, assembler)
# don't overwrite instance variables, to make assembly repeatable # don't overwrite instance variables, to make assembly repeatable
left = @left left = @left

View File

@ -19,7 +19,8 @@ module Arm
# but not all constants fit into the part of the instruction that is left after the instruction code, # but not all constants fit into the part of the instruction that is left after the instruction code,
# so large moves have to be split into two instrucitons. we handle this here, just this instruciton looks # so large moves have to be split into two instrucitons. we handle this here, just this instruciton looks
# longer # longer
def length def mem_length
return 4
is_simple ? 4 : 8 is_simple ? 4 : 8
end end
@ -28,7 +29,7 @@ module Arm
def is_simple def is_simple
right = @from right = @from
if right.is_a?(Virtual::ObjectConstant) if right.is_a?(Virtual::ObjectConstant)
r_pos = 5 #assembler.position_for(right) r_pos = right.position
# do pc relative addressing with the difference to the instuction # do pc relative addressing with the difference to the instuction
# 8 is for the funny pipeline adjustment (ie pc pointing to fetch and not execute) # 8 is for the funny pipeline adjustment (ie pc pointing to fetch and not execute)
right = Virtual::IntegerConstant.new( r_pos - self.position - 8 ) right = Virtual::IntegerConstant.new( r_pos - self.position - 8 )
@ -45,7 +46,7 @@ module Arm
return true return true
end end
def assemble(io, assembler) def assemble(io)
# don't overwrite instance variables, to make assembly repeatable # don't overwrite instance variables, to make assembly repeatable
rn = @rn rn = @rn
operand = @operand operand = @operand
@ -53,7 +54,7 @@ module Arm
complex = false complex = false
right = @from right = @from
if right.is_a?(Virtual::ObjectConstant) if right.is_a?(Virtual::ObjectConstant)
r_pos = assembler.position_for(right) r_pos = right.position
# do pc relative addressing with the difference to the instuction # do pc relative addressing with the difference to the instuction
# 8 is for the funny pipeline adjustment (ie pc pointing to fetch and not execute) # 8 is for the funny pipeline adjustment (ie pc pointing to fetch and not execute)
right = Virtual::IntegerConstant.new( r_pos - self.position - 8 ) right = Virtual::IntegerConstant.new( r_pos - self.position - 8 )