debug.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. "use strict";
  2. CPU.prototype.debug_init = function()
  3. {
  4. var cpu = this;
  5. var debug = {};
  6. this.debug = debug;
  7. /**
  8. * wheter or not in step mode
  9. * used for debugging
  10. * @type {boolean}
  11. */
  12. debug.step_mode = false;
  13. debug.ops = undefined;
  14. debug.all_ops = [];
  15. debug.trace_all = false;
  16. // "log" some information visually to the user.
  17. // Also in non-DEBUG modes
  18. debug.show = function(x)
  19. {
  20. if(typeof document !== "undefined")
  21. {
  22. var el = document.getElementById("log");
  23. if(el)
  24. {
  25. el.textContent += x + "\n";
  26. el.style.display = "block";
  27. el.scrollTop = 1e9;
  28. return;
  29. }
  30. }
  31. console.log(x);
  32. };
  33. debug.init = function()
  34. {
  35. if(!DEBUG) return;
  36. // used for debugging
  37. debug.ops = new CircularQueue(200000);
  38. if(cpu.io)
  39. {
  40. // write seabios debug output to console
  41. var seabios_debug = "";
  42. cpu.io.register_write(0x402, this, handle); // seabios
  43. cpu.io.register_write(0x500, this, handle); // vgabios
  44. }
  45. function handle(out_byte)
  46. {
  47. if(out_byte === 10)
  48. {
  49. dbg_log(seabios_debug, LOG_BIOS);
  50. seabios_debug = "";
  51. }
  52. else
  53. {
  54. seabios_debug += String.fromCharCode(out_byte);
  55. }
  56. }
  57. };
  58. debug.get_regs_short = get_regs_short;
  59. debug.dump_regs = dump_regs_short;
  60. debug.dump_instructions = dump_instructions;
  61. debug.get_instructions = get_instructions;
  62. debug.get_state = get_state;
  63. debug.dump_state = dump_state;
  64. debug.dump_stack = dump_stack;
  65. debug.dump_page_directory = dump_page_directory;
  66. debug.dump_gdt_ldt = dump_gdt_ldt;
  67. debug.dump_idt = dump_idt;
  68. debug.get_memory_dump = get_memory_dump;
  69. debug.memory_hex_dump = memory_hex_dump;
  70. debug.used_memory_dump = used_memory_dump;
  71. debug.step = step;
  72. debug.run_until = run_until;
  73. /**
  74. * @param {string=} msg
  75. */
  76. debug.unimpl = function(msg)
  77. {
  78. var s = "Unimplemented" + (msg ? ": " + msg : "");
  79. debug.show(s);
  80. if(DEBUG)
  81. {
  82. console.trace();
  83. return s;
  84. }
  85. else
  86. {
  87. debug.show("Execution stopped");
  88. return s;
  89. }
  90. //this.name = "Unimplemented";
  91. };
  92. function step()
  93. {
  94. if(!DEBUG) return;
  95. if(!cpu.running)
  96. {
  97. cpu.cycle();
  98. }
  99. dump_regs_short();
  100. var now = Date.now();
  101. cpu.running = false;
  102. dump_instructions();
  103. }
  104. function run_until()
  105. {
  106. if(!DEBUG) return;
  107. cpu.running = false;
  108. var a = parseInt(prompt("input hex", ""), 16);
  109. if(a) while(cpu.instruction_pointer[0] != a) step();
  110. }
  111. // http://ref.x86asm.net/x86reference.xml
  112. // for debuggin" purposes
  113. var opcode_map = [
  114. "ADD", "ADD", "ADD", "ADD", "ADD", "ADD", "PUSH", "POP",
  115. "OR", "OR", "OR", "OR", "OR", "OR", "PUSH", "0F:",
  116. "ADC", "ADC", "ADC", "ADC", "ADC", "ADC", "PUSH", "POP",
  117. "SBB", "SBB", "SBB", "SBB", "SBB", "SBB", "PUSH", "POP",
  118. "AND", "AND", "AND", "AND", "AND", "AND", "ES", "DAA",
  119. "SUB", "SUB", "SUB", "SUB", "SUB", "SUB", "CS", "DAS",
  120. "XOR", "XOR", "XOR", "XOR", "XOR", "XOR", "SS", "AAA",
  121. "CMP", "CMP", "CMP", "CMP", "CMP", "CMP", "DS", "AAS",
  122. "INC", "INC", "INC", "INC", "INC", "INC", "INC", "INC",
  123. "DEC", "DEC", "DEC", "DEC", "DEC", "DEC", "DEC", "DEC",
  124. "PUSH", "PUSH", "PUSH", "PUSH", "PUSH", "PUSH", "PUSH", "PUSH",
  125. "POP", "POP", "POP", "POP", "POP", "POP", "POP", "POP",
  126. "PUSHA", "POPA", "BOUND", "ARPL", "FS", "GS", "none", "none",
  127. "PUSH", "IMUL", "PUSH", "IMUL", "INS", "INS", "OUTS", "OUTS",
  128. "JO", "JNO", "JB", "JNB", "JZ", "JNZ", "JBE", "JNBE",
  129. "JS", "JNS", "JP", "JNP", "JL", "JNL", "JLE", "JNLE",
  130. "ADD", "ADD", "ADD", "ADD", "TEST", "TEST", "XCHG", "XCHG",
  131. "MOV", "MOV", "MOV", "MOV", "MOV", "LEA", "MOV", "POP",
  132. "NOP", "XCHG", "XCHG", "XCHG", "XCHG", "XCHG", "XCHG", "XCHG",
  133. "CBW", "CWD", "CALLF", "FWAIT", "PUSHF", "POPF", "SAHF", "LAHF",
  134. "MOV", "MOV", "MOV", "MOV", "MOVS", "MOVS", "CMPS", "CMPS",
  135. "TEST", "TEST", "STOS", "STOS", "LODS", "LODS", "SCAS", "SCAS",
  136. "MOV", "MOV", "MOV", "MOV", "MOV", "MOV", "MOV", "MOV",
  137. "MOV", "MOV", "MOV", "MOV", "MOV", "MOV", "MOV", "MOV",
  138. "ROL", "ROL", "RETN", "RETN", "LES", "LDS", "MOV", "MOV",
  139. "ENTER", "LEAVE", "RETF", "RETF", "INT", "INT", "INTO", "IRET",
  140. "ROL", "ROL", "ROL", "ROL", "AAM", "AAD", "none", "XLAT",
  141. "FADD", "FLD", "FIADD", "FILD", "FADD", "FLD", "FIADD", "FILD",
  142. "LOOPNZ", "LOOPZ", "LOOP", "JCXZ", "IN", "IN", "OUT", "OUT",
  143. "CALL", "JMP", "JMPF", "JMP", "IN", "IN", "OUT", "OUT",
  144. "LOCK", "none", "REPNZ", "REPZ", "HLT", "CMC", "TEST", "TEST",
  145. "CLC", "STC", "CLI", "STI", "CLD", "STD", "INC", "INC"
  146. ];
  147. debug.logop = function(_ip, op)
  148. {
  149. if(!DEBUG || !debug.step_mode)
  150. {
  151. return;
  152. }
  153. _ip = _ip >>> 0;
  154. if(debug.trace_all && debug.all_ops)
  155. {
  156. debug.all_ops.push(_ip, op);
  157. }
  158. else if(debug.ops)
  159. {
  160. debug.ops.add(_ip);
  161. debug.ops.add(op);
  162. }
  163. };
  164. function dump_stack(start, end)
  165. {
  166. if(!DEBUG) return;
  167. var esp = cpu.reg32[reg_esp];
  168. dbg_log("========= STACK ==========");
  169. if(end >= start || end === undefined)
  170. {
  171. start = 5;
  172. end = -5;
  173. }
  174. for(var i = start; i > end; i--)
  175. {
  176. var line = " ";
  177. if(!i) line = "=> ";
  178. line += h(i, 2) + " | ";
  179. dbg_log(line + h(esp + 4 * i, 8) + " | " + h(cpu.read32s(esp + 4 * i) >>> 0));
  180. }
  181. }
  182. function get_state(where)
  183. {
  184. if(!DEBUG) return;
  185. var mode = cpu.protected_mode[0] ? "prot" : "real";
  186. var vm = (cpu.flags[0] & flag_vm) ? 1 : 0;
  187. var flags = cpu.get_eflags();
  188. var iopl = cpu.getiopl();
  189. var cpl = cpu.cpl[0];
  190. var cs_eip = h(cpu.sreg[reg_cs], 4) + ":" + h(cpu.get_real_eip() >>> 0, 8);
  191. var ss_esp = h(cpu.sreg[reg_ss], 4) + ":" + h(cpu.reg32s[reg_es] >>> 0, 8);
  192. var op_size = cpu.is_32[0] ? "32" : "16";
  193. var if_ = (cpu.flags[0] & flag_interrupt) ? 1 : 0;
  194. var flag_names = {
  195. [flag_carry]: "c",
  196. [flag_parity]: "p",
  197. [flag_adjust]: "a",
  198. [flag_zero]: "z",
  199. [flag_sign]: "s",
  200. [flag_trap]: "t",
  201. [flag_interrupt]: "i",
  202. [flag_direction]: "d",
  203. [flag_overflow]: "o",
  204. };
  205. var flag_string = "";
  206. for(var i = 0; i < 16; i++)
  207. {
  208. if(flag_names[1 << i])
  209. {
  210. if(flags & 1 << i)
  211. {
  212. flag_string += flag_names[1 << i];
  213. }
  214. else
  215. {
  216. flag_string += " ";
  217. }
  218. }
  219. }
  220. return ("mode=" + mode + "/" + op_size + " paging=" + (+cpu.paging[0]) +
  221. " iopl=" + iopl + " cpl=" + cpl + " if=" + if_ + " cs:eip=" + cs_eip +
  222. " cs_off=" + h(cpu.get_seg(reg_cs) >>> 0, 8) +
  223. " flgs=" + h(cpu.get_eflags() >>> 0, 6) + " (" + flag_string + ")" +
  224. " ss:esp=" + ss_esp +
  225. " ssize=" + (+cpu.stack_size_32[0]) +
  226. (where ? " in " + where : ""));
  227. }
  228. function dump_state(where)
  229. {
  230. if(!DEBUG) return;
  231. dbg_log(get_state(where), LOG_CPU);
  232. }
  233. function get_regs_short()
  234. {
  235. var
  236. r32 = { "eax": reg_eax, "ecx": reg_ecx, "edx": reg_edx, "ebx": reg_ebx,
  237. "esp": reg_esp, "ebp": reg_ebp, "esi": reg_esi, "edi": reg_edi },
  238. r32_names = ["eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"],
  239. s = { "cs": reg_cs, "ds": reg_ds, "es": reg_es, "fs": reg_fs, "gs": reg_gs, "ss": reg_ss },
  240. line1 = "",
  241. line2 = "";
  242. for(var i = 0; i < 4; i++)
  243. {
  244. line1 += r32_names[i] + "=" + h(cpu.reg32[r32[r32_names[i]]], 8) + " ";
  245. line2 += r32_names[i+4] + "=" + h(cpu.reg32[r32[r32_names[i+4]]], 8) + " ";
  246. }
  247. //line1 += " eip=" + h(cpu.get_real_eip() >>> 0, 8);
  248. //line2 += " flg=" + h(cpu.get_eflags(), 8);
  249. line1 += " ds=" + h(cpu.sreg[reg_ds], 4) + " es=" + h(cpu.sreg[reg_es], 4) + " fs=" + h(cpu.sreg[reg_fs], 4);
  250. line2 += " gs=" + h(cpu.sreg[reg_gs], 4) + " cs=" + h(cpu.sreg[reg_cs], 4) + " ss=" + h(cpu.sreg[reg_ss], 4);
  251. return [line1, line2];
  252. }
  253. function dump_regs_short()
  254. {
  255. if(!DEBUG) return;
  256. var lines = get_regs_short();
  257. dbg_log(lines[0], LOG_CPU);
  258. dbg_log(lines[1], LOG_CPU);
  259. }
  260. function get_instructions()
  261. {
  262. if(!DEBUG) return;
  263. debug.step_mode = true;
  264. function add(ip, op)
  265. {
  266. out += h(ip, 8) + ": " +
  267. v86util.pads(opcode_map[op] || "unkown", 20) + h(op, 2) + "\n";
  268. }
  269. var opcodes;
  270. var out = "";
  271. if(debug.trace_all && debug.all_ops)
  272. {
  273. opcodes = debug.all_ops;
  274. }
  275. else if(debug.ops)
  276. {
  277. opcodes = debug.ops.toArray();
  278. }
  279. if(!opcodes)
  280. {
  281. return "";
  282. }
  283. for(var i = 0; i < opcodes.length; i += 2)
  284. {
  285. add(opcodes[i], opcodes[i + 1]);
  286. }
  287. debug.ops.clear();
  288. debug.all_ops = [];
  289. return out;
  290. }
  291. function dump_instructions()
  292. {
  293. if(!DEBUG) return;
  294. debug.show(get_instructions());
  295. }
  296. function dump_gdt_ldt()
  297. {
  298. if(!DEBUG) return;
  299. dbg_log("gdt: (len = " + h(cpu.gdtr_size[0]) + ")");
  300. dump_table(cpu.translate_address_system_read(cpu.gdtr_offset[0]), cpu.gdtr_size[0]);
  301. dbg_log("\nldt: (len = " + h(cpu.segment_limits[reg_ldtr]) + ")");
  302. dump_table(cpu.translate_address_system_read(cpu.segment_offsets[reg_ldtr]), cpu.segment_limits[reg_ldtr]);
  303. function dump_table(addr, size)
  304. {
  305. for(var i = 0; i < size; i += 8, addr += 8)
  306. {
  307. var base = cpu.read16(addr + 2) |
  308. cpu.read8(addr + 4) << 16 |
  309. cpu.read8(addr + 7) << 24,
  310. limit = cpu.read16(addr) | (cpu.read8(addr + 6) & 0xF) << 16,
  311. access = cpu.read8(addr + 5),
  312. flags = cpu.read8(addr + 6) >> 4,
  313. flags_str = "",
  314. dpl = access >> 5 & 3;
  315. if(!(access & 128))
  316. {
  317. // present bit not set
  318. //continue;
  319. flags_str += "NP ";
  320. }
  321. else
  322. {
  323. flags_str += " P ";
  324. }
  325. if(access & 16)
  326. {
  327. if(flags & 4)
  328. {
  329. flags_str += "32b ";
  330. }
  331. else
  332. {
  333. flags_str += "16b ";
  334. }
  335. if(access & 8)
  336. {
  337. // executable
  338. flags_str += "X ";
  339. if(access & 4)
  340. {
  341. flags_str += "C ";
  342. }
  343. }
  344. else
  345. {
  346. // data
  347. flags_str += "R ";
  348. }
  349. flags_str += "RW ";
  350. }
  351. else
  352. {
  353. // system
  354. flags_str += "sys: " + h(access & 15);
  355. }
  356. if(flags & 8)
  357. {
  358. limit = limit << 12 | 0xFFF;
  359. }
  360. dbg_log(h(i & ~7, 4) + " " + h(base >>> 0, 8) + " (" + h(limit >>> 0, 8) + " bytes) " +
  361. flags_str + "; dpl = " + dpl + ", a = " + access.toString(2) +
  362. ", f = " + flags.toString(2));
  363. }
  364. }
  365. }
  366. function dump_idt()
  367. {
  368. if(!DEBUG) return;
  369. for(var i = 0; i < cpu.idtr_size[0]; i += 8)
  370. {
  371. var addr = cpu.translate_address_system_read(cpu.idtr_offset[0] + i),
  372. base = cpu.read16(addr) | cpu.read16(addr + 6) << 16,
  373. selector = cpu.read16(addr + 2),
  374. type = cpu.read8(addr + 5),
  375. line,
  376. dpl = type >> 5 & 3;
  377. if((type & 31) === 5)
  378. {
  379. line = "task gate ";
  380. }
  381. else if((type & 31) === 14)
  382. {
  383. line = "intr gate ";
  384. }
  385. else if((type & 31) === 15)
  386. {
  387. line = "trap gate ";
  388. }
  389. else
  390. {
  391. line = "invalid ";
  392. }
  393. if(type & 128)
  394. {
  395. line += " P";
  396. }
  397. else
  398. {
  399. // present bit not set
  400. //continue;
  401. line += "NP";
  402. }
  403. dbg_log(h(i >> 3, 4) + " " + h(base >>> 0, 8) + ", " +
  404. h(selector, 4) + "; " + line + "; dpl = " + dpl + ", t = " + type.toString(2));
  405. }
  406. }
  407. function load_page_entry(dword_entry, is_directory)
  408. {
  409. if(!DEBUG) return;
  410. if(!(dword_entry & 1))
  411. {
  412. // present bit not set
  413. return false;
  414. }
  415. var size = (dword_entry & 128) === 128,
  416. address;
  417. if(size && !is_directory)
  418. {
  419. address = dword_entry & 0xFFC00000;
  420. }
  421. else
  422. {
  423. address = dword_entry & 0xFFFFF000;
  424. }
  425. return {
  426. size: size,
  427. global: (dword_entry & 256) === 256,
  428. accessed: (dword_entry & 0x20) === 0x20,
  429. dirty: (dword_entry & 0x40) === 0x40,
  430. cache_disable : (dword_entry & 16) === 16,
  431. user : (dword_entry & 4) === 4,
  432. read_write : (dword_entry & 2) === 2,
  433. address : address >>> 0
  434. };
  435. }
  436. function dump_page_directory()
  437. {
  438. if(!DEBUG) return;
  439. for(var i = 0; i < 1024; i++)
  440. {
  441. var addr = cpu.cr[3] + 4 * i;
  442. var dword = cpu.read32s(addr),
  443. entry = load_page_entry(dword, true);
  444. if(!entry)
  445. {
  446. continue;
  447. }
  448. var flags = "";
  449. flags += entry.size ? "S " : " ";
  450. flags += entry.accessed ? "A " : " ";
  451. flags += entry.cache_disable ? "Cd " : " ";
  452. flags += entry.user ? "U " : " ";
  453. flags += entry.read_write ? "Rw " : " ";
  454. if(entry.size)
  455. {
  456. dbg_log("=== " + h((i << 22) >>> 0, 8) + " -> " + h(entry.address >>> 0, 8) + " | " + flags);
  457. continue;
  458. }
  459. else
  460. {
  461. dbg_log("=== " + h((i << 22) >>> 0, 8) + " | " + flags);
  462. }
  463. for(var j = 0; j < 1024; j++)
  464. {
  465. var sub_addr = entry.address + 4 * j;
  466. dword = cpu.read32s(sub_addr);
  467. var subentry = load_page_entry(dword, false);
  468. if(subentry)
  469. {
  470. flags = "";
  471. flags += subentry.cache_disable ? "Cd " : " ";
  472. flags += subentry.user ? "U " : " ";
  473. flags += subentry.read_write ? "Rw " : " ";
  474. flags += subentry.global ? "G " : " ";
  475. flags += subentry.accessed ? "A " : " ";
  476. flags += subentry.dirty ? "Di " : " ";
  477. dbg_log("# " + h((i << 22 | j << 12) >>> 0, 8) + " -> " +
  478. h(subentry.address, 8) + " | " + flags + " (at " + h(sub_addr, 8) + ")");
  479. }
  480. }
  481. }
  482. }
  483. function get_memory_dump(start, count)
  484. {
  485. if(!DEBUG) return;
  486. if(start === undefined)
  487. {
  488. start = 0;
  489. count = cpu.memory_size[0];
  490. }
  491. else if(count === undefined)
  492. {
  493. count = start;
  494. start = 0;
  495. }
  496. return cpu.mem8.slice(start, start + count).buffer;
  497. }
  498. function memory_hex_dump(addr, length)
  499. {
  500. if(!DEBUG) return;
  501. length = length || 4 * 0x10;
  502. var line, byt;
  503. for(var i = 0; i < length >> 4; i++)
  504. {
  505. line = h(addr + (i << 4), 5) + " ";
  506. for(var j = 0; j < 0x10; j++)
  507. {
  508. byt = cpu.read8(addr + (i << 4) + j);
  509. line += h(byt, 2) + " ";
  510. }
  511. line += " ";
  512. for(j = 0; j < 0x10; j++)
  513. {
  514. byt = cpu.read8(addr + (i << 4) + j);
  515. line += (byt < 33 || byt > 126) ? "." : String.fromCharCode(byt);
  516. }
  517. dbg_log(line);
  518. }
  519. }
  520. function used_memory_dump()
  521. {
  522. if(!DEBUG) return;
  523. var width = 0x80,
  524. height = 0x10,
  525. block_size = cpu.memory_size[0] / width / height | 0,
  526. row;
  527. for(var i = 0; i < height; i++)
  528. {
  529. row = h(i * width * block_size, 8) + " | ";
  530. for(var j = 0; j < width; j++)
  531. {
  532. var used = cpu.mem32s[(i * width + j) * block_size] > 0;
  533. row += used ? "X" : " ";
  534. }
  535. dbg_log(row);
  536. }
  537. }
  538. debug.debug_interrupt = function(interrupt_nr)
  539. {
  540. //if(interrupt_nr === 0x20)
  541. //{
  542. // //var vxd_device = cpu.safe_read16(cpu.instruction_pointer + 2);
  543. // //var vxd_sub = cpu.safe_read16(cpu.instruction_pointer + 0);
  544. // //var service = "";
  545. // //if(vxd_device === 1)
  546. // //{
  547. // // service = vxd_table1[vxd_sub];
  548. // //}
  549. // //dbg_log("vxd: " + h(vxd_device, 4) + " " + h(vxd_sub, 4) + " " + service);
  550. //}
  551. //if(interrupt_nr >= 0x21 && interrupt_nr < 0x30)
  552. //{
  553. // dbg_log("dos: " + h(interrupt_nr, 2) + " ah=" + h(this.reg8[reg_ah], 2) + " ax=" + h(this.reg16[reg_ax], 4));
  554. //}
  555. //if(interrupt_nr === 0x13 && (this.reg8[reg_ah] | 1) === 0x43)
  556. //{
  557. // this.debug.memory_hex_dump(this.get_seg(reg_ds) + this.reg16[reg_si], 0x18);
  558. //}
  559. //if(interrupt_nr == 0x10)
  560. //{
  561. // dbg_log("int10 ax=" + h(this.reg16[reg_ax], 4) + " '" + String.fromCharCode(this.reg8[reg_al]) + "'");
  562. // this.debug.dump_regs_short();
  563. // if(this.reg8[reg_ah] == 0xe) vga.tt_write(this.reg8[reg_al]);
  564. //}
  565. //if(interrupt_nr === 0x13)
  566. //{
  567. // this.debug.dump_regs_short();
  568. //}
  569. //if(interrupt_nr === 6)
  570. //{
  571. // this.instruction_pointer += 2;
  572. // dbg_log("BUG()", LOG_CPU);
  573. // dbg_log("line=" + this.read_imm16() + " " +
  574. // "file=" + this.read_string(this.translate_address_read(this.read_imm32s())), LOG_CPU);
  575. // this.instruction_pointer -= 8;
  576. // this.debug.dump_regs_short();
  577. //}
  578. //if(interrupt_nr === 0x80)
  579. //{
  580. // dbg_log("linux syscall");
  581. // this.debug.dump_regs_short();
  582. //}
  583. //if(interrupt_nr === 0x40)
  584. //{
  585. // dbg_log("kolibri syscall");
  586. // this.debug.dump_regs_short();
  587. //}
  588. };
  589. };