File: crc.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 (154 lines) | stat: -rw-r--r-- 3,472 bytes parent folder | download | duplicates (2)
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
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 4.1.0 #12072 (Linux)
;--------------------------------------------------------
; PIC port for the 14-bit core
;--------------------------------------------------------
;	.file	"crc.c"
	list	p=16f1614
	radix dec
	include "p16f1614.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	extern	_WREG
	extern	__sdcc_gsinit_startup
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	global	_main
	global	_i
	global	_data

	global STK15
	global STK14
	global STK13
	global STK12
	global STK11
	global STK10
	global STK09
	global STK08
	global STK07
	global STK06
	global STK05
	global STK04
	global STK03
	global STK02
	global STK01
	global STK00

sharebank udata_ovr 0x0070
STK15	res 1
STK14	res 1
STK13	res 1
STK12	res 1
STK11	res 1
STK10	res 1
STK09	res 1
STK08	res 1
STK07	res 1
STK06	res 1
STK05	res 1
STK04	res 1
STK03	res 1
STK02	res 1
STK01	res 1
STK00	res 1

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
UD_crc_0	udata
_i	res	1

;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_crc_0	udata
r0x1007	res	1
r0x1008	res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------

IDD_crc_0	idata
_data
	db	0x55	; 85	'U'
	db	0x66	; 102	'f'
	db	0x77	; 119	'w'
	db	0x88	; 136
	db	0x00	; 0
	db	0x00	; 0

;--------------------------------------------------------
; initialized absolute data
;--------------------------------------------------------
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	udata_ovr
;--------------------------------------------------------
; reset vector 
;--------------------------------------------------------
STARTUP	code 0x0000
	nop
	pagesel __sdcc_gsinit_startup
	goto	__sdcc_gsinit_startup
;--------------------------------------------------------
; code
;--------------------------------------------------------
code_crc	code
;***
;  pBlock Stats: dbName = M
;***
;has an exit
;2 compiler assigned registers:
;   r0x1007
;   r0x1008
;; Starting pCode block
S_crc__main	code
_main:
; 2 exit points
;	.line	14; "crc.c"	for (i = 1; i <3; i++)
	MOVLW	0x01
	BANKSEL	_i
	MOVWF	_i
_00107_DS_:
;	.line	15; "crc.c"	WREG = data[i];
	BANKSEL	_i
	MOVF	_i,W
	ADDLW	(_data + 0)
	BANKSEL	r0x1007
	MOVWF	r0x1007
	MOVLW	high (_data + 0)
	BTFSC	STATUS,0
	ADDLW	0x01
	MOVWF	r0x1008
	MOVF	r0x1007,W
	MOVWF	FSR0L
	MOVF	r0x1008,W
	MOVWF	FSR0H
	MOVF	INDF0,W
	BANKSEL	_WREG
	MOVWF	_WREG
;	.line	14; "crc.c"	for (i = 1; i <3; i++)
	BANKSEL	_i
	INCF	_i,F
;;unsigned compare: left < lit(0x3=3), size=1
	MOVLW	0x03
	SUBWF	_i,W
	BTFSS	STATUS,0
	GOTO	_00107_DS_
;;genSkipc:3307: created from rifx:0x7ffe88b9ada0
;	.line	16; "crc.c"	}
	RETURN	
; exit point of _main


;	code size estimation:
;	   21+    5 =    26 instructions (   62 byte)

	end