of the page
d=cont.getElementsByTagName("div");
for (a in d)
if (d[a].className=="ex") {
b=d[a];
c=FormUsage[b.id.slice(1)];
if(typeof c=="string")
b.innerHTML=c;
}
}
},
"doc/flags":{
titles:i8n.flg,
onLoad: function(cont, h){
var a,b,c,d,e,i, FlagsUsage=[], // build the table of the flags
pr1=hiddenText(1,h); // "The flag "
pr2=hiddenText(2,h); // " is used by these instructions : "
// scan the list of the opcodes
for (c in Y.table_opcode)
if (Y.table_opcode[c].flags>0) {
e=Y.table_opcode[c];
t=" "+Y.decorate_opcode(c);
i=1;
while (i<=e.flags) {
if (i & e.flags) {
b=Y.TableFlags[i];
if (!FlagsUsage[b])
FlagsUsage[b]="
"+pr2;
FlagsUsage[b]+=t;
}
i+=i;
}
}
// scan all the
of the page
d=cont.getElementsByTagName("div");
for (a in d)
if (d[a].className=="ex") {
b=d[a];
c=FlagsUsage[b.id.slice(1)];
if(typeof c=="string")
b.innerHTML=c+"
";
}
}
},
"doc/16-32":{
titles:i8n.d16,
onLoad: function(cont, h){
var f, Usage16=[], Usage32=[];
// scan the list of opcodes
for (var name in Y.table_opcode) {
if (Y.table_opcode[name].forms>0) {
f=Y.table_opcode[name].flags;
if (Y.YASEP16_ONLY & f)
Usage16.push(Y.decorate_opcode(name));
if (Y.YASEP32_ONLY & f)
Usage32.push(Y.decorate_opcode(name));
}
}
if(Usage16.length)
getById("y16","div",cont).innerHTML=Usage16.sort().join(" ");
if(Usage32.length)
getById("y32","div",cont).innerHTML=Usage32.sort().join(" ");
}
},
"doc/multiply":{
titles:i8n.Mul
},
///////////// end of doc submenu
"doc/firstrun":{
titles:i8n.fstr,
menu:"", // empty : don't create the menu from this file (done by menu.js)
style:"ms2_ylrd",
onLoad: function(cont, h){
var w=parentWin(cont);
ygwm.changeDimensions(
Math.ceil((getWidth() *3)/4),
Math.ceil((getHeight()*3)/4),w);
ygwm.move(w,0, 0);
if (!cookies.first_run)
getById("NoCookie","p",cont).innerHTML="";
if (browsLang != LANG.LN) // is it a fallback or a manual choice ?
getById("changelang","span",cont).innerHTML=
hiddenText(1,h)+"
"+browsLang+""
+(LANG.supported?"":" "+hiddenText(2,h));
}
},
"doc/thanks":{
titles:i8n.thx,
menu:"Dev",
style:"ms2_ylrd"
},
"tuto/tuto_fb":{
titles:i8n.tfb,
menu:"Tuto",
style:"ms2_ylrd"
},
"tuto/translations":{
titles:i8n.ttli8n,
menu:"Tuto",
style:"ms2_ylrd"
},
// Keep that one at the end so it's near the "template" on the menu
"tuto/newWin":{
titles:i8n.ttcw,
menu:"Tuto",
onLoad: function(cont,h){
var h="";
for (var i in winman.window_keys)
h+='
'+i+"";
getById("window_keys_list","div",cont).innerHTML=h;
}
}
},
//////////////////////////////////////////////////////////////////////////////////////
// This function is now a generic way to create,
// display and populate/update the ygwm windows
start: function(key) {
var k=DOC_GEN.valid_keys[key],
s=k.style||"doc_cyan",
cont=dcE("DIV");
cont.innerHTML=import_htmi(key);
// get the hidden DIV where language-specific snippets are stored
var h=getByClass("hiddenDiv","DIV",cont),
win = ygwm.new_window(
h?hiddenText(0,h):key, null, cont,
500, 400, 250, 250, false, true, true, true, false, s),
// run an eventual page-specific routine
f=k.onLoad;
if (typeof f == "function")
f(cont,h);
winman.patchInnerLinks(cont); // contains autoindex now
return win;
},
init_obj: function(){
for (var key in DOC_GEN.valid_keys) {
winman.register_key(key,DOC_GEN.start);
var t=DOC_GEN.valid_keys[key],
m=t.menu||"Doc";
if (t.menu !== "")
menu.subMenuItem(menu.list[m], t.titles, key, 0, t.title);
}
}
});
////////////////////////////////////////////////
// For the example in asm.xx.html that uses emit_bin :
function emit_bin_example(){
var asmout=document.getElementById("emitbin_example"),
msgout=document.getElementById("emitbin_msg"),
asmin =document.getElementById("ex_asm_input").value,
h="",m="",
emit_bin_buffer= new Y.ASM_context(
function(col,msg){ // message display routine
m +='
'+msg;
},
function(data, size){// emit_bin_buffer.emit_bin
while (size--) { // displays every byte
h+=" "+int2hex(data&255);
data>>=8;
}
h+=",";
}
);
Y.encode_instruction(asmin,emit_bin_buffer);
asmout.innerHTML=h;
msgout.innerHTML=m;
};