isa/examples: adapted sum and bootrom
[calu.git] / 2_isa / arith.ptex
1 ins ('32', 'add', 'Add',
2 '4 | 5 | 4 | 4 | 4 | 9 | 1 | 1',
3 'Conditions | OpCode | Register Destination|Register A (Source1)| Register B (Source2) | - | C | SU',
4 'Adds Register A and Register B and save result in Register Destination \\\\
5 When bit C is set, the content of the carry flag is also added. When the SU bit is set, the PSW gets updated (default is set)',
6 'is set to the MSB of the result | is set if addition has a carry out | is set if a overflow occured | is set if the result is zero ',
7 'add  r0, r2, r4 ; add low bytes
8  addc r1, r3, r5 ; add high bytes');
9
10 ins ('32', 'addi', 'Add im', '4 | 5 | 4 | 4 | 12 | 1 | 1 | 1', 'Conditions | OpCode | Register Destination|Register A (Source1)| Immediate | H/L | S | C',
11 'H/L oder C kommen raus, daf\\"ur SU rein');
12
13 # ins ('32', 'addx', 'Add im 16bit', '4 | 5 | 4 | 16 | 1 | 1 | 1', 'Conditions | OpCode | Register Destination| Immediate | H/L | S | C');
14
15 ins ('32', 'sub', 'Sub', '4 | 5 | 4 | 4 | 4 | 9 | 1 | 1', 'Conditions | OpCode | Register Destination|Register A (Source1)| Register B (Source2) | - | C | SU');
16
17 ins ('32', 'subi', 'Sub im', '4 | 5 | 4 | 4 | 12 | 1 | 1 | 1', 'Conditions | OpCode | Register Destination|Register A (Source1)| Immediate | H/L | S | C');
18
19 # ins ('32', 'subx', 'Sub im 16bit', '4 | 5 | 4 | 16 | 1 | 1 | 1', 'Conditions | OpCode | Register Destination| Immediate | H/L | S | C');
20
21