Class: Whitespace::ISA::Putc
- Inherits:
-
Instruction
- Object
- Instruction
- Whitespace::ISA::Putc
- Defined in:
- lib/whitespace/instructions/io/putc.rb
Instance Attribute Summary collapse
-
#console ⇒ Object
readonly
Returns the value of attribute console.
Attributes inherited from Instruction
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(vm, console) ⇒ Putc
constructor
A new instance of Putc.
Constructor Details
#initialize(vm, console) ⇒ Putc
Returns a new instance of Putc.
5 6 7 8 |
# File 'lib/whitespace/instructions/io/putc.rb', line 5 def initialize(vm, console) super(vm) @console = console end |
Instance Attribute Details
#console ⇒ Object (readonly)
Returns the value of attribute console.
3 4 5 |
# File 'lib/whitespace/instructions/io/putc.rb', line 3 def console @console end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 |
# File 'lib/whitespace/instructions/io/putc.rb', line 10 def execute n = vm.vstack.pop console.printc n end |