1
0
mirror of https://github.com/safiire/n65.git synced 2024-12-13 06:29:16 +00:00
n65/lib/directive.rb

29 lines
904 B
Ruby
Raw Normal View History

2015-02-18 03:05:37 +00:00
module Assembler6502
####
## This parses an assembler directive
class Directive
#####
## Some directives are:
## .inesprg x ; x * 16KB of PRG code
## .ineschr x ; x * 8KB of CHR data
## .inesmap x ; mapper. 0 = NROM, I don't know the other types
## .inesmir x ; background mirroring, I don't know what this should be so x = 1
## .bank x ; Sets the bank number, there are 8 banks of 8192 bytes = 2**16
## .org $hhhh ; Positions the code at hex address $hhhh
## .incbin "a" ; Assembles the contents of a binary file into current address
## .dw x ; Assemble a 16-bit word at current address, x can be a label
## .bytes a b c ; Assemble a sequence of bytes at the current address
####
## This will return a new Directive, or nil if it is something else.
def self.parse(directive_line)
end
end
end