<commit_before>"use strict";

/** @constructor */
function v86(bus)
{
    /** @type {boolean} */
    this.running = false;

    /** @type {boolean} */
    this.stopped = false;

    /** @type {CPU} */
    this.cpu = new CPU();

    this.bus = bus;
    bus.register("cpu-init", this.init, this);
    bus.register("cpu-run", this.run, this);
    bus.register("cpu-stop", this.stop, this);
    bus.register("cpu-restart", this.restart, this);

    this.register_tick();
}

v86.prototype.run = function()
{
    if(!this.running)
    {
        this.bus.send("emulator-started");<commit_msg>Pass bus to CPU when v86 constructor is used<commit_after>"use strict";

/** @constructor */
function v86(bus)
{
    /** @type {boolean} */
    this.running = false;

    /** @type {boolean} */
    this.stopped = false;

    /** @type {CPU} */
    this.cpu = new CPU(bus.pair);

    this.bus = bus;
    bus.register("cpu-init", this.init, this);
    bus.register("cpu-run", this.run, this);
    bus.register("cpu-stop", this.stop, this);
    bus.register("cpu-restart", this.restart, this);

    this.register_tick();
}

v86.prototype.run = function()
{
    if(!this.running)
    {
        this.bus.send("emulator-started");
{'fraction_non_alphanumeric': 0.19437551695616212, 'fraction_numerical': 0.008271298593879239, 'mean_word_length': 2.8050314465408803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '703974', 'n_tokens_mistral': 429, 'n_tokens_neox': 413, 'n_words': 81}