Class: Wilson::Register
Overview
Register is a general X86 register, such as eax, ebx, ecx, edx, etc…
Instance Attribute Summary collapse
Attributes inherited from Operand
#bits, #machine
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Operand
#instructionFromMessage, #method_missing, on, #operand?
Constructor Details
#initialize(bits = nil, machine = nil, id = nil) ⇒ Register
Returns a new instance of Register.
1000
1001
1002
1003
|
# File 'lib/wilson.rb', line 1000
def initialize bits = nil, machine = nil, id = nil
super(bits, machine)
self.id = id
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Wilson::Operand
Instance Attribute Details
Returns the value of attribute id.
994
995
996
|
# File 'lib/wilson.rb', line 994
def id
@id
end
|
Class Method Details
.on_id_bits(machine, id, bits) ⇒ Object
996
997
998
|
# File 'lib/wilson.rb', line 996
def self.on_id_bits machine, id, bits
self.new bits, machine, id
end
|
Instance Method Details
#+(offset) ⇒ Object
1030
1031
1032
|
# File 'lib/wilson.rb', line 1030
def + offset
Address.on_id_offset machine, id, offset
end
|
#-(offset) ⇒ Object
1026
1027
1028
|
# File 'lib/wilson.rb', line 1026
def - offset
self + -offset
end
|
#get(address) ⇒ Object
1013
1014
1015
1016
|
# File 'lib/wilson.rb', line 1013
def get address self.mov address
self.mov {self}
end
|
1022
1023
1024
|
# File 'lib/wilson.rb', line 1022
def m
self + 0
end
|
#memory_register? ⇒ Boolean
1005
1006
1007
|
# File 'lib/wilson.rb', line 1005
def memory_register?
false
end
|
#push_mod_rm_on(spareRegister, stream) ⇒ Object
1018
1019
1020
|
# File 'lib/wilson.rb', line 1018
def push_mod_rm_on spareRegister, stream
stream << (0b11000000 + id + (spareRegister.id << 3))
end
|
#register? ⇒ Boolean
1009
1010
1011
|
# File 'lib/wilson.rb', line 1009
def register?
true
end
|