isa/examples: include them into the pdf
[calu.git] / 2_isa / misc.ptex
1 ins ('32', 'branch', 'Branch; jump to pc+imm', '4 | 5 | 16 | 3 | 2 | 1 | 1',
2 'Conditions | OpCode (10110) | Immediate | - | Type | +/- | S',
3 'This instruction should be used with it\'s aliases branch, call, ret and reti. No flags will be affected by this instructions.
4 \\begin{table}[!h]
5 \\centering
6 \\begin{tabular}{|c|c|} \\hline
7 \\textbf{Type}   & \\textbf{Bits} \\\\ \hline
8  branch & 00   \\\\ \hline
9  call   & 01   \\\\ \hline
10  ret    & 10   \\\\ \hline
11  reti   & 11   \\\\ \hline
12 \\end{tabular}
13 \\end{table}');
14
15 ins ('32', 'branchreg', 'Branch; jump to value of reg', '4 | 5 | 4 | 16 | 1 | 1 | 1',
16 'Conditions | OpCode (10111) | Register A | - | Type | +/- | -',
17 'This instruction should be used with it\'s aliases branchr and callr. No flags will be affected by this instructions. If Type is set to 1, the current value of the programcounter is pushed onto the stack.');
18
19 #ins ('32', 'call', 'Call; save pc+4 in stack, jump to pc+imm', '4 | 5 | 16 | 5 | 1 | 1', 'Conditions | OpCode | Immediate | - | +/- | S');
20
21 #ins ('32', 'branchreg', 'Branch; branch to value of reg', '4 | 5 | 4 | 17 | 1 | 1', 'Conditions | OpCode | Register Source| - | +/- | S');
22
23 #ins ('32', 'ret(i)', 'return (from interrupt)', '4 | 5 | 1 | 22 ', 'Conditions | OpCode | I |-');
24
25 #ins ('32', 'ret', 'ret', '4 | 5 | 23 ', 'Conditions | OpCode | -');
26
27 #ins ('32', 'reti', 'reti', '4 | 5 | 23 ', 'Conditions | OpCode | -');
28
29 ins ('32', 'cmp', 'compare (rS1 - rS2)', '4 | 5 | 4 | 4 | 15',
30 'Conditions | OpCode (11000) | Register A (Source1) | Register B (Source2) | -',
31 'This instructions compares the two source registers by subtraction of register B from register A and setting the flags accordingly',
32 'is set to the MSB of the result|is set if the subtraction has a carry out|is set if an overflow occurred|is set if the result is zero');
33
34 ins ('32', 'cmpi', 'compare (rS1 - imm)', '4 | 5 |  4 | 16 | 3',
35 'Conditions | OpCode (11001) | Register A (Source1) | Immediate | -',
36 'This instructions compares the the source register with the immediate be subtracting the immediate from register A and setting the flags accordingly',
37 'is set to the MSB of the result|is set if the subtraction has a carry out|is set if an overflow occurred|is set if the result is zero');