OpenCores
URL https://opencores.org/ocsvn/zet86/zet86/trunk

Subversion Repositories zet86

[/] [zet86/] [trunk/] [tests/] [10_bitwise.s] - Blame information for rev 49

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 zeus
.code16
2
start:
3
 
4
# Some random stuff to start with
5
movw $0x7659, %ax
6
movw $0x4bb8, %bx
7
movw $0x3c84, %cx
8
movw $0x1b76, (0)
9
movw $0x240b, (2)
10
 
11
movw $256, %sp
12
 
13
# Word AND
14
andw %ax, %bx      # (1)
15
pushf
16
movw %bx, (32)
17
andw (2), %cx      # (2)
18
pushf
19
movw %cx, (34)
20
andw %cx, (0)      # (3)
21
pushf
22
andw $0x4571, %ax  # (4)
23
pushf
24
movw %ax, (36)
25
andw $0x27e9, %bx  # (5)
26
pushf
27
movw %bx, (38)
28
andw $0x3549, (2)  # (6)
29
pushf
30
 
31
# Byte AND
32
andb %al, %ah      # (7)
33
pushf
34
movb %ah, (40)
35
andb (1), %cl      # (8)
36
pushf
37
movb %cl, (41)
38
andb %ch, (3)      # (9)
39
pushf
40
andb $0x46, %al    # (10)
41
pushf
42
movb %al, (42)
43
andb $0x2d, %bl    # (11)
44
pushf
45
movb %bl, (43)
46
andb $0xc6, (2)    # (12)
47
pushf
48
 
49
movw $0x05e3, %ax
50
movw $0xf877, %bx
51
movw $0x4ae8, %cx
52
movw $0x3b69, %dx
53
movw $0x30c0, (4)
54
movw $0x5775, (6)
55
movw $0xfe66, (8)
56
 
57
# Word OR
58
orw  %ax, %bx      # (13)
59
pushf
60
movw %bx, (44)
61
orw  (4), %cx      # (14)
62
pushf
63
movw %cx, (46)
64
orw  %ax, (6)      # (15)
65
pushf
66
orw  $0x41c3, %ax  # (16)
67
pushf
68
movw %ax, (48)
69
orw  $0xb05d, %dx  # (17)
70
pushf
71
movw %dx, (50)
72
orw  $0x8d4c, (8)  # (18)
73
pushf
74
 
75
# Byte OR
76
orb %al, %ah       # (19)
77
pushf
78
movb %ah, (52)
79
orb (5), %cl       # (20)
80
pushf
81
movb %cl, (53)
82
orb %ch, (6)       # (21)
83
pushf
84
orb $0x43, %al     # (22)
85
pushf
86
movb %al, (54)
87
orb $0x57, %bl     # (23)
88
pushf
89
movb %bl, (55)
90
orb $0x54, (7)     # (24)
91
pushf
92
 
93
movw $0xd0b4, %ax
94
movw $0x1bb8, %bx
95
movw $0x2b03, %cx
96
movw $0xc3e6, %dx
97
movw $0x3939, (10)
98
movw $0x864b, (12)
99
movw $0x8587, (14)
100
 
101
# Word XOR
102
xorw  %ax, %bx     # (25)
103
pushf
104
movw %bx, (56)
105
xorw (10), %cx     # (26)
106
pushf
107
movw %cx, (58)
108
xorw %ax, (12)     # (27)
109
pushf
110
xorw $0x3d03, %ax  # (28)
111
pushf
112
movw %ax, (60)
113
xorw $0x632d, %dx  # (29)
114
pushf
115
movw %dx, (62)
116
xorw $0xcf07, (14) # (30)
117
pushf
118
 
119
# Byte XOR
120
xorb %al, %ah      # (31)
121
pushf
122
movb %ah, (64)
123
xorb (11), %cl     # (32)
124
pushf
125
movb %cl, (65)
126
xorb %ch, (12)     # (33)
127
pushf
128
xorb $0xb6, %al    # (34)
129
pushf
130
movb %al, (66)
131
xorb $0xae, %bl    # (35)
132
pushf
133
movb %bl, (67)
134
xorb $0xdf, (13)   # (36)
135
pushf
136
 
137
movw $0x4d37, %ax
138
movw $0xdbe1, %bx
139
movw $0x6549, %cx
140
movw $0x5cc4, %dx
141
movw $0xa8a8, (16)
142
movw $0x35f6, (18)
143
movw $0x4f00, (20)
144
 
145
# Word TEST
146
testw  %ax, %bx     # (37)
147
pushf
148
movw %bx, (68)
149
testw (16), %cx     # (38)
150
pushf
151
movw %cx, (70)
152
testw %ax, (18)     # (39)
153
pushf
154
testw $0xdc6f, %ax  # (40)
155
pushf
156
movw %ax, (72)
157
testw $0x3046, %dx  # (41)
158
pushf
159
movw %dx, (74)
160
testw $0x96e4, (20) # (42)
161
pushf
162
 
163
# Byte TEST
164
testb %al, %ah      # (43)
165
pushf
166
movb %ah, (76)
167
testb (15), %cl     # (44)
168
pushf
169
movb %cl, (77)
170
testb %ch, (16)     # (45)
171
pushf
172
testb $0xc0, %al    # (46)
173
pushf
174
movb %al, (78)
175
testb $0xe0, %bl    # (47)
176
pushf
177
movb %bl, (79)
178
testb $0xbb, (17)   # (48)
179
pushf
180
 
181
movw $0xbfa5, %dx
182
movw $0x4be6, (22)
183
movw $0xe9d2, (24)
184
 
185
movw $0x12b1, %ax
186
pushw %ax
187
popf
188
 
189
# Word NOT
190
notw %dx            # (49)
191
pushf
192
movw %dx, (80)
193
notw (22)           # (50)
194
pushf
195
 
196
# Byte NOT
197
notb %dl            # (51)
198
pushf
199
movb %dl, (82)
200
notb (24)           # (52)
201
pushf
202
 
203
hlt
204
 
205
 
206
.org 65520
207
jmp start
208
.org 65535
209
.byte 0xff

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.