Class: Haxor::Vm::Cpu::Unit::Transfer
- Defined in:
- lib/haxor/vm/cpu/unit/transfer.rb
Constant Summary collapse
- OP_MOV =
0x60
0x60- OP_PUSH =
mov a, b
0x61- OP_POP =
push a
0x62
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#bind_opcode, #dereference, #fetch_cell, #next_cell, #operand, #operands, #replace_cell
Instance Method Details
#op_mov ⇒ Object
18 19 20 21 22 |
# File 'lib/haxor/vm/cpu/unit/transfer.rb', line 18 def op_mov a, b = operands v = @vm.subsystem(:mem).read b @vm.subsystem(:mem).write a, v end |
#op_pop ⇒ Object
29 30 31 32 |
# File 'lib/haxor/vm/cpu/unit/transfer.rb', line 29 def op_pop a = operand @vm.subsystem(:stack).pop a end |
#op_push ⇒ Object
24 25 26 27 |
# File 'lib/haxor/vm/cpu/unit/transfer.rb', line 24 def op_push a = operand @vm.subsystem(:stack).push a end |