ins ('32', 'addi', 'Add im', '4 | 5 | 4 | 4 | 12 | 1 | 1 | 1', 'Conditions | OpCode (00010) | Register Destination|Register A (Source1)| Immediate | S | C | D',
'Adds register A and immediate and saves the result in register Destination',
'','',
-'mov rD, rS - addid rD, rS, 0');
+'mov-Move-4/000000000000-5/0-6/0-7/0');
# ins ('32', 'addx', 'Add im 16bit', '4 | 5 | 4 | 16 | 1 | 1 | 1', 'Conditions | OpCode | Register Destination| Immediate | H/L | S | C');
ins ('32', 'stackop', 'pop/push/disc/fetch from/to stack', '4 | 5 | 4 | 2 | 17',
-'Conditions | OpCode (01011) | Register Destination (not for disc) | Type | - ',
-'This operation should not be used direct, instead the aliases pop, push, disc and fetch should be used.
-\\begin{table}[!h]
-\\centering
-\\begin{tabular}{|c|c|} \\hline
-\\textbf{Type} & \\textbf{Bits} \\\\ \hline
- pop & 00 \\\\ \hline
- disc & 01 \\\\ \hline
- fetch & 10 \\\\ \hline
- push & 11 \\\\ \hline
-\\end{tabular}
-\\end{table}');
+'Conditions | OpCode (01011) | Register Destination | Type | - ',
+'This operation should not be used direct, instead the aliases pop, push, disc and fetch should be used.','','',
+'pop-pop element from stack-3/00|disc-discard top element of stack-2/0000-3/01|fetch-get top element from stack-3/10|push-push element to stack-3/11');
#ins ('32', 'pop', 'pop from stack', '4 | 5 | 4 | 19', 'Conditions | OpCode | Register Destination | - ');
my $x;
my @fieldnames;
my @flagnames = ('SF', 'CF', 'OF', 'ZF');
+ my $section = "\\subsubsection";
-
+ if($_[9]) {
+ $section = "\\item ";
+ }
@fields = split(/\|/, $_[3]);
foreach my $field (@fields) {
$count = $bits-1;
- $tabular = "\\subsubsection{\\texttt{".$_[1]."} -- ".$_[2]."}\n";
+ $tabular = $section."{\\texttt{".$_[1]."} -- ".$_[2]."}\n";
$tabular .= "\\begin{center} \n \\resizebox{\\textwidth}{!}{\n";
$tabular .= "\\begin{tabular}{|l|";
for($i = $bits-1; $i >= 0; $i--) {
$tabular .= "\\paragraph{Example:}~\\\\ \n \\begin{lstlisting} \n ".$_[7]. " \\end{lstlisting}\n";
}
+ print $tabular;
+
if($_[8]) {
- $tabular .= "\\paragraph{Aliases to this Instruction:}~\\\\\ \n";
+ print "\\paragraph{Aliases to this Instruction:} \n";
my @aliases = split(/\|/, $_[8]);
- $tabular .= "\\begin{table}[!h] \n \\centering \n \\begin{tabular}{|c|c|} \\hline \n";
- $tabular .= "\\textbf{Alias }& \\textbf{".$_[1]." equivalent}\\\\ \\hline \n";
+ print "\\begin{list}{\\labelitemi}{\\leftmargin=0em \\itemindent=1em}";
+
+
foreach my $alias (@aliases) {
- my $equv;
- my $from;
- ($from, $equv) = split(/-/, $alias);
- $tabular .= $from . " & ".$equv." \\\\ \\hline \n";
+ my $long;
+ my $sub;
+ my @params;
+ my $namelist = $_[4];
+
+ @params = split(/-/, $alias);
+ $sub = @params[0];
+ $long = @params[1];
+ shift(@params); shift(@params);
+
+ foreach my $vals (@params) {
+ my $field;
+ my $val;
+ ($field, $val) = split(/\//, $vals);
+
+ my @fieldnames = split(/\|/, $namelist);
+
+ $fieldnames[$field] = $fieldnames[$field]."(".$val.")";
+ $namelist = join("|",@fieldnames);
+ }
+
+ ins($_[0], $sub, $long,$_[3], $namelist, '', '', '', '',1);
}
- $tabular .= "\\end{tabular} \n \\caption{Aliases to the instruction ".$_[1]."} \n \\end{table}";
+ print "\\end{list}";
}
- print $tabular;
}
if($#ARGV != 0) {
ins ('32', 'xorx', 'Xor im 16bit', '4 | 5 | 4 | 16 | 1 | 1 | 1',
'Conditions | OpCode (01010) | Register Destination| Immediate | H/L | F | D',
-'', '', '', 'not rD - xorxlf rD, rD, 0xFFFF');
+'', '', '', 'not-Negate-3/1111111111111111-4/0-5/1');
ins ('32', 'l{l,r}s', 'left/right shift', '4 | 5 | 4 | 4 | 5 | 6 | 1 | 1 | 1 | 1',
'Conditions | OpCode (01011) | Register Destination|Register A (Source1)| Immediate | - | l/r | A C | D',
-ins ('32', 'branch', 'Branch; jump to pc+imm', '4 | 5 | 16 | 3 | 2 | 1 | 1',
+ins ('32', 'jumpop', 'Branch/ret operation', '4 | 5 | 16 | 3 | 2 | 1 | 1',
'Conditions | OpCode (10110) | Immediate | - | Type | +/- | S',
-'This instruction should be used with it\'s aliases branch, call, ret and reti. No flags will be affected by this instructions.
-\\begin{table}[!h]
-\\centering
-\\begin{tabular}{|c|c|} \\hline
-\\textbf{Type} & \\textbf{Bits} \\\\ \hline
- branch & 00 \\\\ \hline
- call & 01 \\\\ \hline
- ret & 10 \\\\ \hline
- reti & 11 \\\\ \hline
-\\end{tabular}
-\\end{table}');
+'This instruction should be used with it\'s aliases branch, call, ret and reti. No flags will be affected by this instructions.','','',
+'branch-Branch relative-4/00|call-Branch relative and save pc to stack-4/01|ret-Return to adress on stack-4/10|ret-Return from interrupt to adress on stack-4/11');
ins ('32', 'branchreg', 'Branch; jump to value of reg', '4 | 5 | 4 | 16 | 1 | 1 | 1',
'Conditions | OpCode (10111) | Register A | - | Type | +/- | -',