File: p18.asm

package info (click to toggle)
gpsim 0.32.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,640 kB
  • sloc: cpp: 121,258; asm: 54,223; ansic: 13,576; python: 9,708; sh: 4,695; makefile: 1,566; lex: 1,139; yacc: 854; pascal: 511; perl: 93; awk: 44; xml: 41
file content (183 lines) | stat: -rw-r--r-- 1,759 bytes parent folder | download | duplicates (7)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
	;; 18.asm
	;;
	;; Test the 18c instruction set

  processor	18c452	

  cblock  0x0c

	temp,temp1,temp2
  endc

	org 0
start

	addlw	4
	addlw	0xff
	addlw	0x100		; error
	
	addwf	0x11,1
	addwf	0x11,1,0
	addwf	0x11,1,1
	addwf	0x11,1,b
	
	addwfc	0x11,w,0
	addwfc	0x11,f,1
	addwfc	temp,w,b

	andlw	4
	andlw	0xff
	andlw	0x100		; error
	
	andwf	0x11,1,0
	andwf	0x11,1,1
	andwf	0x11,1,b
	
	bc	$+5
	
	bcf	temp1,5,0
	bcf	temp1,7

	bn	$-5
	bnc	$+0x7f
	bnn	$-0x7f

	bnov	start
	bnz	start
	bra	start
	bra	0x3ff

	bsf	temp2,1,b

	btfsc	temp1,4,b
	btfss	temp1,4

	btg	temp,0,b
	bov	start
	bz	$
	
	call	start
	call	$+0x10001,s

	clrf	temp
	clrf	temp1,b
	clrf	temp1,0

	clrwdt

	comf	temp,w,0
	cpfseq	temp1,0
	cpfsgt	temp,1
	cpfslt	temp,1

	daw

	decf	temp,w,0
	decf	temp1,f,1

	decfsz	temp,w,0
	decfsz	temp1,f,1
	
	dcfsnz	temp,w,0
	dcfsnz	temp1,f,1
	
	goto	0xfffff
	
	incf	temp,w,0
	incf	temp1,f,b

	incfsz	temp,w,0
	incfsz	temp1,f,b
	
	infsnz	temp,w,0
	infsnz	temp1,f,b
	
	iorlw	4
	iorlw	0xff
	
	iorwf	0x11,1,0
	iorwf	0x11,1,1

	lfsr	3,0xfab

	movf	temp,w,0
	movf	temp1,f,b

	movff	temp1,temp2

	movlb	0x55
	movlw	0xab

	movwf	temp
	movwf	temp,b

	mullw	0x42
	mulwf	temp,b

	negf	temp,0
	nop

	pop
	push

	rcall	-0x3ff
	rcall	0x7ff

	reset
	retfie	0
	retlw	0xde
	return	1
	
	rlcf	temp,w,0
	rlcf	temp1,f,b

	rlncf	temp,w,0
	rlncf	temp1,f,b

	rrcf	temp,w,0
	rrcf	temp1,f,b

	rrncf	temp,w,0
	rrncf	temp1,f,b

	setf	temp1,b

	sleep

	subfwb	temp,w,0
	subfwb	temp1,f,b

	sublw	0x33
	
	subwf	temp,w,0
	subwf	temp1,f,b

	subwfb	temp,w,0
	subwfb	temp1,f,b

	swapf	temp,w,0
	swapf	temp1,f,b

	sublw	0x33 | 0x0f
	sublw	5 * 8

 	tblrd	*
 	tblrd	*+
 	tblrd	*-
	tblrd	+*

 	tblwt	*
 	tblwt	*+
 	tblwt	*-
	tblwt	+*

	tstfsz	temp1,b

	xorlw	0xff

	xorwf	temp,w,0
	xorwf	temp1,f,b


	end