mirror of
https://github.com/safiire/n65.git
synced 2024-12-12 00:29:03 +00:00
2c938f7312
bank management, Use of promises to resolve symbols that are used before they are defined. A base class for all instructions and assembler directives. Hopefully my scoped symbols can be used to create C like data structures in the zero page, ie sprite.x New code to prodce the final ROM. Basically everything was rewritten.
30 lines
542 B
Ruby
30 lines
542 B
Ruby
|
|
module Assembler6502
|
|
|
|
class InstructionBase
|
|
|
|
|
|
#####
|
|
## Sort of a "pure virtual" class method, not really tho.
|
|
def self.parse(line)
|
|
fail(NotImplementedError, "#{self.class.name} must implement self.parse")
|
|
end
|
|
|
|
|
|
####
|
|
## Does this instruction have unresolved symbols?
|
|
def unresolved_symbols?
|
|
false
|
|
end
|
|
|
|
|
|
####
|
|
## Another method subclasses will be expected to implement
|
|
def exec(assembler)
|
|
fail(NotImplementedError, "#{self.class.name} must implement exec")
|
|
end
|
|
|
|
end
|
|
|
|
end
|