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

Subversion Repositories zet86

[/] [zet86/] [trunk/] [tests/] [11_shifts.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
# sal/shl word operations
5
movw $0x6ec5, %ax
6
movw $0xb1a8, %bx
7
movw $0x5338, (0)
8
movw $0x31fe, (2)
9
 
10
movw $128, %sp
11
 
12
sal  %ax        # (1)
13
pushf
14
mov  %ax, (32)
15
 
16
shlw (0)        # (2)
17
pushf
18
 
19
movw $0x100, %cx
20
shl  %cl, %bx   # (3), zero bit shift
21
pushf
22
movw %bx, (34)
23
 
24
movw $0xffff, %cx
25
movw %bx, %dx
26
sal  %cl, %dx   # (3), -1, result 0
27
pushf
28
movw %dx, (36)
29
 
30
movb $0x8, %cl
31
sal  %cl, %bx   # (3) normal
32
pushf
33
movw %bx, (38)
34
 
35
movb $0x4, %cl
36
sal  %cl, (2)   # (4)
37
pushf
38
 
39
# sal/shl byte operations
40
movw $0x956f, %dx
41
movw $0x4293, %ax
42
movw $0x33c0, (4)
43
movw $0x64ff, (6)
44
 
45
shl  %ah        # (5)
46
pushf
47
mov  %ax, (40)
48
 
49
salb (5)        # (6)
50
pushf
51
 
52
movb $0x7, %cl
53
shl  %cl, %dl   # (7)
54
pushf
55
movw %dx, (42)
56
 
57
salb %cl, (6)   # (8)
58
pushf
59
 
60
# sar word operations
61
movw $0xfb72, %ax
62
movw $0xdfb9, %bx
63
movw $0x1ebb, (8)
64
movw $0x742f, (10)
65
 
66
sar  %ax        # (9)
67
pushf
68
mov  %ax, (44)
69
 
70
sarw (8)        # (10)
71
pushf
72
 
73
movw $0x100, %cx
74
sar  %cl, %bx   # (11), zero bit shift
75
pushf
76
movw %bx, (46)
77
 
78
movw $0xffff, %cx
79
movw %bx, %dx
80
sar  %cl, %dx   # (11), -1, result 0
81
pushf
82
movw %dx, (48)
83
 
84
movb $0x5, %cl
85
sar  %cl, %bx   # (11) normal
86
pushf
87
movw %bx, (50)
88
 
89
movb $0x4, %cl
90
sar  %cl, (10)  # (12)
91
pushf
92
 
93
# sar byte operations
94
movw $0x93b8, %dx
95
movw $0x6688, %ax
96
movw $0xcad4, (12)
97
movw $0x6ec9, (14)
98
 
99
sar  %ah        # (13)
100
pushf
101
mov  %ax, (52)
102
 
103
sarb (13)       # (14)
104
pushf
105
 
106
movb $0x7, %cl
107
sar  %cl, %dl   # (15)
108
pushf
109
movw %dx, (54)
110
 
111
sarb %cl, (14)  # (16)
112
pushf
113
 
114
# shr word operations
115
movw $0x7ba1, %ax
116
movw $0x54e8, %bx
117
movw $0xbaaa, (16)
118
movw $0x3431, (18)
119
 
120
shr  %ax        # (17)
121
pushf
122
mov  %ax, (56)
123
 
124
shrw (16)       # (18)
125
pushf
126
 
127
movw $0x100, %cx
128
shr  %cl, %bx   # (19), zero bit shift
129
pushf
130
movw %bx, (58)
131
 
132
movw $0xffff, %cx
133
movw %bx, %dx
134
shr  %cl, %dx   # (19), -1, result 0
135
pushf
136
movw %dx, (60)
137
 
138
movb $0x4, %cl
139
shr  %cl, %bx   # (19) normal
140
pushf
141
movw %bx, (62)
142
 
143
movb $0x4, %cl
144
shr  %cl, (18)  # (20)
145
pushf
146
 
147
# shr byte operations
148
movw $0x0410, %dx
149
movw $0x1628, %ax
150
movw $0x3b26, (20)
151
movw $0x8d0d, (22)
152
 
153
shr  %ah        # (21)
154
pushf
155
mov  %ax, (64)
156
 
157
shrb (21)       # (22)
158
pushf
159
 
160
movb $0x7, %cl
161
shr  %cl, %dl   # (23)
162
pushf
163
movw %dx, (66)
164
 
165
shrb %cl, (22)  # (24)
166
pushf
167
 
168
 
169
 
170
 
171
hlt
172
 
173
.org 65520
174
jmp start
175
.org 65535
176
.byte 0xff

powered by: WebSVN 2.1.0

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