isa: update display of alias instructions
authorMartin Perner <martin@perner.cc>
Fri, 29 Oct 2010 15:27:17 +0000 (17:27 +0200)
committerMartin Perner <martin@perner.cc>
Fri, 29 Oct 2010 16:03:53 +0000 (18:03 +0200)
2_isa/arith.ptex
2_isa/data.ptex
2_isa/gentex.pl
2_isa/logic.ptex
2_isa/misc.ptex

index 32bd6f40b5d518bbc2888911e59916d78e29e39d..b17ed92ab8a10facaa1bc3d26aa4ff3fac2b5e2b 100644 (file)
@@ -9,7 +9,7 @@ ins ('32', 'add', 'Add',
 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');
 
index bd2e5069e0029c6a4ab88433b264e3e8da60db24..e86d52f40a03fae4757d5c6abf1f82c4110428a0 100644 (file)
@@ -1,16 +1,7 @@
 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 | - ');
 
index 4b0d8ee82bd3e2baf5c4e2604589a34e087bba38..967bd7a99b1101dae2a073c05295664b202fe62d 100755 (executable)
@@ -21,8 +21,11 @@ sub ins {
        my $x;
        my @fieldnames;
        my @flagnames = ('SF', 'CF', 'OF', 'ZF');
+       my $section = "\\subsubsection";
 
-
+       if($_[9]) {
+               $section = "\\item ";
+       }
 
        @fields = split(/\|/, $_[3]);
        foreach my $field (@fields) {
@@ -74,7 +77,7 @@ sub ins {
 
        $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--) {
@@ -161,22 +164,42 @@ sub ins {
                $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) {
index 58fa987bcf884b007649de6662908dedea4f07c1..55a6889705ef70d4ff888acc1ac2dba82c86ec11 100644 (file)
@@ -23,7 +23,7 @@ ins ('32', 'xor', 'Or', '4 | 5 | 4 | 4 | 4 | 10 | 1',
 
 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',
index a36bf55145b4525cac43f2b52901cc566f0be7ea..9ba12d87ea12d81251aa588a23537f952b98f0b1 100644 (file)
@@ -1,16 +1,7 @@
-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 | +/- | -',