<commit_before>/*
 *   6502 JavaScript Emulator and Assembler
 *   http://damnbrain.com/
 *
 *   The MIT License (MIT)
 *
 *   Copyright (c) 2015 <NAME>
 *
 *   Permission is hereby granted, free of charge, to any person obtaining a copy
 *   of this software and associated documentation files (the "Software"), to deal
 *   in the Software without restriction, including without limitation the rights
 *   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *   copies of the Software, and to permit persons to whom the Software is
 *   furnished to do so, subject to the following conditions:
 *
 *   The above copyright notice and this permission notice shall be included in all
 *   copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *   SOFTWARE.
 *
 */
(function (scope) {
    'use strict';
    var ASM6502 = {},
        modeIndex = [
            'IMM',
            'ZP',
            'ZPX',
            'ZPY',
            'AB',
            'ABX',
            'ABY',
            'IND',
            'IDX',
            'IDY',
            'IMP',
            'REL',
            'A'
        ],
        lookupTable = {
            // Source of lookup table:
            // https://github.com/skilldrick/easy6502/blob/gh-pages/simulator/assembler.js
            //MN  IMM    ZP    ZPX   ZPY   AB    ABX   ABY  IND   IDX   IDY   IMP   REL    A
            ADC: [0x69, 0x65, 0x75, null, 0x6d, 0x7d, 0x79, null, 0x61, 0x71, null, null, null],
            AND: [0x29, 0x25, 0x35, null, 0x2d, 0x3d, 0x39, null, 0x21, 0x31, null, null, null],
            ASL: [null, 0x06, 0x16, null, 0x0e, 0x1e, null, null, null, null, null, null, 0x0a],
            BIT: [null, 0x24, null, null, 0x2c, null, null, null, null, null, null, null, null],
            BPL: [null, null, null, null, null, null, null, null, null, null, null, 0x10, null],
            BMI: [null, null, null, null, null, null, null, null, null, null, null, 0x30, null],
            BVC: [null, null, null, null, null, null, null, null, null, null, null, 0x50, null],
            BVS: [null, null, null, null, null, null, null, null, null, null, null, 0x70, null],
            BCC: [null, null, null, null, null, null, null, null, null, null, null, 0x90, null],
            BCS: [null, null, null, null, null, null, null, null, null, null, null, 0xb0, null],
            BNE: [null, null, null, null, null, null, null, null, null, null, null, 0xd0, null],
            BEQ: [null, null, null, null, null, null, null, null, null, null, null, 0xf0, null],
            BRK: [null, null, null, null, null, null, null, null, null, null, 0x00, null, null],
            CMP: [0xc9, 0xc5, 0xd5, null, 0xcd, 0xdd, 0xd9, null, 0xc1, 0xd1, null, null, null],
            CPX: [0xe0, 0xe4, null, null, 0xec, null, null, null, null, null, null, null, null],
            CPY: [0xc0, 0xc4, null, null, 0xcc, null, null, null, null, null, null, null, null],
            DEC: [null, 0xc6, 0xd6, null, 0xce, 0xde, null, null, null, null, null, null, null],
            EOR: [0x49, 0x45, 0x55, null, 0x4d, 0x5d, 0x59, null, 0x41, 0x51, null, null, null],
            CLC: [null, null, null, null, null, null, null, null, null, null, 0x18, null, null],
            SEC: [null, null, null, null, null, null, null, null, null, null, 0x38, null, null],
            CLI: [null, null, null, null, null, null, null, null, null, null, 0x58, null, null],
            SEI: [null, null, null, null, null, null, null, null, null, null, 0x78, null, null],
            CLV: [null, null, null, null, null, null, null, null, null, null, 0xb8, null, null],
            CLD: [null, null, null, null, null, null, null, null, null, null, 0xd8, null, null],
            SED: [null, null, null, null, null, null, null, null, null, null, 0xf8, null, null],
            INC: [null, 0xe6, 0xf6, null, 0xee, 0xfe, null, null, null, null, null, null, null],
            JMP: [null, null, null, null, 0x4c, null, null, 0x6c, null, null, null, null, null],
            JSR: [null, null, null, null, 0x20, null, null, null, null, null, null, null, null],
            LDA: [0xa9, 0xa5, 0xb5, null, 0xad, 0xbd, 0xb9, null, 0xa1, 0xb1, null, null, null],
            LDX: [0xa2, 0xa6, null, 0xb6, 0xae, null, 0xbe, null, null, null, null, null, null],
            LDY: [0xa0, 0xa4, 0xb4, null, 0xac, 0xbc, null, null, null, null, null, null, null],
            LSR: [null, 0x46, 0x56, null, 0x4e, 0x5e, null, null, null, null, 0x4a, null, null],
            NOP: [null, null, null, null, null, null, null, null, null, null, 0xea, null, null],
            ORA: [0x09, 0x05, 0x15, null, 0x0d, 0x1d, 0x19, null, 0x01, 0x11, null, null, null],
            TAX: [null, null, null, null, null, null, null, null, null, null, 0xaa, null, null],
            TXA: [null, null, null, null, null, null, null, null, null, null, 0x8a, null, null],
            DEX: [null, null, null, null, null, null, null, null, null, null, 0xca, null, null],
            INX: [null, null, null, null, null, null, null, null, null, null, 0xe8, null, null],
            TAY: [null, null, null, null, null, null, null, null, null, null, 0xa8, null, null],
            TYA: [null, null, null, null, null, null, null, null, null, null, 0x98, null, null],
            DEY: [null, null, null, null, null, null, null, null, null, null, 0x88, null, null],
            INY: [null, null, null, null, null, null, null, null, null, null, 0xc8, null, null],
            ROR: [null, 0x66, 0x76, null, 0x6e, 0x7e, null, null, null, null, null, null, 0x6a],<commit_msg>Fix assembler<commit_after>/*
 *   6502 JavaScript Emulator and Assembler
 *   http://damnbrain.com/
 *
 *   The MIT License (MIT)
 *
 *   Copyright (c) 2015 <NAME>
 *
 *   Permission is hereby granted, free of charge, to any person obtaining a copy
 *   of this software and associated documentation files (the "Software"), to deal
 *   in the Software without restriction, including without limitation the rights
 *   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *   copies of the Software, and to permit persons to whom the Software is
 *   furnished to do so, subject to the following conditions:
 *
 *   The above copyright notice and this permission notice shall be included in all
 *   copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *   SOFTWARE.
 *
 */
(function (scope) {
    'use strict';
    var ASM6502 = {},
        modeIndex = [
            'IMM',
            'ZP',
            'ZPX',
            'ZPY',
            'AB',
            'ABX',
            'ABY',
            'IND',
            'IDX',
            'IDY',
            'IMP',
            'REL',
            'A'
        ],
        lookupTable = {
            // Source of lookup table:
            // https://github.com/skilldrick/easy6502/blob/gh-pages/simulator/assembler.js
            //MN  IMM    ZP    ZPX   ZPY   AB    ABX   ABY  IND   IDX   IDY   IMP   REL    A
            ADC: [0x69, 0x65, 0x75, null, 0x6d, 0x7d, 0x79, null, 0x61, 0x71, null, null, null],
            AND: [0x29, 0x25, 0x35, null, 0x2d, 0x3d, 0x39, null, 0x21, 0x31, null, null, null],
            ASL: [null, 0x06, 0x16, null, 0x0e, 0x1e, null, null, null, null, null, null, 0x0a],
            BIT: [null, 0x24, null, null, 0x2c, null, null, null, null, null, null, null, null],
            BPL: [null, null, null, null, null, null, null, null, null, null, null, 0x10, null],
            BMI: [null, null, null, null, null, null, null, null, null, null, null, 0x30, null],
            BVC: [null, null, null, null, null, null, null, null, null, null, null, 0x50, null],
            BVS: [null, null, null, null, null, null, null, null, null, null, null, 0x70, null],
            BCC: [null, null, null, null, null, null, null, null, null, null, null, 0x90, null],
            BCS: [null, null, null, null, null, null, null, null, null, null, null, 0xb0, null],
            BNE: [null, null, null, null, null, null, null, null, null, null, null, 0xd0, null],
            BEQ: [null, null, null, null, null, null, null, null, null, null, null, 0xf0, null],
            BRK: [null, null, null, null, null, null, null, null, null, null, 0x00, null, null],
            CMP: [0xc9, 0xc5, 0xd5, null, 0xcd, 0xdd, 0xd9, null, 0xc1, 0xd1, null, null, null],
            CPX: [0xe0, 0xe4, null, null, 0xec, null, null, null, null, null, null, null, null],
            CPY: [0xc0, 0xc4, null, null, 0xcc, null, null, null, null, null, null, null, null],
            DEC: [null, 0xc6, 0xd6, null, 0xce, 0xde, null, null, null, null, null, null, null],
            EOR: [0x49, 0x45, 0x55, null, 0x4d, 0x5d, 0x59, null, 0x41, 0x51, null, null, null],
            CLC: [null, null, null, null, null, null, null, null, null, null, 0x18, null, null],
            SEC: [null, null, null, null, null, null, null, null, null, null, 0x38, null, null],
            CLI: [null, null, null, null, null, null, null, null, null, null, 0x58, null, null],
            SEI: [null, null, null, null, null, null, null, null, null, null, 0x78, null, null],
            CLV: [null, null, null, null, null, null, null, null, null, null, 0xb8, null, null],
            CLD: [null, null, null, null, null, null, null, null, null, null, 0xd8, null, null],
            SED: [null, null, null, null, null, null, null, null, null, null, 0xf8, null, null],
            INC: [null, 0xe6, 0xf6, null, 0xee, 0xfe, null, null, null, null, null, null, null],
            JMP: [null, null, null, null, 0x4c, null, null, 0x6c, null, null, null, null, null],
            JSR: [null, null, null, null, 0x20, null, null, null, null, null, null, null, null],
            LDA: [0xa9, 0xa5, 0xb5, null, 0xad, 0xbd, 0xb9, null, 0xa1, 0xb1, null, null, null],
            LDX: [0xa2, 0xa6, null, 0xb6, 0xae, null, 0xbe, null, null, null, null, null, null],
            LDY: [0xa0, 0xa4, 0xb4, null, 0xac, 0xbc, null, null, null, null, null, null, null],
            LSR: [null, 0x46, 0x56, null, 0x4e, 0x5e, null, null, null, null, null, null, 0x4a],
            NOP: [null, null, null, null, null, null, null, null, null, null, 0xea, null, null],
            ORA: [0x09, 0x05, 0x15, null, 0x0d, 0x1d, 0x19, null, 0x01, 0x11, null, null, null],
            TAX: [null, null, null, null, null, null, null, null, null, null, 0xaa, null, null],
            TXA: [null, null, null, null, null, null, null, null, null, null, 0x8a, null, null],
            DEX: [null, null, null, null, null, null, null, null, null, null, 0xca, null, null],
            INX: [null, null, null, null, null, null, null, null, null, null, 0xe8, null, null],
            TAY: [null, null, null, null, null, null, null, null, null, null, 0xa8, null, null],
            TYA: [null, null, null, null, null, null, null, null, null, null, 0x98, null, null],
            DEY: [null, null, null, null, null, null, null, null, null, null, 0x88, null, null],
            INY: [null, null, null, null, null, null, null, null, null, null, 0xc8, null, null],
            ROR: [null, 0x66, 0x76, null, 0x6e, 0x7e, null, null, null, null, null, null, 0x6a],
{'fraction_non_alphanumeric': 0.13899485818543705, 'fraction_numerical': 0.04594460109470891, 'mean_word_length': 2.51779463243874, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6677551', 'n_tokens_mistral': 4628, 'n_tokens_neox': 4268, 'n_words': 1638}