summaryrefslogtreecommitdiff
path: root/tests/alu
blob: 474acbb1b1a8117560366368c0e969341ff1b673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# X op Y = RESULT ZERO CARRY
#
# Operations:
#  +   : add
#  -   : subtract
#  *   : multiply
#  /   : divide
#  &   : and
#  |   : or
#  ^   : xor
#  <<  : left shift extended with zeros
#  <<1 : left shift extended with ones
#  <<- : left shift extended with least significant bit
#  <<< : left rotate
#  >>  : right shift extended with zeros
#  1>> : right shift extended with ones
#  ->> : right shift extended with most significant bit
#  >>> : right rotate

0x0123 + 0x1234 = 0x1357 Z=0 C=0
0x0123 - 0x1234 = 0xeeef Z=0 C=1
0x0123 - 0x0123 = 0x0000 Z=1 C=0
0x0123 * 0x1234 = 0xb11c Z=0 C=0
0x3e58 / 0x0078 = 0x0085 Z=0 C=0
0xaf74 & 0x7cc7 = 0x2c44 Z=0 C=0
0xaf74 | 0x7cc7 = 0xfff7 Z=0 C=0
0xaf74 ^ 0x7cc7 = 0xd3b3 Z=0 C=0
0xfa0a <<  0x01 = 0xf414 Z=0 C=0
0xfa0a <<  0x02 = 0xe828 Z=0 C=0
0xfa0a >>  0x02 = 0x3e82 Z=0 C=0
0xfa0a >>  0x04 = 0x0fa0 Z=0 C=0
0xfa0a <<  0x04 = 0xa0a0 Z=0 C=0
0xfa0a <<1 0x04 = 0xa0af Z=0 C=0
0xfa0a 1>> 0x04 = 0xffa0 Z=0 C=0
0xfa0a <<- 0x04 = 0xa0a0 Z=0 C=0
0xfa0a ->> 0x04 = 0xffa0 Z=0 C=0
0xfa0a >>> 0x04 = 0xafa0 Z=0 C=0
0xfa0a <<< 0x04 = 0xa0af Z=0 C=0
0x0001 <<- 0x0e = 0x7fff Z=0 C=0
0x0001 <<- 0x10 = 0xffff Z=0 C=0
0x0001 ->> 0x10 = 0x0000 Z=1 C=0
0x0001 <<- 0xff = 0xffff Z=0 C=0
0x0001 ->> 0xff = 0x0000 Z=1 C=0