<commit_before>#include <iostream>
#include <fstream>

#include <cpu.hpp>

int main(int argc, char const* argv[])
{
    using namespace narcissus;
    using namespace std;


    fstream file;
    char buf[16];
    array<uint8_t, cpu::ROM_SIZE> mem = {0};

    if(argc < 2){
        return -1;
    }
    file.open(argv[1], ios::in | ios::binary);

    auto i = 0;
//     cout <<endl;
    while (!file.eof()) {
        file.read(buf, sizeof(buf));
        for(auto j = 0; j < file.gcount(); j++){
            mem[i++] = buf[j];
//             cout <<  buf[j] << flush;
        }
    }

    file.close();

    
//     mem[0] = 0x00;
//     mem[1] = 0x00;
//     mem[2] = 0x01;
//     mem[3] = 0x00;

    // ADD.B #0xff, r2l
//     mem[0x100] = 0x8a;
//     mem[0x101] = 0xff;
//     cout << hex << (uint16_t)mem[0] << (uint16_t)mem[1] 
//         << (uint16_t)mem[2] << (uint16_t)mem[3] << endl;

    cpu::h8_300 cpu(move(mem));
    cpu.reset_exception();

    while (cpu.cycle()) {

    }

//     if(!cpu.cycle()){
//         cout << "cycle failed" << endl;
//     }
    
    return 0;
}<commit_msg>fix a method<commit_after>#include <iostream>
#include <fstream>

#include <cpu.hpp>

auto main(int argc, char const* argv[]) -> int
{
    using namespace narcissus;
    using namespace std;


    fstream file;
    char buf[16];
    array<uint8_t, cpu::ROM_SIZE> mem = {0};

    if(argc < 2){
        return -1;
    }
    file.open(argv[1], ios::in | ios::binary);

    auto i = 0;
//     cout <<endl;
    while (!file.eof()) {
        file.read(buf, sizeof(buf));
        for(auto j = 0; j < file.gcount(); j++){
            mem[i++] = buf[j];
//             cout <<  buf[j] << flush;
        }
    }

    file.close();

    
//     mem[0] = 0x00;
//     mem[1] = 0x00;
//     mem[2] = 0x01;
//     mem[3] = 0x00;

    // ADD.B #0xff, r2l
//     mem[0x100] = 0x8a;
//     mem[0x101] = 0xff;
//     cout << hex << (uint16_t)mem[0] << (uint16_t)mem[1] 
//         << (uint16_t)mem[2] << (uint16_t)mem[3] << endl;

    cpu::h8_300 cpu(move(mem));
    cpu.reset_exception();

    while (cpu.cycle()) {

    }

//     if(!cpu.cycle()){
//         cout << "cycle failed" << endl;
//     }
}
{'fraction_non_alphanumeric': 0.20669110907424382, 'fraction_numerical': 0.04995417048579285, 'mean_word_length': 1.8837516512549537, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 12, 'https://': 0, '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': '1143371', 'n_tokens_mistral': 943, 'n_tokens_neox': 870, 'n_words': 177}