Module: N65::Regexes
- Included in:
- Instruction
- Defined in:
- lib/n65/regexes.rb
Overview
All the regexes used to parse in one module
Constant Summary collapse
- Mnemonic =
Mnemonics
'([A-Za-z]{3})'
- Branches =
'(BPL|BMI|BVC|BVS|BCC|BCS|BNE|BEQ|bpl|bmi|bvc|bvs|bcc|bcs|bne|beq)'
- Hex8 =
Numeric Literals
'\$([A-Fa-f0-9]{1,2})'
- Hex16 =
'\$([A-Fa-f0-9]{3,4})'
- Bin8 =
'%([01]{1,8})'
- Bin16 =
'%([01]{9,16})'
- Num8 =
Regexp.union(Regexp.new(Hex8), Regexp.new(Bin8)).to_s
- Num16 =
Regexp.union(Regexp.new(Hex16),Regexp.new(Bin16)).to_s
- Immediate =
"\##{Num8}"
- Sym =
Symbols, must begin with a letter, and supports dot syntax
'([a-zA-Z][a-zA-Z\d_\.]*)'
- XReg =
The X or Y register
'[Xx]'
- YReg =
'[Yy]'