class Register

Register is a general X86 register, such as eax, ebx, ecx, edx, etc…

Attributes

id[RW]

Public Class Methods

new(bits = nil, machine = nil, id = nil) click to toggle source
Calls superclass method Operand.new
# File lib/wilson.rb, line 942
def initialize bits = nil, machine = nil, id = nil
  super(bits, machine)
  self.id = id
end
on_id_bits(machine, id, bits) click to toggle source
# File lib/wilson.rb, line 938
def self.on_id_bits machine, id, bits
  self.new bits, machine, id
end

Public Instance Methods

+(offset) click to toggle source
# File lib/wilson.rb, line 972
def + offset
  Address.on_id_offset machine, id, offset
end
-(offset) click to toggle source
# File lib/wilson.rb, line 968
def - offset
  self + -offset
end
get(address) click to toggle source
# File lib/wilson.rb, line 955
def get address # TODO: test
  self.mov address
  self.mov {self}
end
m() click to toggle source
# File lib/wilson.rb, line 964
def m
  self + 0
end
memory_register?() click to toggle source
# File lib/wilson.rb, line 947
def memory_register?
  false
end
push_mod_rm_on(spareRegister, stream) click to toggle source
# File lib/wilson.rb, line 960
def push_mod_rm_on spareRegister, stream
  stream << (0b11000000 + id + (spareRegister.id << 3))
end
register?() click to toggle source
# File lib/wilson.rb, line 951
def register?
  true
end