You are on page 1of 21

<!-- saved from url=(0060)http://icps.

u-
strasbg.fr/people/bastoul/public_html/cardiac/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-
1252">
<title>Cardiac 4.3</title>
<style type="text/css">
table#memory input {
width: 3em;
}
span#state {
font-weight: bold;
color: red;
}
/* Placeholder style (content of non-initialized memory cells) */
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
opacity: 0.4;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
opacity: 0.4;
}
::-ms-input-placeholder { /* Microsoft Edge */
opacity: 0.4;
}
</style>
<script>

var lang_fr = {
cardiac_simulator : 'Simulateur Cardiac',
processor : 'Processeur',
program_counter : 'Compteur ordinal (CO) :',
instruction_register : 'Registre d&apos;instruction :',
instruction_decoder : 'D&eacute;codeur d&apos;instruction :',
instruction : 'Instruction :',
operand : 'Op&eacute;rande :',
accumulator : 'Accumulateur (Acc) :',
reset : 'Reset',
clear_memory : 'Vider la memoire',
step : 'Pas',
slow : 'Lent',
run : 'Executer',
stop : 'Arreter',
opcode : 'Opcode',
name : 'Nom',
operation : 'Op&eacute;ration (@ est l&apos;adresse en op&eacute;rande)',
main_memory : 'M&eacute;moire centrale et entr&eacute;e/sortie',
card : 'Ruban',
input : 'Entr&eacute;e',
load : 'Charger ruban',
output : 'Sortie',
assemble : 'Assembler',
load_to_memory : 'Charger le programme en memoire',
load_to_input : 'Charger le programme en ruban bootable',
compiling : 'Compilation...\n',
invalid_address : 'adresse invalide',
redefined_label : 'label redéfini',
syntax_error : 'erreur de syntaxe',
address_resolution : 'Résolution des adresses...\n',
conflict : 'recouvre la ligne ',
undefined_symbol : 'symbole indéfini',
failure : 'Échec\n',
loading : 'Chargement...\n',
pc_unset : 'Compteur ordinal non positionn&eacute;, pas
d&apos;instruction...\n',
bootstrap : 'Bootstrap...\n',
cell_too_low : 'Impossible, la première cellule doit être > 2.\n',
halt_after_bootstrap : 'Halt après bootstrap.\n',
ok : 'OK\n',
infinite_loop : 'Nombre maximum de cycles atteint : boucle infinie ?',
illegal_instruction : 'Instruction ill&eacute;gale',
input_failed : 'INP a &eacute;chou&eacute; (entr&eacute;e vide ?)',
jaz : 'if (Acc == 0) { Mem[99] = 800 + CO; CO = @; }',
logo : 'http://icps.u-
strasbg.fr/people/bastoul/public_html/teaching/architecture/images/bai_unistra.png'
,
};

var lang_us = {
cardiac_simulator : 'Cardiac Simulator',
processor : 'Processor',
program_counter : 'Program Counter (PC):',
instruction_register : 'Instruction Register:',
instruction_decoder : 'Instruction Decoder:',
instruction : 'Instruction:',
operand : 'Operand:',
accumulator : 'Accumulator (Acc):',
reset : 'Reset',
clear_memory : 'Clear Memory',
step : 'Step',
slow : 'Slow',
run : 'Run',
stop : 'Stop',
opcode : 'Opcode',
name : 'Name',
operation : 'Operation (@ is the operand address)',
main_memory : 'Main Memory and Input/Output',
card : 'Card',
input : 'Input',
load : 'Load Card',
output : 'Output',
assemble : 'Assemble',
load_to_memory : 'Load program to memory',
load_to_input : 'Load program to input',
compiling : 'Compiling...\n',
invalid_address : 'invalid adress',
redefined_label : 'redefined label',
syntax_error : 'syntax error',
address_resolution : 'Address resolution...\n',
conflict : 'conflicts with line ',
undefined_symbol : 'undefined symbol',
failure : 'Failure\n',
loading : 'Loading...\n',
pc_unset : 'Program counter is not set, no instruction...\n',
bootstrap : 'Bootstrap...\n',
cell_too_low : 'Impossible, the first cell must be > 2.\n',
halt_after_bootstrap : 'Halt after bootstrap.\n',
ok : 'OK\n',
infinite_loop : 'Maximum number of cycles reached: infinite loop?',
illegal_instruction : 'Illegal instruction',
input_failed : 'INP failed (empty input?)',
jaz : 'if (Acc == 0) { Mem[99] = 800 + PC; PC = @; }',
logo : 'http://icps.u-
strasbg.fr/people/bastoul/public_html/teaching/architecture/images/bai_ufaz.png'
};

// Set the language (at some point I should add a switch :-) !)
var lang = lang_fr;
// The function below takes an instance of such a dictionary.

// Scan the document and reset language.


// Note: internationaliezd elements (<span> or <input>) must carry
// an id, *and* class="i18n". The id is used to index into the
// lang dictionary. If you see "????????" on the page, you either
// abused class="i18n" or mistyped the id.
function change_lang (l) {
lang = l;
var texts = document.getElementsByClassName('i18n');
for ( var i=0 ; i<texts.length ; i++ ) {
var elt = texts[i]
var txt = (elt.id in lang ? lang[elt.id] : "????????");
// if (this instanceof HTMLInputElement)
if (elt.tagName.toLowerCase() == "input")
elt.value = txt;
else
elt.innerHTML = txt;
}
document.getElementById('logo').setAttribute('src', lang.logo);
}

// Constants
var OPCODES = { INP:0,OUT:1,LDA:2,LDI:3,STA:4,STI:5,ADD:6,SUB:7,JAZ:8,HRS:9};
var OPCNAMES = ['INP','OUT','LDA','LDI','STA','STI','ADD','SUB','JAZ','HRS'];
var COLOR_PC = '#99FFCC';
var COLOR_IR = '#fe2e2e';
var COLOR_IN = '#f6cac9';
var COLOR_OP = '#6eb5ff';
var COLOR_HS = '#FF0000';
var MAX_STEP = 100000;

// Elements from the document


var e_cpu, e_state;
var e_pc;
var e_ir; // keep pc of current IR contents
var e_ir_src, e_ir_opcode, e_ir_operand;
var e_acc;
var e_deck, e_input, e_output;

// Globals
var autorun;
var autorun_id;
var nb_steps;

function init() {
autorun = false;
nb_steps = 0;
e_cpu = document.getElementById('cpu');
e_state = document.getElementById('state');
e_pc = document.getElementById('pc');
e_ir_src = document.getElementById('ir_src');
e_ir = document.getElementById('ir');
e_ir_opcode = document.getElementById('ir_opcode');
e_ir_operand = document.getElementById('ir_operand');
e_acc = document.getElementById('acc');
e_deck = document.getElementById('deck');
e_indeck = document.getElementById('indeck');
e_outdeck = document.getElementById('outdeck');
document.getElementById('reset').setAttribute('value', lang.reset);
document.getElementById('clear_memory').setAttribute('value',
lang.clear_memory);
document.getElementById('step').setAttribute('value', lang.step);
document.getElementById('slow').setAttribute('value', lang.slow);
document.getElementById('run').setAttribute('value', lang.run);
document.getElementById('stop').setAttribute('value', lang.stop);
document.getElementById('load').setAttribute('value', lang.load);
document.getElementById('assemble').setAttribute('value', lang.assemble);
document.getElementById('load_to_memory').setAttribute('value',
lang.load_to_memory);
document.getElementById('load_to_input').setAttribute('value',
lang.load_to_input);
document.getElementById('logo').setAttribute('src', lang.logo);
}

function hidepc() {
var pcs = e_pc.value;
var oldpc = document.getElementById('mem'+ndig(pcs, 2));
// See http://stackoverflow.com/questions/3506050/how-to-reset-the-style-
properties-to-their-css-defaults-in-javascript
oldpc.style.backgroundColor = '';
oldpc.style.color = '';
}
function showpc() {
var pcs = e_pc.value;
var newpc = document.getElementById('mem'+ndig(pcs, 2));
newpc.style.backgroundColor = COLOR_PC;
}
function hideir() {
var pcs = ir_src.value;
var insn = document.getElementById('mem'+ndig(pcs, 2));
insn.style.color = '';
var code = Number(insn.value);
var opc = Math.floor(code / 100);
var opr = code % 100;
document.getElementById('opc'+opc).style.backgroundColor = '';
document.getElementById('mem'+ndig(opr,2)).style.backgroundColor = '';
e_ir.value = '';
e_ir_opcode.value = '';
e_ir_operand.value = '';
}
function showir() {
var pcs = e_pc.value;
ir_src.value = pcs;
var insn = document.getElementById('mem'+ndig(pcs, 2));
insn.style.color = COLOR_IR;
var code = Number(insn.value);
var opc = Math.floor(code / 100);
var opr = code % 100;
document.getElementById('opc'+opc).style.backgroundColor = COLOR_IN;
if (opc != OPCODES.HRS) {
document.getElementById('mem'+ndig(opr,2)).style.backgroundColor = COLOR_OP;
}
e_ir.value = ndig(code,3);
e_ir_opcode.value = OPCNAMES[opc];
e_ir_operand.value = ndig(opr, 2);
}

function doreset() {
e_cpu.style.backgroundColor = '';
e_state.innerHTML = '';
hidepc();
hideir();
e_pc.value = '00';
showpc();
e_ir_src.value = '';
e_ir.value = '';
e_ir_opcode.value = '';
e_ir_operand.value = '';
e_acc.value = '0000';
document.getElementById('clear_memory').disabled = false;
document.getElementById('step').disabled = false;
document.getElementById('slow').disabled = false;
document.getElementById('run').disabled = false;
document.getElementById('stop').disabled = false;
e_outdeck.value = '';
nb_steps = 0;
}

// Return the string composed with the n last characters of the conversion
// of val to string with leading zeros.
function ndig(val, n) {
if (val < 0) {
return '-'+('00000' + (-val)).slice(-n);
} else {
return ('00000' + val).slice(-n);
}
}

function doclearmem() {
document.getElementById('mem00').value='001';
for (var i = 1; i < 99; ++i) {
var pos = ndig(i, 2);
var mem = document.getElementById('mem'+pos);
mem.value = '';
mem.title = '';
// FIXME: labels
document.getElementById('lbl'+pos).innerHTML = pos;
document.getElementById('equ'+pos).innerHTML = '';
}
document.getElementById('lbl99').innerHTML = '99 (ra)';
document.getElementById('mem99').value=''+OPCODES.JAZ+'??';
}

function doload() {
// Make sure the input ends with a newline
var s = e_deck.value;
if ( s.slice(-1) != '\n' )
s += '\n';
e_indeck.value = s;
}

function get_input() {
var s = e_indeck.value;
var p = s.indexOf('\n');
if ( p == -1 ) {
e_indeck.value = '';
return s;
}
else {
e_indeck.value = s.slice(p+1);
return s.slice(0,p);
}
}

function crash(msg) {
autorun = false;
e_cpu.style.backgroundColor = COLOR_HS;
e_state.innerHTML = ' (CRASH : '+msg+')';
document.getElementById('clear_memory').disabled = true;
document.getElementById('step').disabled = true;
document.getElementById('slow').disabled = true;
document.getElementById('run').disabled = true;
document.getElementById('stop').disabled = true;
}

// Utilities
function fetch(addr) {
return Number(document.getElementById('mem'+ndig(addr, 2)).value);
}
function store(addr, val) {
document.getElementById('mem'+ndig(addr, 2)).value = ndig(val, 3);
}

// Main do... functions

function dostep() {
if ( e_state.innerHTML != '' )
return;
if (nb_steps > MAX_STEP) {
crash(lang.infinite_loop);
return;
}

// Fetch (+ some decode)


hideir();
var pc = Number(e_pc.value);
var ir = document.getElementById('mem'+ndig(pc, 2)).value;
if (ir == '' ) {
showpc();
crash(lang.illegal_instruction);
return;
}
hidepc(); // subtle order with next, for coloring
showir();
var acc = Number(e_acc.value);
++pc;
// Decode
var opc = Math.floor(ir / 100);
var addr = ir % 100;
// Execute
switch (opc) {
case OPCODES.INP: // INP - Input
var s = get_input();
if (s == '') {
crash(lang.input_failed);
return;
} else {
store(addr, Number(s));
}
break;
case OPCODES.OUT: // OUT - Output
e_outdeck.value += ndig(fetch(addr), 3)+'\n';
break;
case OPCODES.LDA: // LDA - Load to Acc
acc = fetch(addr);
break;
case OPCODES.LDI: // LDI - Load indirect
acc = fetch(fetch(addr));
break;
case OPCODES.STA: // STA - Store
store(addr, acc);
break;
case OPCODES.STI: // STI - Store indirect
store(fetch(addr), acc);
break;
case OPCODES.ADD: // ADD - Add
acc += fetch(addr);
acc %= 10000;
break;
case OPCODES.SUB: // SUB - Subtract
acc -= fetch(addr);
if (acc < 0) {
acc = 0;
}
break;
case OPCODES.JAZ: // JAZ - Test accumulator
if (acc == 0) {
store(99, pc+(OPCODES.JAZ*100));
pc = addr;
}
break;
case OPCODES.HRS: // HRS - Halt and reset
autorun = false;
acc = 0;
pc = 0;
break;
}
e_pc.value = ndig(pc, 2);
e_acc.value = ndig(acc, 4);
nb_steps++;
showpc();
}

function dorstep() {
if (autorun == false)
clearInterval(autorun_id);
else
dostep();
}

function doslow() {
if ( e_state.innerHTML != '' )
return;
autorun = true;
autorun_id = setInterval(dorstep, 500);
}

function dorun() {
if ( e_state.innerHTML != '' )
return;
autorun = true;
while (autorun)
dostep();
}

</script>
</head><body bgcolor="#F7F7F7">
<img id="logo" style="float:right;" height="50px" alt="BAI" align="bottom"
src="./Cardiac_files/bai_unistra.png">
<!-- <h1>Simulateur Cardiac</h1> -->
<h1 style="line-height:50px;"><span class="i18n" id="cardiac_simulator">Simulateur
Cardiac</span>
<span style="font-size:small">[<span onclick="change_lang(lang_fr)">FR</span>|<span
onclick="change_lang(lang_us)">EN</span>]</span></h1>
<div style="clear:both;"></div>
<hr>

<center>
<h2><span class="i18n" id="processor">Processeur</span><span
id="state"></span></h2>

<table>
<tbody>
<tr>
<td style="border:solid 1px black;">
<table id="cpu">
<tbody>
<tr>
<td>
<center>
<span class="i18n" id="program_counter">Compteur ordinal (CO) :</span>
<input type="text" id="pc" size="2em" style="border-color:#99FFCC"
onkeydown="hidepc();" onkeyup="showpc();">
<hr>
<span class="i18n" id="instruction_register">Registre d'instruction :</span>
<input type="text" id="ir" size="3em" style="color:#fe2e2e" readonly=""><br>
<hr>
<span class="i18n" id="instruction_decoder">D�codeur d'instruction :</span>
<input type="hidden" id="ir_src" value="">
<br>
<span class="i18n" id="instruction">Instruction :</span>
<input type="text" id="ir_opcode" size="3em" style="border-color:#f6cac9"
readonly="">
<span class="i18n" id="operand">Op�rande :</span>
<input type="text" id="ir_operand" size="2em" style="border-color:#6eb5ff"
readonly="">
<hr>
<span class="i18n" id="accumulator">Accumulateur (Acc) :</span>
<input type="text" id="acc" size="5em" readonly="">
<hr>
<input type="button" class="i18n" id="reset" onclick="doreset();"
value="Reset">
<input type="button" class="i18n" id="clear_memory" onclick="doclearmem();"
value="Vider la memoire">
<br>
<input type="button" class="i18n" id="step" onclick="dostep();" value="Pas">
<input type="button" class="i18n" id="slow" onclick="doslow();" value="Lent">
<input type="button" class="i18n" id="run" onclick="dorun();"
value="Executer">
<input type="button" class="i18n" id="stop" onclick="autorun = 0;"
value="Arreter">
</center>
</td>
<td>
<table border="1" style="font-size:80%;">
<thead>
<tr><th><span class="i18n" id="opcode">Opcode</span></th>
<th><span class="i18n" id="name">Nom</span></th>
<th><span class="i18n" id="operation">Op�ration (@ est l'adresse en
op�rande)</span></th>
</tr></thead>
<tbody>
<tr id="opc0"><td align="center">0</td><td>INP</td><td>Mem[@] =
Input</td></tr>
<tr id="opc1"><td align="center">1</td><td>OUT</td><td>Output =
Mem[@]</td></tr>
<tr id="opc2"><td align="center">2</td><td>LDA</td><td>Acc = Mem[@]</td></tr>
<tr id="opc3"><td align="center">3</td><td>LDI</td><td>Acc =
Mem[Mem[@]]</td></tr>
<tr id="opc4"><td align="center">4</td><td>STA</td><td>Mem[@] = Acc</td></tr>
<tr id="opc5"><td align="center">5</td><td>STI</td><td>Mem[Mem[@]] =
Acc</td></tr>
<tr id="opc6"><td align="center">6</td><td>ADD</td><td>Acc = Acc +
Mem[@]</td></tr>
<tr id="opc7"><td align="center">7</td><td>SUB</td><td>Acc = Acc -
Mem[@]</td></tr>
<tr id="opc8"><td align="center">8</td><td>JAZ</td><td><span class="i18n"
id="jaz">if (Acc == 0) { Mem[99] = 800 + CO; CO = @; }</span></td></tr>
<tr id="opc9"><td align="center">9</td><td>HRS</td><td>Acc = 0; CO = 0;
HALT;</td></tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
</center>
<hr><center><h2><span class="i18n" id="main_memory">M�moire centrale et
entr�e/sortie</span></h2>
<table>
<tbody>
<tr>
<td>
<table style="border-right: ridge">
<thead>
<tr><th><span class="i18n" id="card">Ruban</span></th>
<th><span class="i18n" id="input">Entr�e</span></th>
<th></th>
</tr></thead>
<tbody>
<tr align="center">
<td><textarea id="deck" cols="3em" rows="15" style="font-family:
monospace;"></textarea></td>
<td><textarea id="indeck" cols="3em" rows="15" style="font-family:
monospace;" readonly=""></textarea></td>
<td>&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr align="center">
<td colspan="2"><input type="button" class="i18n" id="load"
onclick="doload();" style="width:100%" value="Charger ruban"></td>
<td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td>
<table id="memory"><tbody><tr><td><span id="lbl00">00</span>:</td><td><input
type="text" style="font-family: monospace; background-color: rgb(153, 255, 204);"
placeholder="???" id="mem00" tabindex="001"></td><td><span
id="equ00"></span></td><td><span id="lbl10">10</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem10"
tabindex="1001"></td><td><span id="equ10"></span></td><td><span
id="lbl20">20</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem20" tabindex="2001"></td><td><span
id="equ20"></span></td><td><span id="lbl30">30</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem30"
tabindex="3001"></td><td><span id="equ30"></span></td><td><span
id="lbl40">40</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem40" tabindex="4001"></td><td><span
id="equ40"></span></td><td><span id="lbl50">50</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem50"
tabindex="5001"></td><td><span id="equ50"></span></td><td><span
id="lbl60">60</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem60" tabindex="6001"></td><td><span
id="equ60"></span></td><td><span id="lbl70">70</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem70"
tabindex="7001"></td><td><span id="equ70"></span></td><td><span
id="lbl80">80</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem80" tabindex="8001"></td><td><span
id="equ80"></span></td><td><span id="lbl90">90</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem90"
tabindex="9001"></td><td><span id="equ90"></span></td></tr><tr><td><span
id="lbl01">01</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem01" tabindex="011"></td><td><span
id="equ01"></span></td><td><span id="lbl11">11</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem11"
tabindex="1011"></td><td><span id="equ11"></span></td><td><span
id="lbl21">21</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem21" tabindex="2011"></td><td><span
id="equ21"></span></td><td><span id="lbl31">31</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem31"
tabindex="3011"></td><td><span id="equ31"></span></td><td><span
id="lbl41">41</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem41" tabindex="4011"></td><td><span
id="equ41"></span></td><td><span id="lbl51">51</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem51"
tabindex="5011"></td><td><span id="equ51"></span></td><td><span
id="lbl61">61</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem61" tabindex="6011"></td><td><span
id="equ61"></span></td><td><span id="lbl71">71</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem71"
tabindex="7011"></td><td><span id="equ71"></span></td><td><span
id="lbl81">81</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem81" tabindex="8011"></td><td><span
id="equ81"></span></td><td><span id="lbl91">91</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem91"
tabindex="9011"></td><td><span id="equ91"></span></td></tr><tr><td><span
id="lbl02">02</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem02" tabindex="021"></td><td><span
id="equ02"></span></td><td><span id="lbl12">12</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem12"
tabindex="1021"></td><td><span id="equ12"></span></td><td><span
id="lbl22">22</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem22" tabindex="2021"></td><td><span
id="equ22"></span></td><td><span id="lbl32">32</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem32"
tabindex="3021"></td><td><span id="equ32"></span></td><td><span
id="lbl42">42</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem42" tabindex="4021"></td><td><span
id="equ42"></span></td><td><span id="lbl52">52</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem52"
tabindex="5021"></td><td><span id="equ52"></span></td><td><span
id="lbl62">62</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem62" tabindex="6021"></td><td><span
id="equ62"></span></td><td><span id="lbl72">72</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem72"
tabindex="7021"></td><td><span id="equ72"></span></td><td><span
id="lbl82">82</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem82" tabindex="8021"></td><td><span
id="equ82"></span></td><td><span id="lbl92">92</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem92"
tabindex="9021"></td><td><span id="equ92"></span></td></tr><tr><td><span
id="lbl03">03</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem03" tabindex="031"></td><td><span
id="equ03"></span></td><td><span id="lbl13">13</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem13"
tabindex="1031"></td><td><span id="equ13"></span></td><td><span
id="lbl23">23</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem23" tabindex="2031"></td><td><span
id="equ23"></span></td><td><span id="lbl33">33</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem33"
tabindex="3031"></td><td><span id="equ33"></span></td><td><span
id="lbl43">43</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem43" tabindex="4031"></td><td><span
id="equ43"></span></td><td><span id="lbl53">53</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem53"
tabindex="5031"></td><td><span id="equ53"></span></td><td><span
id="lbl63">63</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem63" tabindex="6031"></td><td><span
id="equ63"></span></td><td><span id="lbl73">73</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem73"
tabindex="7031"></td><td><span id="equ73"></span></td><td><span
id="lbl83">83</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem83" tabindex="8031"></td><td><span
id="equ83"></span></td><td><span id="lbl93">93</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem93"
tabindex="9031"></td><td><span id="equ93"></span></td></tr><tr><td><span
id="lbl04">04</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem04" tabindex="041"></td><td><span
id="equ04"></span></td><td><span id="lbl14">14</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem14"
tabindex="1041"></td><td><span id="equ14"></span></td><td><span
id="lbl24">24</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem24" tabindex="2041"></td><td><span
id="equ24"></span></td><td><span id="lbl34">34</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem34"
tabindex="3041"></td><td><span id="equ34"></span></td><td><span
id="lbl44">44</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem44" tabindex="4041"></td><td><span
id="equ44"></span></td><td><span id="lbl54">54</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem54"
tabindex="5041"></td><td><span id="equ54"></span></td><td><span
id="lbl64">64</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem64" tabindex="6041"></td><td><span
id="equ64"></span></td><td><span id="lbl74">74</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem74"
tabindex="7041"></td><td><span id="equ74"></span></td><td><span
id="lbl84">84</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem84" tabindex="8041"></td><td><span
id="equ84"></span></td><td><span id="lbl94">94</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem94"
tabindex="9041"></td><td><span id="equ94"></span></td></tr><tr><td><span
id="lbl05">05</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem05" tabindex="051"></td><td><span
id="equ05"></span></td><td><span id="lbl15">15</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem15"
tabindex="1051"></td><td><span id="equ15"></span></td><td><span
id="lbl25">25</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem25" tabindex="2051"></td><td><span
id="equ25"></span></td><td><span id="lbl35">35</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem35"
tabindex="3051"></td><td><span id="equ35"></span></td><td><span
id="lbl45">45</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem45" tabindex="4051"></td><td><span
id="equ45"></span></td><td><span id="lbl55">55</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem55"
tabindex="5051"></td><td><span id="equ55"></span></td><td><span
id="lbl65">65</span>:</td><td><input
type="text" style="font-family: monospace;" placeholder="???" id="mem65"
tabindex="6051"></td><td><span id="equ65"></span></td><td><span
id="lbl75">75</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem75" tabindex="7051"></td><td><span
id="equ75"></span></td><td><span id="lbl85">85</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem85"
tabindex="8051"></td><td><span id="equ85"></span></td><td><span
id="lbl95">95</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem95" tabindex="9051"></td><td><span
id="equ95"></span></td></tr><tr><td><span id="lbl06">06</span>:</td><td><input
type="text" style="font-family: monospace;" placeholder="???" id="mem06"
tabindex="061"></td><td><span id="equ06"></span></td><td><span
id="lbl16">16</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem16" tabindex="1061"></td><td><span
id="equ16"></span></td><td><span id="lbl26">26</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem26"
tabindex="2061"></td><td><span id="equ26"></span></td><td><span
id="lbl36">36</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem36" tabindex="3061"></td><td><span
id="equ36"></span></td><td><span id="lbl46">46</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem46"
tabindex="4061"></td><td><span id="equ46"></span></td><td><span
id="lbl56">56</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem56" tabindex="5061"></td><td><span
id="equ56"></span></td><td><span id="lbl66">66</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem66"
tabindex="6061"></td><td><span id="equ66"></span></td><td><span
id="lbl76">76</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem76" tabindex="7061"></td><td><span
id="equ76"></span></td><td><span id="lbl86">86</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem86"
tabindex="8061"></td><td><span id="equ86"></span></td><td><span
id="lbl96">96</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem96" tabindex="9061"></td><td><span
id="equ96"></span></td></tr><tr><td><span id="lbl07">07</span>:</td><td><input
type="text" style="font-family: monospace;" placeholder="???" id="mem07"
tabindex="071"></td><td><span id="equ07"></span></td><td><span
id="lbl17">17</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem17" tabindex="1071"></td><td><span
id="equ17"></span></td><td><span id="lbl27">27</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem27"
tabindex="2071"></td><td><span id="equ27"></span></td><td><span
id="lbl37">37</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem37" tabindex="3071"></td><td><span
id="equ37"></span></td><td><span id="lbl47">47</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem47"
tabindex="4071"></td><td><span id="equ47"></span></td><td><span
id="lbl57">57</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem57" tabindex="5071"></td><td><span
id="equ57"></span></td><td><span id="lbl67">67</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem67"
tabindex="6071"></td><td><span id="equ67"></span></td><td><span
id="lbl77">77</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem77" tabindex="7071"></td><td><span
id="equ77"></span></td><td><span id="lbl87">87</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem87"
tabindex="8071"></td><td><span id="equ87"></span></td><td><span
id="lbl97">97</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem97" tabindex="9071"></td><td><span
id="equ97"></span></td></tr><tr><td><span id="lbl08">08</span>:</td><td><input
type="text" style="font-family: monospace;" placeholder="???" id="mem08"
tabindex="081"></td><td><span id="equ08"></span></td><td><span
id="lbl18">18</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem18" tabindex="1081"></td><td><span
id="equ18"></span></td><td><span id="lbl28">28</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem28"
tabindex="2081"></td><td><span id="equ28"></span></td><td><span
id="lbl38">38</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem38" tabindex="3081"></td><td><span
id="equ38"></span></td><td><span id="lbl48">48</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem48"
tabindex="4081"></td><td><span id="equ48"></span></td><td><span
id="lbl58">58</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem58" tabindex="5081"></td><td><span
id="equ58"></span></td><td><span id="lbl68">68</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem68"
tabindex="6081"></td><td><span id="equ68"></span></td><td><span
id="lbl78">78</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem78" tabindex="7081"></td><td><span
id="equ78"></span></td><td><span id="lbl88">88</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem88"
tabindex="8081"></td><td><span id="equ88"></span></td><td><span
id="lbl98">98</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem98" tabindex="9081"></td><td><span
id="equ98"></span></td></tr><tr><td><span id="lbl09">09</span>:</td><td><input
type="text" style="font-family: monospace;" placeholder="???" id="mem09"
tabindex="091"></td><td><span id="equ09"></span></td><td><span
id="lbl19">19</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem19" tabindex="1091"></td><td><span
id="equ19"></span></td><td><span id="lbl29">29</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem29"
tabindex="2091"></td><td><span id="equ29"></span></td><td><span
id="lbl39">39</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem39" tabindex="3091"></td><td><span
id="equ39"></span></td><td><span id="lbl49">49</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem49"
tabindex="4091"></td><td><span id="equ49"></span></td><td><span
id="lbl59">59</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem59" tabindex="5091"></td><td><span
id="equ59"></span></td><td><span id="lbl69">69</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem69"
tabindex="6091"></td><td><span id="equ69"></span></td><td><span
id="lbl79">79</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem79" tabindex="7091"></td><td><span
id="equ79"></span></td><td><span id="lbl89">89</span>:</td><td><input type="text"
style="font-family: monospace;" placeholder="???" id="mem89"
tabindex="8091"></td><td><span id="equ89"></span></td><td><span id="lbl99">99
(ra)</span>:</td><td><input type="text" style="font-family: monospace;"
placeholder="???" id="mem99" tabindex="9091"></td><td><span
id="equ99"></span></td></tr></tbody></table>
<script>
function buildmemory() {
var t = document.getElementById('memory');
for (var r = 0; r < 10; ++r) {
var row = t.insertRow();
for (var c = 0; c < 10; ++c) {
var pos = ""+c+r;
var lbl = '<span id="lbl'+pos+'">'+pos+'</span>';
var inp = '<input type="text" style="font-family: monospace;"
placeholder="???" id="mem'+pos+'" tabindex="'+c*10+r+1+'">';
var cell1 = row.insertCell();
cell1.innerHTML = '<td>'+lbl+':</td>';
var cell2 = row.insertCell();
cell2.innerHTML = '<td>'+inp+'</td>';
var cell3 = row.insertCell();
cell3.innerHTML = '<td><span id="equ'+pos+'"></span></td>';
}
}
document.getElementById('mem00').value='001';
document.getElementById('mem99').value=''+OPCODES.JAZ+'??';
document.getElementById('lbl99').innerHTML = '99 (ra)';
}
buildmemory();
</script>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td>
<table style="border-left: ridge">
<thead>
<tr><th></th>
<th><span class="i18n" id="output">Sortie</span></th>
</tr></thead>
<tbody>
<tr align="center">
<td>&nbsp;&nbsp;&nbsp;</td>
<td><textarea id="outdeck" cols="3em" rows="17" style="font-family:
monospace;" readonly=""></textarea></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</center><br><hr>

<!-- Alain -->


<input type="button" class="i18n" id="assemble" onclick="parse(0);"
value="Assembler">
<input type="button" class="i18n" id="load_to_memory" onclick="parse(1);"
value="Charger le programme en memoire">
<input type="button" class="i18n" id="load_to_input" onclick="parse(2);"
value="Charger le programme en ruban bootable">
<!-- Num&eacute;roter les lignes <input type="checkbox" id="srcnumbers"
name="srcnumbers"> -->
<br>
<textarea id="source" cols="80" rows="40" style="font-family: monospace;"
spellcheck="false"></textarea>
<textarea id="diag" cols="40" rows="40" style="font-family: monospace;"
readonly=""></textarea>
<hr>
<script>

var TRAIL = "\\s*(;.*)?";


var NBR = "([0-9]+)";
var ID = "([a-zA-Z][a-zA-Z0-9_]*)";
var OPC = "(INP|LDA|ADD|JAZ|LDI|OUT|STA|SUB|STI|HRS)";
var EMPTY = new RegExp("^"+TRAIL+"$");
var DIREC = new RegExp("^\\s*(\\.at)\\s+"+NBR+TRAIL+"$");
// var INSNS = new RegExp("^\\s*("+ID+"\\s*:\\s)?"
// +"\\s*"+OPC+"\\s+("+ID+"|"+NBR+")"
// +TRAIL+"$");
var INSNS = new RegExp("^\\s*("+ID+"\\s*:\\s)?"
+"\\s*(("+OPC+"\\s+("+ID+"|"+NBR+"))|(HRS))"
+TRAIL+"$");
var WORDS = new RegExp("^\\s*("+ID+"\\s*:\\s)?"
+"\\s*\\.word"
+"\\s+("+ID+"|"+NBR+")((\\s*,\\s*("+ID+"|"+NBR+"))*)"
+TRAIL+"$");
var SPACE = new RegExp("^\\s*("+ID+"\\s*:\\s)?"
+"\\s*(\\.space)\\s+"+NBR+TRAIL+"$");

// Small helpers
var COMMASPACE = new RegExp("\\s*,\\s*");
var ID_NBR = new RegExp(ID+"|"+NBR);

function sanitize(line) {
var numbers = line.match("^\\s*[0-9]+|");
if ( numbers )
line = line.substring(numbers[0].length);
var marker = line.match("^(#[0-9]+>)+");
if ( marker )
line = line.substring(marker[0].length);
return line;
}

function errmsg(errno,lineno,msg) {
return ndig(lineno+1,3)+"|"+"#"+errno+": "+msg+"\n";
}

function fmtinsn(insn) {
var l = ( insn.label ? insn.label : "");
return (l+" ").substring(0,8)
+" "+ndig(insn.addr,2)
+": "+(insn.binary !== undefined ? ndig(insn.binary,3) : "???")
+" | "+insn.tip
+"\n";
}

function parse(charge) {
var sourcetext = document.getElementById('source');
var src = sourcetext.value.split('\n');
var diag = document.getElementById('diag');

diag.value = lang.compiling;
var lineno;
var addr = 1;
var error = 1;
var firstinsn = -1;
var LBLS = { "ra": 99 };
var PROG = [];
for (lineno=0 ; lineno < src.length ; lineno++ )
{
src[lineno] = sanitize(src[lineno])
var line = src[lineno];
var matches;
if ( line.match(EMPTY) ) {
// diag.value += "=== EMPTY\n";
}
else if ((matches=line.match(DIREC)) != null) {
// diag.value += "=== DIREC\n";
var a = parseInt(matches[2]);
if ( a < 1 || a >= 99 ) {
diag.value += errmsg(error,lineno,
lang.invalid_address+
" ("+a+")");
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
addr = a;
}
else if ((matches=line.match(INSNS)) != null ) {
// diag.value += "=== INSN\n";
if ( addr < 1 || addr >= 99 ) {
diag.value += errmsg(error,lineno,
lang.invalid_address+
" ("+addr+")");
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
else {
var label = matches[2];
var opc, pid, pnb, tip;
if (matches[4])
{
opc = matches[5];
pid = matches[7];
pnb = matches[8];
tip = opc+" "+matches[6];
}
else { // argumentless HRS
opc = matches[9];
pid = undefined;
pnb = "99";
tip = opc;
}
if ( label ) {
if ( label in LBLS ) {
diag.value += errmsg(error,lineno,
lang.redefined_label+
" ('"+label+"')");
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
LBLS[label] = addr;
if ( label == "main" && opc != ".word" ) // FIXME:
firstinsn = addr;
}
PROG.push({ addr:addr, label:label,
opc:opc, pid:pid, pnb:pnb, tip:tip,
line:lineno });
if ( firstinsn == -1 && opc != ".word" ) // FIXME:
firstinsn = addr;
}
addr += 1;
}
else if ((matches=line.match(WORDS)) != null) {
// diag.value += "=== WORDS\n";
var args = (matches[3]+matches[6]).split(COMMASPACE)
var enda = addr+args.length-1;
if ( addr < 1 || enda >= 99 ) {
diag.value += errmsg(error,lineno,
lang.invalid_address+
" ("+addr+":"+enda+")");
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
else {
var label = matches[2];
if ( label ) {
if ( label in LBLS ) {
diag.value += errmsg(error,lineno,
lang.redefined_label+
" ('"+label+"')");
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
LBLS[label] = addr;
}
var labl = label;
var pref = ".word";
for ( var a=0 ; a<args.length ; a++ )
{
var idnbr = args[a].match(ID_NBR);
PROG.push({ addr:addr+a, label:labl,
opc:".word",
pid:idnbr[1], pnb:idnbr[2],
tip:pref+" "+args[a],
line:lineno });
labl = undefined;
// pref = " ,";
}
}
addr = enda+1;
}
else if ((matches=line.match(SPACE)) != null) {
// diag.value += "=== SPACE\n";
var size = parseInt(matches[4]);
var enda = addr+size-1;
if ( addr < 1 || enda >= 99 ) {
diag.value += errmsg(error,lineno,
lang.invalid_address+
" ("+addr+":"+enda+")");
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
else {
var label = matches[2];
if ( label ) {
if ( label in LBLS ) {
diag.value += errmsg(error,lineno,
lang.redefined_label+
" ('"+label+"')");
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
LBLS[label] = addr;
}
var labl = label;
var name = (label ? label : "@"+ndig(addr,3));
for (var a=0; a<size ; a++)
{
PROG.push({ addr:addr+a, label:labl,
opc:".space",
pid:undefined, pnb:undefined,
// tip:name+"["+a+"]",
tip:".space 1",
line:lineno });
labl = undefined;
}
}
addr = enda+1;
}
else { // line ignored, faulty
diag.value += errmsg(error,lineno,lang.syntax_error);
src[lineno] = "#"+error+">"+src[lineno];
++error;
}
}

diag.value += lang.address_resolution; // FIXME: encoding


PROG.sort(function(x, y) { return x.addr - y.addr; });
for ( var i=0 ; i<PROG.length ; i++ ) {
var insn = PROG[i];
var a;
// Check overlap
if ( i>0 && insn.addr == PROG[i-1].addr ) {
var prev = PROG[i-1].line+1;
diag.value += errmsg(error,insn.line,lang.conflict+prev);
src[insn.line] = "#"+error+">"+src[insn.line];
// src[prev] = "#"+error+">"+src[prev];
++error;
}
// Resolve labels
else if ( insn.pnb !== undefined ) {
a = parseInt(insn.pnb);
}
else if ( insn.pid !== undefined ) {
if ( LBLS.hasOwnProperty(insn.pid) ) {
a = LBLS[insn.pid];
}
else {
diag.value += errmsg(error,insn.line,
lang.undefined_symbol+" '"+insn.pid+"'");
src[insn.line] = "#"+error+">"+src[insn.line];
++error;
}
}
else
{
// No label, no literal, must be space
}
// Gen binary
if ( insn.opc == ".word" )
insn.binary = a;
else if ( insn.opc == ".space" )
insn.binary = undefined;
else
insn.binary = OPCODES[insn.opc]*100 + a;
}

// We are done with source, copy sanitized version


var srcnum = 0; //document.getElementById('srcnumbers').checked;
{
var s = "";
for ( var i=0 ; i<src.length ; i++ ) {
if ( srcnum )
s += ndig(i+1,3)+"|";
s += src[i] + "\n";
}
sourcetext.value = s;
}

if ( error > 1 ) { // was faulty


diag.value += lang.failure;
return;
}
for ( var i=0 ; i<PROG.length ; i++ ) {
var insn = PROG[i];
diag.value += fmtinsn(insn);
}

if ( charge == 1 ) {
doreset();
doclearmem();
diag.value += lang.loading;
// Fill memory
for ( var i=0 ; i<PROG.length ; i++ ) {
var insn = PROG[i];
//store(insn.addr,insn.binary);
var mem = document.getElementById('mem'+ndig(insn.addr, 2));
if ( insn.binary !== undefined )
mem.value = ndig(insn.binary, 3);
mem.title = insn.tip;
}
// Change labels
for ( var k in LBLS ) {
if ( LBLS.hasOwnProperty(k) ) {
var pos = ndig(LBLS[k],2);
// FIXME: labels
document.getElementById('lbl'+pos).innerHTML = pos+" ("+k+")";
//document.getElementById('equ'+pos).innerHTML = "="+k;
}
}
// Set instruction counter
if ( firstinsn == -1 ) {
diag.value += lang.pc_unset;
}
else {
hidepc();
e_pc.value = ndig(firstinsn,2);
showpc();
}
}
else if ( charge == 2 ) {
diag.value += lang.bootstrap;
if ( PROG[0].addr <= 2 ) {
diag.value += lang.cell_too_low;
}
else {
var savedeck = e_deck.value; // hack to call doload() below
var bsdeck = "002\n800\n";
for ( var i=0 ; i<PROG.length ; i++ ) {
var insn = PROG[i];
if ( insn.binary )
bsdeck += "0" + ndig(insn.addr,2) + "\n"
+ ndig(insn.binary,3) + "\n";
}
if ( firstinsn == -1 ) {
diag.value += lang.pc_unset;
diag.value += lang.halt_after_bootstrap;
bsdeck += "900\n";
}
else {
bsdeck += "8" + ndig(firstinsn,2) + "\n";
bsdeck += savedeck;
hidepc();
e_pc.value = "00";
showpc();
}
e_deck.value = bsdeck;
doload(); // hack
e_deck.value = savedeck;
}
}

diag.value += lang.ok;
}
</script>
<!-- !Alain -->

<script>init();doreset();change_lang(lang);</script>

</body></html>

You might also like