<commit_before>import Hal/Ports

Bochs: class {
  // bochs uses this port to let us print to the bochs console
  PORT_E9 := static 0xE9

  // read http://bochs.sourceforge.net/doc/docbook/development/iodebug.html
  // iodebug command port
  IODEBUG_COMMAND := static 0x8A00

  // this function drops to the debugger in bochs, like a breakpoint
  // only works if you compile bochs with --enable-iodebug and
  // --enable-debugger, which is incompatible with --enable-gdb-stub
  breakpoint: static func {
    Ports outWord(IODEBUG_COMMAND, 0x8A00) // enable the bochs iodebug module
    Ports outWord(IODEBUG_COMMAND, 0x8AE0) // drop to debugger prompt
  }

  printChar: static func (chr: Char) {
    Ports outByte(PORT_E9, chr)
  }

  print: static func (str: String) {
    for(i in 0..str length()) {
      printChar(str[i])
    }
  }

  println: static func (str: String) {
    print(str)
    printChar('\n')
  }

  debug: static func (str: String) {
      print("[DEBUG] ")
      println(str)
  }

  warn: static func (str: String) {
      print("[WARNING] ")
      println(str)
  }

  error: static func (str: String) {
      print("[ERROR] ")
      println(str)
  }
}
<commit_msg>Small changes to Bochs printing functions.<commit_after>import Hal/Ports

Bochs: class {
  // bochs uses this port to let us print to the bochs console
  PORT_E9 := static 0xE9

  // read http://bochs.sourceforge.net/doc/docbook/development/iodebug.html
  // iodebug command port
  IODEBUG_COMMAND := static 0x8A00

  // this function drops to the debugger in bochs, like a breakpoint
  // only works if you compile bochs with --enable-iodebug and
  // --enable-debugger, which is incompatible with --enable-gdb-stub
  breakpoint: static func {
    Ports outWord(IODEBUG_COMMAND, 0x8A00) // enable the bochs iodebug module
    Ports outWord(IODEBUG_COMMAND, 0x8AE0) // drop to debugger prompt
  }

  print: static func ~char (chr: Char) {
    Ports outByte(PORT_E9, chr)
  }

  print: static func ~string (str: String) {
    for(i in 0..str length()) {
      print(str[i])
    }
  }

  println: static func (str: String) {
    print(str)
    print('\n')
  }

  debug: static func (str: String) {
      print("[DEBUG] ")
      println(str)
  }

  warn: static func (str: String) {
      print("[WARNING] ")
      println(str)
  }

  error: static func (str: String) {
      print("[ERROR] ")
      println(str)
  }
}

{'fraction_non_alphanumeric': 0.11786755518533944, 'fraction_numerical': 0.013327780091628489, 'mean_word_length': 2.818759936406995, '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': '5245435', 'n_tokens_mistral': 848, 'n_tokens_neox': 819, 'n_words': 241}