a creative moment, making up instructions

This commit is contained in:
Torsten Ruger 2014-10-04 12:51:08 +03:00
parent f77d3ea7eb
commit e3c3840bc6
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,13 @@
module Register
# return from a function call
#register and index specify where the return address is stored
class FunctionReturn < Instruction
def initialize register , index
@register = register
@index = index
end
attr_reader :register , :index
end
end

View File

@ -0,0 +1,12 @@
module Register
#transfer the constents of one register to another. possibly called move in some cpus
class RegisterTransfer < Instruction
def initialize from , to
@from = from
@to = to
end
attr_reader :from, :to
end
end

View File

@ -0,0 +1,13 @@
module Register
# save the return address of a call
# register and index specify where the return address is stored
class SaveReturn < Instruction
def initialize register , index
@register = register
@index = index
end
attr_reader :register , :index
end
end