2014-04-14 17:09:56 +02:00
|
|
|
module Asm
|
|
|
|
class DataObject
|
|
|
|
def initialize(data)
|
|
|
|
@data = data
|
|
|
|
end
|
2014-04-22 13:39:47 +02:00
|
|
|
|
2014-04-22 22:55:47 +02:00
|
|
|
def position
|
|
|
|
throw "Not set" unless @address
|
|
|
|
@address
|
|
|
|
end
|
2014-04-22 13:39:47 +02:00
|
|
|
def at address
|
|
|
|
@address = address
|
|
|
|
end
|
|
|
|
def length
|
|
|
|
@data.length
|
|
|
|
end
|
2014-04-14 17:09:56 +02:00
|
|
|
def assemble(io, as)
|
|
|
|
io << @data
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|