Class: N65::Org
- Inherits:
-
InstructionBase
- Object
- InstructionBase
- N65::Org
- Defined in:
- lib/n65/directives/org.rb
Overview
This is an .org directive
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
Class Method Summary collapse
Instance Method Summary collapse
-
#exec(assembler) ⇒ Object
Exec this directive on the assembler.
-
#initialize(address) ⇒ Org
constructor
Initialized with address to switch to.
-
#to_s ⇒ Object
Display.
Methods inherited from InstructionBase
Constructor Details
#initialize(address) ⇒ Org
Initialized with address to switch to
19 20 21 |
# File 'lib/n65/directives/org.rb', line 19 def initialize(address) @address = address end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
8 9 10 |
# File 'lib/n65/directives/org.rb', line 8 def address @address end |
Class Method Details
Instance Method Details
#exec(assembler) ⇒ Object
Exec this directive on the assembler
24 25 26 |
# File 'lib/n65/directives/org.rb', line 24 def exec(assembler) assembler.program_counter = address end |
#to_s ⇒ Object
Display
29 30 31 32 33 34 35 |
# File 'lib/n65/directives/org.rb', line 29 def to_s if @address <= 0xff '.org $%2.X' % @address else '.org $%4.X' % @address end end |