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

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [verif/] [sw/] [C/] [all_instr.c] - Blame information for rev 31

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 dinesha
 
2
#include <8051.h>
3
 
4
void main()
5
{
6
 
7
        __asm // Add
8
        ADD A,#03
9
        MOV A,#10
10
        MOV R1,#20
11
        ADDC A,R1
12
        JC CHere
13
        CHere : NOP
14
        ADDC A,@R1
15
        ADDC A,30
16
        CJNE A,#30,NEXT
17
        NEXT : NOP
18
 
19
        SUBB A,#01
20
        MOV A,#30 // SUb
21
        MOV R2,#10
22
        SUBB A,R2
23
        //SUBB A,@R3
24
        SUBB A,44
25
 
26
 
27
        MOV A, #30 //Inc
28
        INC A
29
        INC 34
30
        INC DPTR
31
        MOV R1,#20
32
        INC R1
33
 
34
        MOV A, #30 //Dec
35
        DEC A
36
        DEC 34
37
        //DEC DPTR
38
        MOV R3,#20
39
        DEC R3
40
 
41
        MOV A,#5 //Mul
42
        MOV B,#4
43
        MUL AB
44
 
45
        MOV A,#10 //Div
46
        MOV B,#2
47
        DIV AB
48
 
49
 
50
        MOV A,#30 //AND
51
        MOV B,#2
52
        ANL A,B
53
        ANL A,#30
54
        MOV R1,#3
55
        ANL A,@R1
56
        ANL A,#20
57
        ANL A,R1
58
        ANL 30,#33
59
        ANL 30,A
60
 
61
 
62
 
63
 
64
        MOV A,#30 //OR
65
        MOV B,#2
66
        ORL A,B
67
 
68
        ORL A,#30
69
        MOV R1,#3
70
        ORL A,@R1
71
        ORL A,#20
72
        ORL A,R1
73
        ORL 30,#33
74
        ORL 30,A
75
 
76
 
77
        MOV A,#30 // XOR
78
        MOV B,#2
79
        XRL A,B
80
 
81
        XRL A,#30
82
        MOV R1,#3
83
        XRL A,@R1
84
        XRL A,#20
85
        XRL A,R1
86
        XRL 30,#33
87
        XRL 30,A
88
 
89
        MOV A,#65 //RLC
90
        RLC A
91
        RL A
92
        RR A
93
        RRC A
94
 
95
        MOV A,#65 //Swap
96
        SWAP A
97
 
98
        MOV DPTR,#9000
99
        MOVC A,@A+DPTR // Dptr
100
 
101
        MOV A,#47 //DA decimal adjustment
102
        MOV B,#25
103
        ADD A,B
104
        DA A
105
 
106
        AJMP MPLABEL
107
        MPLABEL : NOP
108
 
109
 
110
        ACALL ALABEL
111
        ALABEL : NOP
112
 
113
        LCALL SLABEL
114
        SLABEL : NOP
115
 
116
        MOV A,#01
117
        MOV R1,#01
118
        ADDC A,R1
119
        JNC NHere
120
        NHere : NOP
121
 
122
        JB 45,JHere
123
        NOP
124
        JHere : NOP
125
 
126
        JBC 45,JBCHere
127
        NOP
128
        JBCHere : NOP
129
 
130
        MOV A,#0
131
        JZ AZHere
132
        AZHere : NOP
133
 
134
        MOV A,#1
135
        JNZ ANZHere
136
        ANZHere : NOP
137
 
138
        JMP @A+DPTR
139
 
140
        MOV A,#55
141
        CJNE A,#01, CJHere
142
        CJHere : NOP
143
 
144
        CJNE R1,#99,CRHere
145
        CRHere : NOP
146
 
147
        MOV R1,#3
148
        DJNZ R1, DJHere
149
        DJHere : NOP
150
 
151
        MOV DPTR,#30
152
 
153
        MOVC A,@A+DPTR
154
 
155
        MOVC A,@A+PC
156
 
157
        MOVX A,@R1
158
 
159
        MOVX A,@DPTR
160
 
161
        MOVX @R1,A
162
 
163
        MOVX @DPTR,A
164
 
165
        PUSH 03
166
        POP 03
167
 
168
        MOV A,#30
169
        MOV R1,#50
170
        XCH A,R1
171
        XCH A,33
172
        XCH A,@R1
173
        XCHD A,@R1
174
 
175
        MOV A,#30
176
        ADDC A,#30
177
 
178
        CLR C
179
        CLR 01
180
 
181
        SETB C
182
        SETB 63
183
 
184
        CPL C
185
        CPL 63
186
 
187
        ANL C,01
188
        ANL C,/22
189
        ORL C, 02
190
        ORL C,/22
191
 
192
        MOV C, 01
193
        MOV 01, C
194
 
195
        //ISR 
196
 
197
        SETB P1.3
198
        MOV R3,#255
199
 
200
        BACK : DJNZ R3, BACK
201
        CLR P1.3
202
        RETI
203
 
204
 
205
 
206
 
207
        __endasm;
208
 
209
        while(1) { }
210
 
211
 
212
}

powered by: WebSVN 2.1.0

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