/*
/ISM/dump_opcode_table.js
created 2007-03-28 by yann guidon
version 2007-04-01 : added the IR notice
version 2007-04-08
version 2007-04-16
version 2007-04-17 : allowing aliases
*/
var x=document.getElementById('doc');
var y=document.getElementById('example');
var z=document.getElementById('dump');
var op=loc[loc.length-1];
op=op.replace(/[.].*/,"");
op=op.toUpperCase();
var s='internal error';
var u='';
var m='';
if (table_opcode[op]!=undefined) {
/* display the properties */
t=table_opcode[op].value;
// var instr=opcode_table[t];
var f=table_opcode[op].forms;
var g=table_opcode[op].flags;
/*
if ( (f & (FORM_RI|FORM_I|FORM_ALONE|FORM_IGNORE)) || (g & (USE_Q|USE_SKIPCOND)) ) // Conditions not exhaustive
m='
Note that when register fields, Imm16 or others are not used'+
' (FORM_IR etc.),'+
' these fields are set to arbitrary values for power/EMI reduction.';
*/
s=' opcode : '+op+'\n'+
' opcode number : '+int2hex(t)+'\n';
var e=t & FIELD_GROUP;
if (GroupNames[e])
s+=' group : '+GroupNames[e].replace(/GROUP_/,'')+'\n';
if (e==GROUP_ROP2)
m+='';
if ((e==GROUP_ASU)
|(e==GROUP_ROP2)
|(e==GROUP_SHL)
|(e==GROUP_MISC)
|(e==GROUP_IE))
m+= //' You can play with the execution units with test_eu.html. '+
'For more background information, read the main VSP document.';
if (table_opcode[op].description)
s+=' Description : '+table_opcode[op].description+'\n';
s+=' Forms : '+form2html(f,'')+'\n';
/* generate the examples */
var i,j,k,v,w,fill=' ';
for (i in TableForm) {
if (f & i) {
j=TableForm[i];
k=j.replace(/FORM_/,'');
v=' - '+j+'';
w=op;
if (g & FLAG_SWAPDEST)
w+=TableFormSwp[i];
else {
if (g & (USE_SKIPCOND|USE_Q))
w+=TableFormSkip[i];
else
w+=TableFormNoSwp[i];
}
u+=v+fill.slice(j.length)+
''+w+'\n';
}
}
/* the flags */
if (g > 0) {
s+=' Flags :'
for (i in TableFlags) {
if (g & i) {
s+=' '
+TableFlags[i]+'';
}
}
s+='\n';
}
} // table_opcode[op]!=undefined
x.innerHTML=m;
y.innerHTML=u;
z.innerHTML=s;